framework
framework copied to clipboard
PHP 8 Compatibility
I'm not sure if this is the correct package to report the issue, but I've just upgraded to PHP 8 and got the following error:
Fatal error: Declaration of Go\ParserReflection\Traits\ReflectionClassLikeTrait::getConstants() must be compatible with ReflectionClass::getConstants(?int $filter = null) in /var/www/html/vendor/goaop/parser-reflection/src/ReflectionClass.php on line 214
Is the library supposed to work with PHP 8 or I'm pulling some older transitive dependency?
Here is part of my dependencies tree:
- codeception/aspect-mock 3.1.0
- goaop/framework 2.3.0
- goaop/parser-reflection 2.1.2
Hello! I can confirm that goaop/framework
doesn't support PHP8 yet. First, the goaop/parser-reflection
should be updated to support PHP8, as there are some important changes in Refection API.
Would you like to work on this? )
From PHP8 News The upgrading guide specifies that if you extend these classes, and still want to support both PHP 7 and PHP 8, the following signatures are allowed:
ReflectionClass::newInstance($arg = null, ...$args);
ReflectionFunction::invoke($arg = null, ...$args);
ReflectionMethod::invoke($object, $arg = null, ...$args);
When i use classMap some file for goaop/parser-reflection
, it work well
@lisachenko I'm not sure from where to start. Are you planning to deprecate goaop/parser-reflection (https://github.com/goaop/framework/issues/465#issuecomment-754576563)? I also noticed that master is quite ahead of the latest stable parser-reflection 2.1.2 release.
Personally, I don't want to deprecate/abandon my own goaop/parser-reflection
library, but I see that I don't have enough free time to develop/maintain it. Thus, it will be honest to highlight this and abandon it by switching to BetterReflection package.
Theoretically, I can make parser-reflection working with PHP8 without new features, this can give some time to test/play with current packages and unblock migration to PHP8.
Linked issue: https://github.com/Roave/BetterReflection/issues/701.
So, there are no currently working static reflection libraries supporting PHP8 now, neither my, nor BR is not ready for that.
FYI: It seems that BR portability is getting up to speed: https://github.com/Roave/BetterReflection/issues/701
Yes, I’m looking forward to have this PHP8 support added to BR, then need one more step - to migrate my framework to BR
Hi! Are there any updates to that? It seems BetterReflection has added support for PHP 8.
Yep, BR has now PHP8 support, looking for someone who can do integration ) I don't have enough time to do it, so can't promise it will be ready soon...
I am currently refactoring the library to support PHP 8.0. See https://github.com/WalterWoshid/goaop-framework/issues/1 for progress information
Done https://github.com/goaop/framework/pull/486
Hello everyone,
I have released version 1.0.0
of Okapi/Aop, which is a AOP library, heavily inspired from goaop/framework. The minimum PHP version is 8.1
and also supports PHP 8.2
. It uses the new PHP Attributes and aims for easy usage. Currently it only supports Before
, Around
and After
advices, but there will be more in the future!