Skip to content

Commit

Permalink
bug #26400 [Config] ReflectionClassResource check abstract class (and…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
fabpot committed Mar 13, 2018
2 parents 2655496 + e851514 commit f77db05
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -155,12 +155,16 @@ private function generateSignature(\ReflectionClass $class)
}
}

if ($class->isSubclassOf(EventSubscriberInterface::class)) {
if ($class->isAbstract() || $class->isInterface() || $class->isTrait()) {
return;
}

if (interface_exists(EventSubscriberInterface::class, false) && $class->isSubclassOf(EventSubscriberInterface::class)) {
yield EventSubscriberInterface::class;
yield print_r(\call_user_func(array($class->name, 'getSubscribedEvents')), true);
}

if ($class->isSubclassOf(ServiceSubscriberInterface::class)) {
if (interface_exists(ServiceSubscriberInterface::class, false) && $class->isSubclassOf(ServiceSubscriberInterface::class)) {
yield ServiceSubscriberInterface::class;
yield print_r(\call_user_func(array($class->name, 'getSubscribedServices')), true);
}
Expand Down

0 comments on commit f77db05

Please sign in to comment.