-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix callParent method on php 8 #31
base: master
Are you sure you want to change the base?
Conversation
I appreciate this update. Would like to see it merged with master for php 8 support. |
I appreciate this update. Would like to see it merged with master for php 8 support. |
Hello, is there a version for php 8 yet? |
@jarektkaczyk Any chance this pull request can get merged? It would help me use the wonderful mappable package in php8 projects. |
@jarektkaczyk Thanks for this neat package! As mentioned by others here, there are some issues on PHP8, so it would be highly appreciated if this pull request could be merged soon. |
@jarektkaczyk Are there any plans to merge this in? Is this project still being maintained? This is preventing us from upgrading to PHP 8. PHP 7.4 goes end of life on 28 Nov 2022. |
I use composer's patches to apply the fixes. |
@maqduni Can you elaborate on how you do this here? |
"extra": {
"laravel": {
"dont-discover": []
},
"enable-patching": "true",
"patches": {
"sofa/hookable": {
"Fix Parameter Grouping with Laravel 7.x": "patches/sofa_hookable/fix_parameter_grouping_with_laravel_7_x.diff",
"Fix callParent method on php 8": "patches/sofa_hookable/fix_call_parent_method_on_php_8.diff"
}
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"cweagans/composer-patches": true
}
},
|
@jarektkaczyk Would appreciate it if we can have this merged into master. |
@maqduni Sorry for the delayed response! And thanks so much for the suggestion. I've tried this avenue, and it almost works - the only thing is that composer times out and I can see why when I run verbose mode with -v : I'm being asked for the file name that needs to be patched in the CLI. Somehow it is not automatically patching the file. Any idea what setting I may be missing? Or can you paste the contents of your diff file patches/sofa_hookable/fix_call_parent_method_on_php_8.diff ? Thanks again! |
Sorry @maqduni, scratch that. I've found the solution meanwhile and it all works now. For the others on the thread, here's a step-by-step to how you can patch this into the package with a composer installation (thanks to @maqduni for being the actual source of the solution):
The patch should now be applied. @maqduni also patched another file with the entry |
The
call_user_func_array
function has been slightly changed on PHP 8 — it supports named arguments now and interprets assoc arrays like them.Also, calling parent methods now for some reason doesn't work this way.