Req #81474 [Opn->Csd]: Make ReflectionEnum and related class non-final

From: Date: Tue, 28 Sep 2021 07:38:56 +0000
Subject: Req #81474 [Opn->Csd]: Make ReflectionEnum and related class non-final
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236879@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81474&edit=1 ID: 81474 Updated by: git@php.net Reported by: ondrej at mirtes dot cz Summary: Make ReflectionEnum and related class non-final -Status: Open +Status: Closed Type: Feature/Change Request Package: Reflection related Operating System: N/A PHP Version: 8.1.0RC2 Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikic Revision: https://github.com/php/php-src/commit/f2ae8a33578f21d29d3bbc81d146fe93dd616506 Log: Fix bug #81474: Make Reflection(Attribute|Enum|EnumBackedCase) non-final Previous Comments: ------------------------------------------------------------------------ [2021-09-27 14:39:31] nikic@php.net The following pull request has been associated: Patch Name: Make Reflection(Attribute|Enum|EnumBackedCase) non-final On GitHub: https://github.com/php/php-src/pull/7520 Patch: https://github.com/php/php-src/pull/7520.patch ------------------------------------------------------------------------ [2021-09-26 14:21:12] ocramius@php.net Ref: https://github.com/Roave/BetterReflection/issues/789 ------------------------------------------------------------------------ [2021-09-25 07:01:36] kukulich at kukulich dot cz There's also a problem with ReflectionAttribute. It would be perfect to remove the final for it too. I think it could be done even in PHP 8 because the change is backward compatible. ------------------------------------------------------------------------ [2021-09-24 11:28:39] ondrej at mirtes dot cz Description: ------------ Library Roave/BetterReflection (https://github.com/Roave/BetterReflection) has a goal of providing runtime reflection compatible API for PHP reflection classes in the Adapter namespace: https://github.com/Roave/BetterReflection/tree/5.0.x/src/Reflection/Adapter This feature is prominently used by PHPStan, and maybe other open-source users as well. In order for BetterReflection library to be able to be used in place of the official API via polymorphism, it needs to have the ability to extend core reflection classes like ReflectionClass and ReflectionMethod. It has been doing that successfully. PHP 8.1 introduces ReflectionEnum class, and unfortunately it's final. This change request is about making this class non-final, and also all classes accessible through that one like ReflectionEnumPureCase, ReflectionEnumBackedCase, and ReflectionEnumUnitCase. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81474&edit=1

« previous php.bugs (#236879) next »