-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Config] ReflectionClassResource check abstract class #26400
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
Conversation
|
@jakzal yes, add issue |
} | ||
|
||
if ($class->isSubclassOf(ServiceSubscriberInterface::class)) { | ||
yield ServiceSubscriberInterface::class; | ||
yield print_r(\call_user_func(array($class->name, 'getSubscribedServices')), true); | ||
if (!$class->isAbstract()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should also check for isInterface()
@@ -157,12 +157,16 @@ private function generateSignature(\ReflectionClass $class) | |||
|
|||
if ($class->isSubclassOf(EventSubscriberInterface::class)) { | |||
yield EventSubscriberInterface::class; | |||
yield print_r(\call_user_func(array($class->name, 'getSubscribedEvents')), true); | |||
if (!$class->isAbstract()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the check should be merged in the above "if", no need to yield EventSubscriberInterface::class
(same below, and I agree with @chalasr comment below also)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or, just before the current two checks, we could just add
if ($class->isAbstract() || $class->isInterface()) {
return;
}
…rface and EventSubscriberInterface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(comments addressed by push-forcing on the fork)
Thank you @andrey1s. |
…rey1s) This PR was merged into the 3.4 branch. Discussion ---------- [Config] ReflectionClassResource check abstract class generate Signature update hash methods `ServiceSubscriberInterface::getSubscribedServices` and `EventSubscriberInterface::getSubscribedEvents` if the class is not abstract | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26459, #26501 | License | MIT Commits ------- e851514 [Config] ReflectionClassResource check abstract ServiceSubscriberInterface and EventSubscriberInterface
generate Signature
update hash methods
ServiceSubscriberInterface::getSubscribedServices
andEventSubscriberInterface::getSubscribedEvents
if the class is not abstract