summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-06-08 09:42:45 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-06-08 09:42:45 +0200
commit5e1805d253f9b42e5cfeddd2d53db697d671f904 (patch)
tree291e4eccd9e7450fad06159e065a28e8e28ccf3a /lib
parentc5a2caa0fb29daac80ba2b76865be2404ba41021 (diff)
downloadnextcloud-server-5e1805d253f9b42e5cfeddd2d53db697d671f904.tar.gz
nextcloud-server-5e1805d253f9b42e5cfeddd2d53db697d671f904.zip
Fix missing parent constructor call and get_class usage in GenericEventWrapper
* The parent constructor was not called * `get_class` does not allow null values in php7.2+ Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/EventDispatcher/GenericEventWrapper.php8
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();
}