diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/EventDispatcher/SymfonyAdapter.php | 18 | ||||
-rw-r--r-- | lib/private/Files/Cache/AbstractCacheEvent.php | 2 | ||||
-rw-r--r-- | lib/public/App/ManagerEvent.php | 2 | ||||
-rw-r--r-- | lib/public/Comments/CommentsEntityEvent.php | 2 | ||||
-rw-r--r-- | lib/public/Comments/CommentsEvent.php | 2 | ||||
-rw-r--r-- | lib/public/Console/ConsoleEvent.php | 2 | ||||
-rw-r--r-- | lib/public/SabrePluginEvent.php | 2 | ||||
-rw-r--r-- | lib/public/SystemTag/ManagerEvent.php | 2 | ||||
-rw-r--r-- | lib/public/SystemTag/MapperEvent.php | 2 | ||||
-rw-r--r-- | lib/public/SystemTag/SystemTagsEntityEvent.php | 2 |
10 files changed, 22 insertions, 14 deletions
diff --git a/lib/private/EventDispatcher/SymfonyAdapter.php b/lib/private/EventDispatcher/SymfonyAdapter.php index f2f2fbf59fd..f8f80b6c5f8 100644 --- a/lib/private/EventDispatcher/SymfonyAdapter.php +++ b/lib/private/EventDispatcher/SymfonyAdapter.php @@ -25,9 +25,9 @@ declare(strict_types=1); namespace OC\EventDispatcher; +use OCP\ILogger; use function is_callable; use OCP\EventDispatcher\Event; -use Symfony\Component\EventDispatcher\Event as SymfonyEvent; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -35,9 +35,12 @@ class SymfonyAdapter implements EventDispatcherInterface { /** @var EventDispatcher */ private $eventDispatcher; + /** @var ILogger */ + private $logger; - public function __construct(EventDispatcher $eventDispatcher) { + public function __construct(EventDispatcher $eventDispatcher, ILogger $logger) { $this->eventDispatcher = $eventDispatcher; + $this->logger = $logger; } /** @@ -46,16 +49,21 @@ class SymfonyAdapter implements EventDispatcherInterface { * @param string $eventName The name of the event to dispatch. The name of * the event is the name of the method that is * invoked on listeners. - * @param SymfonyEvent|null $event The event to pass to the event handlers/listeners + * @param Event|null $event The event to pass to the event handlers/listeners * If not supplied, an empty Event instance is created * - * @return SymfonyEvent + * @return void */ - public function dispatch($eventName, SymfonyEvent $event = null) { + public function dispatch($eventName, $event = null) { + // type hinting is not possible, due to usage of GenericEvent if ($event instanceof Event) { $this->eventDispatcher->dispatch($eventName, $event); } else { // Legacy event + $this->logger->info( + 'Deprecated event type for {name}: {class}', + [ 'name' => $eventName, 'class' => is_object($event) ? get_class($event) : 'null' ] + ); $this->eventDispatcher->getSymfonyDispatcher()->dispatch($eventName, $event); } } diff --git a/lib/private/Files/Cache/AbstractCacheEvent.php b/lib/private/Files/Cache/AbstractCacheEvent.php index c8a41ce54d8..db1e7a1cf32 100644 --- a/lib/private/Files/Cache/AbstractCacheEvent.php +++ b/lib/private/Files/Cache/AbstractCacheEvent.php @@ -23,7 +23,7 @@ namespace OC\Files\Cache; use OCP\Files\Cache\ICacheEvent; use OCP\Files\Storage\IStorage; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; class AbstractCacheEvent extends Event implements ICacheEvent { protected $storage; diff --git a/lib/public/App/ManagerEvent.php b/lib/public/App/ManagerEvent.php index f46318c2621..27dc3a44dea 100644 --- a/lib/public/App/ManagerEvent.php +++ b/lib/public/App/ManagerEvent.php @@ -23,7 +23,7 @@ namespace OCP\App; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; /** * Class ManagerEvent diff --git a/lib/public/Comments/CommentsEntityEvent.php b/lib/public/Comments/CommentsEntityEvent.php index fe8585a213e..d3ffb710e2e 100644 --- a/lib/public/Comments/CommentsEntityEvent.php +++ b/lib/public/Comments/CommentsEntityEvent.php @@ -22,7 +22,7 @@ namespace OCP\Comments; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; /** * Class CommentsEntityEvent diff --git a/lib/public/Comments/CommentsEvent.php b/lib/public/Comments/CommentsEvent.php index eba4cebb3bf..43b8366a22f 100644 --- a/lib/public/Comments/CommentsEvent.php +++ b/lib/public/Comments/CommentsEvent.php @@ -23,7 +23,7 @@ namespace OCP\Comments; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; /** * Class CommentsEvent diff --git a/lib/public/Console/ConsoleEvent.php b/lib/public/Console/ConsoleEvent.php index 7b3201999a3..6645b20ac2e 100644 --- a/lib/public/Console/ConsoleEvent.php +++ b/lib/public/Console/ConsoleEvent.php @@ -22,7 +22,7 @@ namespace OCP\Console; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; /** * Class ConsoleEvent diff --git a/lib/public/SabrePluginEvent.php b/lib/public/SabrePluginEvent.php index d75c84965f6..8f8d155ec10 100644 --- a/lib/public/SabrePluginEvent.php +++ b/lib/public/SabrePluginEvent.php @@ -26,7 +26,7 @@ namespace OCP; use OCP\AppFramework\Http; use Sabre\DAV\Server; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; /** * @since 8.2.0 diff --git a/lib/public/SystemTag/ManagerEvent.php b/lib/public/SystemTag/ManagerEvent.php index 452c0d5da8f..41155a64ea2 100644 --- a/lib/public/SystemTag/ManagerEvent.php +++ b/lib/public/SystemTag/ManagerEvent.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace OCP\SystemTag; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; /** * Class ManagerEvent diff --git a/lib/public/SystemTag/MapperEvent.php b/lib/public/SystemTag/MapperEvent.php index d98caf1317b..4e2c84fecaf 100644 --- a/lib/public/SystemTag/MapperEvent.php +++ b/lib/public/SystemTag/MapperEvent.php @@ -23,7 +23,7 @@ declare(strict_types=1); namespace OCP\SystemTag; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; /** * Class MapperEvent diff --git a/lib/public/SystemTag/SystemTagsEntityEvent.php b/lib/public/SystemTag/SystemTagsEntityEvent.php index e439c16d9c6..cb4982ae282 100644 --- a/lib/public/SystemTag/SystemTagsEntityEvent.php +++ b/lib/public/SystemTag/SystemTagsEntityEvent.php @@ -23,7 +23,7 @@ declare(strict_types=1); namespace OCP\SystemTag; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; /** * Class SystemTagsEntityEvent |