diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-06-08 11:26:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-08 11:26:23 +0200 |
commit | fd62a5b59a08e139417f8271f95e8d56e2090ccb (patch) | |
tree | 5510fed10238e74de3cfc418dc7781d9238b453a | |
parent | 9a196d12a89291d9c2594b1f9a1cd60c9da391c4 (diff) | |
parent | 5e1805d253f9b42e5cfeddd2d53db697d671f904 (diff) | |
download | nextcloud-server-fd62a5b59a08e139417f8271f95e8d56e2090ccb.tar.gz nextcloud-server-fd62a5b59a08e139417f8271f95e8d56e2090ccb.zip |
Merge pull request #21299 from nextcloud/fix/generic-event-wrapper-constructor-get-class
Fix missing parent constructor call and get_class usage in GenericEventWrapper
-rw-r--r-- | lib/private/EventDispatcher/GenericEventWrapper.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/EventDispatcher/GenericEventWrapper.php b/lib/private/EventDispatcher/GenericEventWrapper.php index d1d136affc0..dc3e7553f0c 100644 --- a/lib/private/EventDispatcher/GenericEventWrapper.php +++ b/lib/private/EventDispatcher/GenericEventWrapper.php @@ -40,24 +40,26 @@ class GenericEventWrapper extends GenericEvent { private $eventName; public function __construct(ILogger $logger, string $eventName, ?GenericEvent $event) { + parent::__construct($eventName); $this->logger = $logger; $this->event = $event; $this->eventName = $eventName; } private function log() { + $class = ($this->event !== null && is_object($this->event)) ? get_class($this->event) : 'null'; $this->logger->info( 'Deprecated event type for {name}: {class} is used', - [ 'name' => $this->eventName, 'class' => is_object($this->event) ? get_class($this->event) : 'null' ] + [ 'name' => $this->eventName, 'class' => $class] ); } - public function isPropagationStopped() { + public function isPropagationStopped(): bool { $this->log(); return $this->event->isPropagationStopped(); } - public function stopPropagation() { + public function stopPropagation(): void { $this->log(); $this->event->stopPropagation(); } |