use OCA\Files_Trashbin\Events\MoveToTrashEvent;
use OCA\Files_Trashbin\Trash\ITrashManager;
use OCP\Encryption\Exceptions\GenericEncryptionException;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\IRootFolder;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\Node;
use OCP\Files\Storage\IStorage;
use OCP\ILogger;
use OCP\IUserManager;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class Storage extends Wrapper {
/** @var IMountPoint */
/** @var ILogger */
private $logger;
- /** @var EventDispatcherInterface */
+ /** @var IEventDispatcher */
private $eventDispatcher;
/** @var IRootFolder */
* @param ITrashManager $trashManager
* @param IUserManager|null $userManager
* @param ILogger|null $logger
- * @param EventDispatcherInterface|null $eventDispatcher
+ * @param IEventDispatcher|null $eventDispatcher
* @param IRootFolder|null $rootFolder
*/
public function __construct(
ITrashManager $trashManager = null,
IUserManager $userManager = null,
ILogger $logger = null,
- EventDispatcherInterface $eventDispatcher = null,
+ IEventDispatcher $eventDispatcher = null,
IRootFolder $rootFolder = null
) {
$this->mountPoint = $parameters['mountPoint'];
foreach ($nodes as $node) {
$event = $this->createMoveToTrashEvent($node);
+ $this->eventDispatcher->dispatchTyped($event);
$this->eventDispatcher->dispatch('OCA\Files_Trashbin::moveToTrash', $event);
if ($event->shouldMoveToTrashBin() === false) {
return false;
\OC::$server->query(ITrashManager::class),
\OC::$server->getUserManager(),
\OC::$server->getLogger(),
- \OC::$server->getEventDispatcher(),
+ \OC::$server->get(IEventDispatcher::class),
\OC::$server->getLazyRootFolder()
);
}, 1);
use OCA\Files_Trashbin\Trash\ITrashManager;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Cache\ICache;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\IUserManager;
use OCP\Lock\ILockingProvider;
use OCP\Share\IShare;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\Traits\MountProviderTrait;
class TemporaryNoCross extends Temporary {
$userManager->expects($this->any())
->method('userExists')->willReturn($userExists);
$logger = $this->getMockBuilder(ILogger::class)->getMock();
- $eventDispatcher = $this->createMock(EventDispatcherInterface::class);
+ $eventDispatcher = $this->createMock(IEventDispatcher::class);
$rootFolder = $this->createMock(IRootFolder::class);
$userFolder = $this->createMock(Folder::class);
$node = $this->getMockBuilder(Node::class)->disableOriginalConstructor()->getMock();