From 35c6b1236fdb2d90e55315dc0c92b5ecb20641e7 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 16 Jun 2020 21:14:42 +0200 Subject: [PATCH] Move AutoComplete::filterResults to new event dispatcher and GenericEvent Signed-off-by: Joas Schilling --- core/Controller/AutoCompleteController.php | 7 +++---- .../Collaboration/AutoComplete/AutoCompleteEvent.php | 2 +- tests/Core/Controller/AutoCompleteControllerTest.php | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/Controller/AutoCompleteController.php b/core/Controller/AutoCompleteController.php index aa67ff9a30..56ad21f421 100644 --- a/core/Controller/AutoCompleteController.php +++ b/core/Controller/AutoCompleteController.php @@ -34,17 +34,16 @@ use OCP\AppFramework\OCSController as Controller; use OCP\Collaboration\AutoComplete\AutoCompleteEvent; use OCP\Collaboration\AutoComplete\IManager; use OCP\Collaboration\Collaborators\ISearch; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IRequest; -use OCP\Share; use OCP\Share\IShare; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; class AutoCompleteController extends Controller { /** @var ISearch */ private $collaboratorSearch; /** @var IManager */ private $autoCompleteManager; - /** @var EventDispatcherInterface */ + /** @var IEventDispatcher */ private $dispatcher; public function __construct( @@ -52,7 +51,7 @@ class AutoCompleteController extends Controller { IRequest $request, ISearch $collaboratorSearch, IManager $autoCompleteManager, - EventDispatcherInterface $dispatcher + IEventDispatcher $dispatcher ) { parent::__construct($appName, $request); diff --git a/lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php b/lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php index 776bd46d40..73128f618f 100644 --- a/lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php +++ b/lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php @@ -26,7 +26,7 @@ declare(strict_types=1); namespace OCP\Collaboration\AutoComplete; -use Symfony\Component\EventDispatcher\GenericEvent; +use OCP\EventDispatcher\GenericEvent; /** * @since 16.0.0 diff --git a/tests/Core/Controller/AutoCompleteControllerTest.php b/tests/Core/Controller/AutoCompleteControllerTest.php index ea62b50219..73bc849211 100644 --- a/tests/Core/Controller/AutoCompleteControllerTest.php +++ b/tests/Core/Controller/AutoCompleteControllerTest.php @@ -26,9 +26,9 @@ namespace Tests\Core\Controller; use OC\Core\Controller\AutoCompleteController; use OCP\Collaboration\AutoComplete\IManager; use OCP\Collaboration\Collaborators\ISearch; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IRequest; use PHPUnit\Framework\MockObject\MockObject; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Test\TestCase; class AutoCompleteControllerTest extends TestCase { @@ -36,7 +36,7 @@ class AutoCompleteControllerTest extends TestCase { protected $collaboratorSearch; /** @var IManager|MockObject */ protected $autoCompleteManager; - /** @var EventDispatcherInterface|MockObject */ + /** @var IEventDispatcher|MockObject */ protected $dispatcher; /** @var AutoCompleteController */ protected $controller; @@ -48,7 +48,7 @@ class AutoCompleteControllerTest extends TestCase { $request = $this->createMock(IRequest::class); $this->collaboratorSearch = $this->createMock(ISearch::class); $this->autoCompleteManager = $this->createMock(IManager::class); - $this->dispatcher = $this->createMock(EventDispatcherInterface::class); + $this->dispatcher = $this->createMock(IEventDispatcher::class); $this->controller = new AutoCompleteController( 'core',