Move AutoComplete::filterResults to new event dispatcher and GenericEvent

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-06-16 21:14:42 +02:00
parent ebedbf1579
commit 35c6b1236f
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
3 changed files with 7 additions and 8 deletions

View File

@ -34,17 +34,16 @@ use OCP\AppFramework\OCSController as Controller;
use OCP\Collaboration\AutoComplete\AutoCompleteEvent; use OCP\Collaboration\AutoComplete\AutoCompleteEvent;
use OCP\Collaboration\AutoComplete\IManager; use OCP\Collaboration\AutoComplete\IManager;
use OCP\Collaboration\Collaborators\ISearch; use OCP\Collaboration\Collaborators\ISearch;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IRequest; use OCP\IRequest;
use OCP\Share;
use OCP\Share\IShare; use OCP\Share\IShare;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class AutoCompleteController extends Controller { class AutoCompleteController extends Controller {
/** @var ISearch */ /** @var ISearch */
private $collaboratorSearch; private $collaboratorSearch;
/** @var IManager */ /** @var IManager */
private $autoCompleteManager; private $autoCompleteManager;
/** @var EventDispatcherInterface */ /** @var IEventDispatcher */
private $dispatcher; private $dispatcher;
public function __construct( public function __construct(
@ -52,7 +51,7 @@ class AutoCompleteController extends Controller {
IRequest $request, IRequest $request,
ISearch $collaboratorSearch, ISearch $collaboratorSearch,
IManager $autoCompleteManager, IManager $autoCompleteManager,
EventDispatcherInterface $dispatcher IEventDispatcher $dispatcher
) { ) {
parent::__construct($appName, $request); parent::__construct($appName, $request);

View File

@ -26,7 +26,7 @@ declare(strict_types=1);
namespace OCP\Collaboration\AutoComplete; namespace OCP\Collaboration\AutoComplete;
use Symfony\Component\EventDispatcher\GenericEvent; use OCP\EventDispatcher\GenericEvent;
/** /**
* @since 16.0.0 * @since 16.0.0

View File

@ -26,9 +26,9 @@ namespace Tests\Core\Controller;
use OC\Core\Controller\AutoCompleteController; use OC\Core\Controller\AutoCompleteController;
use OCP\Collaboration\AutoComplete\IManager; use OCP\Collaboration\AutoComplete\IManager;
use OCP\Collaboration\Collaborators\ISearch; use OCP\Collaboration\Collaborators\ISearch;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IRequest; use OCP\IRequest;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase; use Test\TestCase;
class AutoCompleteControllerTest extends TestCase { class AutoCompleteControllerTest extends TestCase {
@ -36,7 +36,7 @@ class AutoCompleteControllerTest extends TestCase {
protected $collaboratorSearch; protected $collaboratorSearch;
/** @var IManager|MockObject */ /** @var IManager|MockObject */
protected $autoCompleteManager; protected $autoCompleteManager;
/** @var EventDispatcherInterface|MockObject */ /** @var IEventDispatcher|MockObject */
protected $dispatcher; protected $dispatcher;
/** @var AutoCompleteController */ /** @var AutoCompleteController */
protected $controller; protected $controller;
@ -48,7 +48,7 @@ class AutoCompleteControllerTest extends TestCase {
$request = $this->createMock(IRequest::class); $request = $this->createMock(IRequest::class);
$this->collaboratorSearch = $this->createMock(ISearch::class); $this->collaboratorSearch = $this->createMock(ISearch::class);
$this->autoCompleteManager = $this->createMock(IManager::class); $this->autoCompleteManager = $this->createMock(IManager::class);
$this->dispatcher = $this->createMock(EventDispatcherInterface::class); $this->dispatcher = $this->createMock(IEventDispatcher::class);
$this->controller = new AutoCompleteController( $this->controller = new AutoCompleteController(
'core', 'core',