Skip to content

Make Reflection(Attribute|Enum|EnumBackedCase) non-final #7520

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

Closed
wants to merge 1 commit into from

Conversation

nikic
Copy link
Member

@nikic nikic commented Sep 27, 2021

As requested in https://bugs.php.net/bug.php?id=81474:
BetterReflection would like to extend these classes to provide
adaptors. As our other Reflector classes are non-final, I think
it makes sense to make these non-final as well.

As requested in https://bugs.php.net/bug.php?id=81474:
BetterReflection would like to extend these classes to provide
adaptors. As our other Reflector classes are non-final, I think
it makes sense to make these non-final as well.
@nikic
Copy link
Member Author

nikic commented Sep 27, 2021

@krakjoe @ramsey @patrickallaert Any objections to doing this?

@ramsey
Copy link
Member

ramsey commented Sep 27, 2021

This makes sense to me. Was there a design reason they were made final?

@nikic
Copy link
Member Author

nikic commented Sep 27, 2021

Let's check with @iluuu1994 and @Crell on that... though I think they are final because we tend to make all new classes final by default.

@iluuu1994
Copy link
Member

Fine with me. Like you said, I made them final because I didn't think there was a good reason not to.

@@ -696,7 +696,7 @@ private function __construct() {}
}

/** @not-serializable */
final class ReflectionAttribute implements Reflector
class ReflectionAttribute implements Reflector
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReflectionAttribute exists since PHP 8.0, can we target this version as per https://bugs.php.net/bug.php?id=81474#1632553296 comment?

@krakjoe
Copy link
Member

krakjoe commented Sep 27, 2021 via email

@nikic nikic closed this in f2ae8a3 Sep 28, 2021
@Crell
Copy link
Contributor

Crell commented Sep 28, 2021

I didn't even realize they were final. I generally don't care for final classes, so no objection to de-finalizing them.

nikic pushed a commit that referenced this pull request Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants