Req #81474 [Com]: Make ReflectionEnum and related class non-final
| From: | ocramius@php.net | Date: | Sun, 26 Sep 2021 14:21:12 +0000 |
| Subject: | Req #81474 [Com]: Make ReflectionEnum and related class non-final | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236850@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
Comment by: ocramius@php.net
Reported by: ondrej at mirtes dot cz
Summary: Make ReflectionEnum and related class non-final
Status: Open
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:
Ref: https://github.com/Roave/BetterReflection/issues/789
Previous Comments:
------------------------------------------------------------------------
[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