Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Commit

Permalink
Support overriding here too
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored Aug 5, 2020
1 parent 23cc0ba commit 4ecb32b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/EventServiceProviderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ protected function getListenerMap()
{
$class = $this->getServiceProviderClass($this->app);

$reflection = new ReflectionClass($class);

$property = $reflection->getProperty('listen');
return $this->getEventListeners(new $class($this->app));
}

protected function getEventListeners($provider)
{
$property = (new ReflectionClass($provider))->getProperty('listen');
$property->setAccessible(true);

return $property->getValue(new $class($this->app));
return $property->getValue($provider);
}
}

0 comments on commit 4ecb32b

Please sign in to comment.