Closed kocsismate closed 1 month ago
@kocsismate can we safely add int
to these types, even for versions before 8.4
?
@Ocramius No unfortunately, typed class constants were only added in PHP 8.3... So somehow the issue should be circumvented 🤔 Baiscally, PHPStan has the same BC problem with their forked version: https://github.com/phpstan/phpstan/issues/10182
I think we can safely rename the constant to something else then: https://github.com/Roave/BetterReflection/commit/a4e5618c5907c00e9315e8d3b3547d8c8679a4e9
We'd also mark it @internal
PHP 8.4 made the ReflectionClass::IS_READONLY class constant typed in https://github.com/php/php-src/pull/12378. Since
Roave\BetterReflection\Reflection\Adapter\ReflectionClass
overrides it, the following exception is thrown when using PHP 8.4: