aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/Command/RestoreAllFiles.php2
-rw-r--r--apps/files_trashbin/lib/Trashbin.php4
-rw-r--r--apps/files_trashbin/tests/Command/CleanUpTest.php10
-rw-r--r--apps/files_trashbin/tests/StorageTest.php6
-rw-r--r--apps/files_trashbin/tests/TrashbinTest.php2
5 files changed, 12 insertions, 12 deletions
diff --git a/apps/files_trashbin/lib/Command/RestoreAllFiles.php b/apps/files_trashbin/lib/Command/RestoreAllFiles.php
index 969791379c1..f14fb5d6432 100644
--- a/apps/files_trashbin/lib/Command/RestoreAllFiles.php
+++ b/apps/files_trashbin/lib/Command/RestoreAllFiles.php
@@ -256,7 +256,7 @@ class RestoreAllFiles extends Base {
* That's why PSALM doesn't know the class GroupTrashItem.
* @psalm-suppress RedundantCondition
*/
- if ($scope === self::SCOPE_GROUPFOLDERS && $trashItemClass !== 'OCA\GroupFolders\Trash\GroupTrashItem') {
+ if ($scope === self::SCOPE_GROUPFOLDERS && $trashItemClass !== \OCA\GroupFolders\Trash\GroupTrashItem::class) {
$output->writeln('Skipping <info>' . $trashItem->getName() . '</info> because it is not a groupfolders trash item', OutputInterface::VERBOSITY_VERBOSE);
continue;
}
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index a30ba0ce055..db4143a6211 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -329,7 +329,7 @@ class Trashbin implements IEventListener {
if (!$result) {
\OC::$server->get(LoggerInterface::class)->error('trash bin database couldn\'t be updated', ['app' => 'files_trashbin']);
}
- \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash', ['filePath' => Filesystem::normalizePath($file_path),
+ \OCP\Util::emitHook(\OCA\Files_Trashbin\Trashbin::class, 'post_moveToTrash', ['filePath' => Filesystem::normalizePath($file_path),
'trashPath' => Filesystem::normalizePath(static::getTrashFilename($filename, $timestamp))]);
self::retainVersions($filename, $owner, $ownerPath, $timestamp);
@@ -505,7 +505,7 @@ class Trashbin implements IEventListener {
$view->chroot('/' . $user . '/files');
$view->touch('/' . $location . '/' . $uniqueFilename, $mtime);
$view->chroot($fakeRoot);
- \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', ['filePath' => $targetPath, 'trashPath' => $sourcePath]);
+ \OCP\Util::emitHook(\OCA\Files_Trashbin\Trashbin::class, 'post_restore', ['filePath' => $targetPath, 'trashPath' => $sourcePath]);
$sourceNode = self::getNodeForPath($sourcePath);
$targetNode = self::getNodeForPath($targetPath);
diff --git a/apps/files_trashbin/tests/Command/CleanUpTest.php b/apps/files_trashbin/tests/Command/CleanUpTest.php
index b071fa8ecdd..75d78082370 100644
--- a/apps/files_trashbin/tests/Command/CleanUpTest.php
+++ b/apps/files_trashbin/tests/Command/CleanUpTest.php
@@ -45,7 +45,7 @@ class CleanUpTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')
+ $this->rootFolder = $this->getMockBuilder(\OCP\Files\IRootFolder::class)
->disableOriginalConstructor()->getMock();
$this->userManager = $this->getMockBuilder('OC\User\Manager')
->disableOriginalConstructor()->getMock();
@@ -139,7 +139,7 @@ class CleanUpTest extends TestCase {
*/
public function testExecuteDeleteListOfUsers(): void {
$userIds = ['user1', 'user2', 'user3'];
- $instance = $this->getMockBuilder('OCA\Files_Trashbin\Command\CleanUp')
+ $instance = $this->getMockBuilder(\OCA\Files_Trashbin\Command\CleanUp::class)
->setMethods(['removeDeletedFiles'])
->setConstructorArgs([$this->rootFolder, $this->userManager, $this->dbConnection])
->getMock();
@@ -150,7 +150,7 @@ class CleanUpTest extends TestCase {
});
$this->userManager->expects($this->exactly(count($userIds)))
->method('userExists')->willReturn(true);
- $inputInterface = $this->getMockBuilder('\Symfony\Component\Console\Input\InputInterface')
+ $inputInterface = $this->getMockBuilder(\Symfony\Component\Console\Input\InputInterface::class)
->disableOriginalConstructor()->getMock();
$inputInterface->method('getArgument')
->with('user_id')
@@ -160,7 +160,7 @@ class CleanUpTest extends TestCase {
['all-users', false],
['verbose', false],
]);
- $outputInterface = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface')
+ $outputInterface = $this->getMockBuilder(\Symfony\Component\Console\Output\OutputInterface::class)
->disableOriginalConstructor()->getMock();
$this->invokePrivate($instance, 'execute', [$inputInterface, $outputInterface]);
}
@@ -171,7 +171,7 @@ class CleanUpTest extends TestCase {
public function testExecuteAllUsers(): void {
$userIds = [];
$backendUsers = ['user1', 'user2'];
- $instance = $this->getMockBuilder('OCA\Files_Trashbin\Command\CleanUp')
+ $instance = $this->getMockBuilder(\OCA\Files_Trashbin\Command\CleanUp::class)
->setMethods(['removeDeletedFiles'])
->setConstructorArgs([$this->rootFolder, $this->userManager, $this->dbConnection])
->getMock();
diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php
index f0f3159b32a..1d1b80cbb92 100644
--- a/apps/files_trashbin/tests/StorageTest.php
+++ b/apps/files_trashbin/tests/StorageTest.php
@@ -503,7 +503,7 @@ class StorageTest extends \Test\TestCase {
/**
* @var \OC\Files\Storage\Temporary | \PHPUnit\Framework\MockObject\MockObject $storage
*/
- $storage = $this->getMockBuilder('\OC\Files\Storage\Temporary')
+ $storage = $this->getMockBuilder(\OC\Files\Storage\Temporary::class)
->setConstructorArgs([[]])
->setMethods(['rename', 'unlink', 'moveFromStorage'])
->getMock();
@@ -540,7 +540,7 @@ class StorageTest extends \Test\TestCase {
/**
* @var \OC\Files\Storage\Temporary | \PHPUnit\Framework\MockObject\MockObject $storage
*/
- $storage = $this->getMockBuilder('\OC\Files\Storage\Temporary')
+ $storage = $this->getMockBuilder(\OC\Files\Storage\Temporary::class)
->setConstructorArgs([[]])
->setMethods(['rename', 'unlink', 'rmdir'])
->getMock();
@@ -574,7 +574,7 @@ class StorageTest extends \Test\TestCase {
$fileID = 1;
$cache = $this->createMock(ICache::class);
$cache->expects($this->any())->method('getId')->willReturn($fileID);
- $tmpStorage = $this->getMockBuilder('\OC\Files\Storage\Temporary')
+ $tmpStorage = $this->getMockBuilder(\OC\Files\Storage\Temporary::class)
->disableOriginalConstructor()->getMock($cache);
$tmpStorage->expects($this->any())->method('getCache')->willReturn($cache);
$userManager = $this->getMockBuilder(IUserManager::class)
diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php
index 11501891c77..df361ee6b76 100644
--- a/apps/files_trashbin/tests/TrashbinTest.php
+++ b/apps/files_trashbin/tests/TrashbinTest.php
@@ -45,7 +45,7 @@ class TrashbinTest extends \Test\TestCase {
\OC_User::useBackend('database');
// clear share hooks
- \OC_Hook::clear('OCP\\Share');
+ \OC_Hook::clear(\OCP\Share::class);
\OC::registerShareHooks(\OC::$server->getSystemConfig());
// init files sharing