]> source.dussan.org Git - nextcloud-server.git/commitdiff
Files first to use own GenericEvent 17834/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 6 Nov 2019 11:06:44 +0000 (12:06 +0100)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 26 Nov 2019 13:48:59 +0000 (14:48 +0100)
* those are added to 18 only anyway :)

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/Files/Node/HookConnector.php
tests/lib/Files/Node/HookConnectorTest.php
tests/lib/Files/ViewTest.php

index b792b58407780ab2210d4368bdab5d02c79d8a1b..417bb4980ee668248484cb91a252d1f4547fc1dd 100644 (file)
@@ -24,10 +24,10 @@ namespace OC\Files\Node;
 
 use OC\Files\Filesystem;
 use OC\Files\View;
+use OCP\EventDispatcher\GenericEvent;
 use OCP\Files\FileInfo;
 use OCP\Util;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\GenericEvent;
 
 class HookConnector {
        /**
index 0d67fada3c0be55606f9f67e20c18c7a337983f1..5180dbb9fe2d86ceaf48e20d7572e8e5af39a899 100644 (file)
@@ -13,6 +13,8 @@ use OC\Files\Node\HookConnector;
 use OC\Files\Node\Root;
 use OC\Files\Storage\Temporary;
 use OC\Files\View;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\GenericEvent as APIGenericEvent;
 use OCP\Files\Node;
 use OCP\ILogger;
 use OCP\IUserManager;
@@ -146,7 +148,8 @@ class HookConnectorTest extends TestCase {
                $dispatcherCalled = false;
                /** @var Node $dispatcherNode */
                $dispatcherNode = null;
-               $this->eventDispatcher->addListener($expectedEvent, function (GenericEvent $event) use (&$dispatcherCalled, &$dispatcherNode) {
+               $this->eventDispatcher->addListener($expectedEvent, function ($event) use (&$dispatcherCalled, &$dispatcherNode) {
+                       /** @var GenericEvent|APIGenericEvent $event */
                        $dispatcherCalled = true;
                        $dispatcherNode = $event->getSubject();
                });
@@ -206,7 +209,8 @@ class HookConnectorTest extends TestCase {
                $dispatcherSourceNode = null;
                /** @var Node $dispatcherTargetNode */
                $dispatcherTargetNode = null;
-               $this->eventDispatcher->addListener($expectedEvent, function (GenericEvent $event) use (&$dispatcherSourceNode, &$dispatcherTargetNode, &$dispatcherCalled) {
+               $this->eventDispatcher->addListener($expectedEvent, function ($event) use (&$dispatcherSourceNode, &$dispatcherTargetNode, &$dispatcherCalled) {
+                       /** @var GenericEvent|APIGenericEvent $event */
                        $dispatcherCalled = true;
                        list($dispatcherSourceNode, $dispatcherTargetNode) = $event->getSubject();
                });
@@ -237,7 +241,8 @@ class HookConnectorTest extends TestCase {
                $dispatcherCalled = false;
                /** @var Node $dispatcherNode */
                $dispatcherNode = null;
-               $this->eventDispatcher->addListener('\OCP\Files::postDelete', function (GenericEvent $event) use (&$dispatcherCalled, &$dispatcherNode) {
+               $this->eventDispatcher->addListener('\OCP\Files::postDelete', function ($event) use (&$dispatcherCalled, &$dispatcherNode) {
+                       /** @var GenericEvent|APIGenericEvent $event */
                        $dispatcherCalled = true;
                        $dispatcherNode = $event->getSubject();
                });
index 43a3a06ba0bac18377f7408c7f2b38195a7fcb75..c154c28e24a9a43cafadf9203b0b834c280c8363 100644 (file)
@@ -15,7 +15,6 @@ use OC\Files\Storage\Common;
 use OC\Files\Storage\Temporary;
 use OC\Files\Stream\Quota;
 use OC\Files\View;
-use OCP\Constants;
 use OCP\Files\Config\IMountProvider;
 use OCP\Files\FileInfo;
 use OCP\Files\Storage\IStorage;