Skip to content

Commit

Permalink
[Config] ReflectionClassResource check abstract ServiceSubscriberInte…
Browse files Browse the repository at this point in the history
…rface and EventSubscriberInterface
  • Loading branch information
andrey1s authored and nicolas-grekas committed Mar 12, 2018
1 parent ae25291 commit e851514
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 e851514

Please sign in to comment.