From ecc20ef8d8e11596960009386f0d866d6bf29c5e Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sat, 12 Aug 2023 13:47:06 +0200 Subject: [PATCH] chore: Update php-cs workflow from organization and run `composer cs:fix` Signed-off-by: Ferdinand Thiessen --- .github/workflows/lint-php-cs.yml | 26 +++++---- lib/AppInfo/Application.php | 8 +-- lib/BackgroundJob/ExpireGroupPlaceholder.php | 2 +- lib/BackgroundJob/ExpireGroupTrash.php | 6 +- lib/BackgroundJob/ExpireGroupVersions.php | 2 +- lib/Command/Scan.php | 2 +- lib/Controller/FolderController.php | 58 +++++++++---------- lib/DAV/PropFindPlugin.php | 4 +- lib/Folder/FolderManager.php | 38 ++++++------ .../Version102020Date20180806161449.php | 2 +- .../Version103000Date20180806161724.php | 2 +- .../Version104000Date20180918132853.php | 2 +- .../Version1401000Date20230426112002.php | 2 +- .../Version201000Date20190111132839.php | 2 +- .../Version201000Date20190212150323.php | 2 +- .../Version401001Date20190715092137.php | 2 +- .../Version501000Date20190927102434.php | 2 +- .../Version501000Date20191218182434.php | 2 +- lib/Mount/MountProvider.php | 8 +-- lib/Service/FoldersFilter.php | 2 +- lib/Settings/Admin.php | 7 ++- lib/Settings/Section.php | 3 +- lib/Trash/TrashBackend.php | 6 +- lib/Versions/VersionsBackend.php | 2 +- tests/ACL/ACLStorageWrapperTest.php | 2 +- tests/ACL/RuleManagerTest.php | 2 +- 26 files changed, 101 insertions(+), 95 deletions(-) diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml index f3d3d91a2..0fdb3ebf5 100644 --- a/.github/workflows/lint-php-cs.yml +++ b/.github/workflows/lint-php-cs.yml @@ -3,29 +3,35 @@ # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -name: Lint +name: Lint php-cs -on: - pull_request: - push: - branches: - - master - - stable* +on: pull_request permissions: contents: read +concurrency: + group: lint-php-cs-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: lint: runs-on: ubuntu-latest + name: php-cs + steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@v2 + - name: Set up php + uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2 + with: + php-version: 8.1 coverage: none + ini-file: development + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies run: composer i diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 0bed887ce..c15c8e40b 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -22,8 +22,6 @@ namespace OCA\GroupFolders\AppInfo; use OCA\Circles\Events\CircleDestroyedEvent; -use OCA\Circles\Events\Files\FileShareCreatedEvent; -use OCA\Circles\Listeners\Files\ShareCreatedSendMail as ListenerFilesShareCreatedSendMail; use OCA\DAV\Connector\Sabre\Principal; use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent; @@ -38,9 +36,9 @@ use OCA\GroupFolders\BackgroundJob\ExpireGroupVersions as ExpireGroupVersionsJob; use OCA\GroupFolders\CacheListener; use OCA\GroupFolders\Command\ExpireGroup\ExpireGroupBase; -use OCA\GroupFolders\Command\ExpireGroup\ExpireGroupVersionsTrash; -use OCA\GroupFolders\Command\ExpireGroup\ExpireGroupVersions; use OCA\GroupFolders\Command\ExpireGroup\ExpireGroupTrash; +use OCA\GroupFolders\Command\ExpireGroup\ExpireGroupVersions; +use OCA\GroupFolders\Command\ExpireGroup\ExpireGroupVersionsTrash; use OCA\GroupFolders\Folder\FolderManager; use OCA\GroupFolders\Helper\LazyFolder; use OCA\GroupFolders\Listeners\CircleDestroyedEventListener; @@ -58,9 +56,9 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Files\Config\IMountProviderCollection; use OCP\ICacheFactory; +use OCP\IConfig; use OCP\IDBConnection; use OCP\IGroup; -use OCP\IConfig; use OCP\IGroupManager; use OCP\IRequest; use OCP\ISession; diff --git a/lib/BackgroundJob/ExpireGroupPlaceholder.php b/lib/BackgroundJob/ExpireGroupPlaceholder.php index d01a6668a..595642106 100644 --- a/lib/BackgroundJob/ExpireGroupPlaceholder.php +++ b/lib/BackgroundJob/ExpireGroupPlaceholder.php @@ -24,8 +24,8 @@ namespace OCA\GroupFolders\BackgroundJob; -use OCP\BackgroundJob\TimedJob; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\TimedJob; class ExpireGroupPlaceholder extends TimedJob { public function __construct(ITimeFactory $timeFactory) { diff --git a/lib/BackgroundJob/ExpireGroupTrash.php b/lib/BackgroundJob/ExpireGroupTrash.php index a595e8267..490e6cf91 100644 --- a/lib/BackgroundJob/ExpireGroupTrash.php +++ b/lib/BackgroundJob/ExpireGroupTrash.php @@ -24,11 +24,11 @@ namespace OCA\GroupFolders\BackgroundJob; -use OCA\GroupFolders\Trash\TrashBackend; use OCA\Files_Trashbin\Expiration; -use OCP\IConfig; -use OCP\BackgroundJob\TimedJob; +use OCA\GroupFolders\Trash\TrashBackend; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\TimedJob; +use OCP\IConfig; class ExpireGroupTrash extends TimedJob { private TrashBackend $trashBackend; diff --git a/lib/BackgroundJob/ExpireGroupVersions.php b/lib/BackgroundJob/ExpireGroupVersions.php index 16ce8d2bb..73f4efdb9 100644 --- a/lib/BackgroundJob/ExpireGroupVersions.php +++ b/lib/BackgroundJob/ExpireGroupVersions.php @@ -25,8 +25,8 @@ namespace OCA\GroupFolders\BackgroundJob; use OCA\GroupFolders\Versions\GroupVersionsExpireManager; -use OCP\BackgroundJob\TimedJob; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\TimedJob; class ExpireGroupVersions extends TimedJob { private GroupVersionsExpireManager $expireManager; diff --git a/lib/Command/Scan.php b/lib/Command/Scan.php index 206c2458e..3b15d0844 100644 --- a/lib/Command/Scan.php +++ b/lib/Command/Scan.php @@ -25,12 +25,12 @@ use OC\Files\ObjectStore\ObjectStoreScanner; use OCP\Constants; +use OCP\Files\Cache\IScanner; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use OCP\Files\Cache\IScanner; class Scan extends FolderCommand { protected function configure() { diff --git a/lib/Controller/FolderController.php b/lib/Controller/FolderController.php index b1f594c19..f17a849bf 100644 --- a/lib/Controller/FolderController.php +++ b/lib/Controller/FolderController.php @@ -32,8 +32,8 @@ use OCP\Files\IRootFolder; use OCP\IGroupManager; use OCP\IRequest; -use OCP\IUserSession; use OCP\IUser; +use OCP\IUserSession; class FolderController extends OCSController { private FolderManager $manager; @@ -194,10 +194,10 @@ public function setMountPoint(int $id, string $mountPoint): DataResponse { * @RequireGroupFolderAdmin */ public function addGroup(int $id, string $group): DataResponse { - $response = $this->checkFolderExists($id); - if ($response) { - return $response; - } + $response = $this->checkFolderExists($id); + if ($response) { + return $response; + } $this->manager->addApplicableGroup($id, $group); return new DataResponse(['success' => true]); } @@ -207,10 +207,10 @@ public function addGroup(int $id, string $group): DataResponse { * @RequireGroupFolderAdmin */ public function removeGroup(int $id, string $group): DataResponse { - $response = $this->checkFolderExists($id); - if ($response) { - return $response; - } + $response = $this->checkFolderExists($id); + if ($response) { + return $response; + } $this->manager->removeApplicableGroup($id, $group); return new DataResponse(['success' => true]); } @@ -220,10 +220,10 @@ public function removeGroup(int $id, string $group): DataResponse { * @RequireGroupFolderAdmin */ public function setPermissions(int $id, string $group, int $permissions): DataResponse { - $response = $this->checkFolderExists($id); - if ($response) { - return $response; - } + $response = $this->checkFolderExists($id); + if ($response) { + return $response; + } $this->manager->setGroupPermissions($id, $group, $permissions); return new DataResponse(['success' => true]); } @@ -234,10 +234,10 @@ public function setPermissions(int $id, string $group, int $permissions): DataRe * @throws \OCP\DB\Exception */ public function setManageACL(int $id, string $mappingType, string $mappingId, bool $manageAcl): DataResponse { - $response = $this->checkFolderExists($id); - if ($response) { - return $response; - } + $response = $this->checkFolderExists($id); + if ($response) { + return $response; + } $this->manager->setManageACL($id, $mappingType, $mappingId, $manageAcl); return new DataResponse(['success' => true]); } @@ -247,10 +247,10 @@ public function setManageACL(int $id, string $mappingType, string $mappingId, bo * @RequireGroupFolderAdmin */ public function setQuota(int $id, int $quota): DataResponse { - $response = $this->checkFolderExists($id); - if ($response) { - return $response; - } + $response = $this->checkFolderExists($id); + if ($response) { + return $response; + } $this->manager->setFolderQuota($id, $quota); return new DataResponse(['success' => true]); } @@ -260,10 +260,10 @@ public function setQuota(int $id, int $quota): DataResponse { * @RequireGroupFolderAdmin */ public function setACL(int $id, bool $acl): DataResponse { - $response = $this->checkFolderExists($id); - if ($response) { - return $response; - } + $response = $this->checkFolderExists($id); + if ($response) { + return $response; + } $this->manager->setFolderACL($id, $acl); return new DataResponse(['success' => true]); } @@ -273,10 +273,10 @@ public function setACL(int $id, bool $acl): DataResponse { * @RequireGroupFolderAdmin */ public function renameFolder(int $id, string $mountpoint): DataResponse { - $response = $this->checkFolderExists($id); - if ($response) { - return $response; - } + $response = $this->checkFolderExists($id); + if ($response) { + return $response; + } $this->manager->renameFolder($id, $mountpoint); return new DataResponse(['success' => true]); } diff --git a/lib/DAV/PropFindPlugin.php b/lib/DAV/PropFindPlugin.php index dd7322dbd..e95688e2f 100644 --- a/lib/DAV/PropFindPlugin.php +++ b/lib/DAV/PropFindPlugin.php @@ -63,11 +63,11 @@ public function propFind(PropFind $propFind, INode $node): void { if ($node instanceof GroupFolderNode) { $propFind->handle( self::MOUNT_POINT_PROPERTYNAME, - fn() => $this->userFolder->getRelativePath($node->getFileInfo()->getMountPoint()->getMountPoint()) + fn () => $this->userFolder->getRelativePath($node->getFileInfo()->getMountPoint()->getMountPoint()) ); $propFind->handle( self::GROUP_FOLDER_ID_PROPERTYNAME, - fn() => $node->getFolderId() + fn () => $node->getFolderId() ); } } diff --git a/lib/Folder/FolderManager.php b/lib/Folder/FolderManager.php index f26862ad9..91c394a40 100644 --- a/lib/Folder/FolderManager.php +++ b/lib/Folder/FolderManager.php @@ -617,7 +617,7 @@ public function getFoldersFromCircleMemberships(IUser $user, int $rootStorageId } $queryHelper = $circlesManager->getQueryHelper(); - $query=$queryHelper->getQueryBuilder(); + $query = $queryHelper->getQueryBuilder(); $query->select( 'f.folder_id', @@ -641,10 +641,10 @@ public function getFoldersFromCircleMemberships(IUser $user, int $rootStorageId ->selectAlias('c.permissions', 'permissions') ->from('group_folders', 'f') ->innerJoin( - 'f', - 'group_folders_groups', - 'a', - $query->expr()->eq('f.folder_id', 'a.folder_id') + 'f', + 'group_folders_groups', + 'a', + $query->expr()->eq('f.folder_id', 'a.folder_id') ); $queryHelper->limitToInheritedMembers('a', 'circle_id', $federatedUser); @@ -719,15 +719,15 @@ public function removeApplicableGroup(int $folderId, string $groupId): void { $query->delete('group_folders_groups') ->where( - $query->expr()->eq( - 'folder_id', $query->createNamedParameter($folderId, IQueryBuilder::PARAM_INT) - ) + $query->expr()->eq( + 'folder_id', $query->createNamedParameter($folderId, IQueryBuilder::PARAM_INT) + ) ) ->andWhere( - $query->expr()->orX( - $query->expr()->eq('group_id', $query->createNamedParameter($groupId)), - $query->expr()->eq('circle_id', $query->createNamedParameter($groupId)) - ) + $query->expr()->orX( + $query->expr()->eq('group_id', $query->createNamedParameter($groupId)), + $query->expr()->eq('circle_id', $query->createNamedParameter($groupId)) + ) ); $query->executeStatement(); } @@ -742,15 +742,15 @@ public function setGroupPermissions(int $folderId, string $groupId, int $permiss $query->update('group_folders_groups') ->set('permissions', $query->createNamedParameter($permissions, IQueryBuilder::PARAM_INT)) ->where( - $query->expr()->eq( - 'folder_id', $query->createNamedParameter($folderId, IQueryBuilder::PARAM_INT) - ) + $query->expr()->eq( + 'folder_id', $query->createNamedParameter($folderId, IQueryBuilder::PARAM_INT) + ) ) ->andWhere( - $query->expr()->orX( - $query->expr()->eq('group_id', $query->createNamedParameter($groupId)), - $query->expr()->eq('circle_id', $query->createNamedParameter($groupId)) - ) + $query->expr()->orX( + $query->expr()->eq('group_id', $query->createNamedParameter($groupId)), + $query->expr()->eq('circle_id', $query->createNamedParameter($groupId)) + ) ); $query->executeStatement(); diff --git a/lib/Migration/Version102020Date20180806161449.php b/lib/Migration/Version102020Date20180806161449.php index 986bf2c19..00c65a1f3 100644 --- a/lib/Migration/Version102020Date20180806161449.php +++ b/lib/Migration/Version102020Date20180806161449.php @@ -3,8 +3,8 @@ namespace OCA\GroupFolders\Migration; use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; class Version102020Date20180806161449 extends SimpleMigrationStep { /** diff --git a/lib/Migration/Version103000Date20180806161724.php b/lib/Migration/Version103000Date20180806161724.php index 1d7482447..b0265e905 100644 --- a/lib/Migration/Version103000Date20180806161724.php +++ b/lib/Migration/Version103000Date20180806161724.php @@ -4,8 +4,8 @@ use OCP\DB\ISchemaWrapper; use OCP\IDBConnection; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; class Version103000Date20180806161724 extends SimpleMigrationStep { /** @var IDBConnection */ diff --git a/lib/Migration/Version104000Date20180918132853.php b/lib/Migration/Version104000Date20180918132853.php index da429782f..fa95530c2 100644 --- a/lib/Migration/Version104000Date20180918132853.php +++ b/lib/Migration/Version104000Date20180918132853.php @@ -6,8 +6,8 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; /** * Auto-generated migration step: Please modify to your needs! diff --git a/lib/Migration/Version1401000Date20230426112002.php b/lib/Migration/Version1401000Date20230426112002.php index e14b7d9c4..16f869514 100644 --- a/lib/Migration/Version1401000Date20230426112002.php +++ b/lib/Migration/Version1401000Date20230426112002.php @@ -28,9 +28,9 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; + class Version1401000Date20230426112002 extends SimpleMigrationStep { public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { /** @var ISchemaWrapper $schema */ diff --git a/lib/Migration/Version201000Date20190111132839.php b/lib/Migration/Version201000Date20190111132839.php index b1176ec3d..1449161ad 100644 --- a/lib/Migration/Version201000Date20190111132839.php +++ b/lib/Migration/Version201000Date20190111132839.php @@ -6,8 +6,8 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; /** * Auto-generated migration step: Please modify to your needs! diff --git a/lib/Migration/Version201000Date20190212150323.php b/lib/Migration/Version201000Date20190212150323.php index 107aebe2a..bda3ed732 100644 --- a/lib/Migration/Version201000Date20190212150323.php +++ b/lib/Migration/Version201000Date20190212150323.php @@ -6,8 +6,8 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; /** * Auto-generated migration step: Please modify to your needs! diff --git a/lib/Migration/Version401001Date20190715092137.php b/lib/Migration/Version401001Date20190715092137.php index d4357320c..28b0f7b3f 100644 --- a/lib/Migration/Version401001Date20190715092137.php +++ b/lib/Migration/Version401001Date20190715092137.php @@ -27,8 +27,8 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; /** * Auto-generated migration step: Please modify to your needs! diff --git a/lib/Migration/Version501000Date20190927102434.php b/lib/Migration/Version501000Date20190927102434.php index c141e1310..9d4c5f216 100644 --- a/lib/Migration/Version501000Date20190927102434.php +++ b/lib/Migration/Version501000Date20190927102434.php @@ -6,8 +6,8 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; class Version501000Date20190927102434 extends SimpleMigrationStep { /** diff --git a/lib/Migration/Version501000Date20191218182434.php b/lib/Migration/Version501000Date20191218182434.php index d495ba9e3..814c1b759 100644 --- a/lib/Migration/Version501000Date20191218182434.php +++ b/lib/Migration/Version501000Date20191218182434.php @@ -6,8 +6,8 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; class Version501000Date20191218182434 extends SimpleMigrationStep { /** diff --git a/lib/Mount/MountProvider.php b/lib/Mount/MountProvider.php index 8fc9e22fa..1fe5befcf 100644 --- a/lib/Mount/MountProvider.php +++ b/lib/Mount/MountProvider.php @@ -29,12 +29,12 @@ use OCA\GroupFolders\Folder\FolderManager; use OCP\Constants; use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\Files\Cache\ICacheEntry; use OCP\Files\Config\IMountProvider; use OCP\Files\Config\IMountProviderCollection; use OCP\Files\Folder; -use OCP\Files\Node; -use OCP\Files\Cache\ICacheEntry; use OCP\Files\Mount\IMountPoint; +use OCP\Files\Node; use OCP\Files\NotFoundException; use OCP\Files\Storage\IStorage; use OCP\Files\Storage\IStorageFactory; @@ -131,10 +131,10 @@ public function getMountsForUser(IUser $user, IStorageFactory $loader) { }, $folders); $conflicts = $this->findConflictsForUser($user, $mountPoints); - $foldersWithAcl = array_filter($folders, function(array $folder) { + $foldersWithAcl = array_filter($folders, function (array $folder) { return $folder['acl']; }); - $aclRootPaths = array_map(function(array $folder) { + $aclRootPaths = array_map(function (array $folder) { return $this->getJailPath($folder['folder_id']); }, $foldersWithAcl); $aclManager = $this->aclManagerFactory->getACLManager($user, $this->getRootStorageId()); diff --git a/lib/Service/FoldersFilter.php b/lib/Service/FoldersFilter.php index 13cd88c86..2be953697 100644 --- a/lib/Service/FoldersFilter.php +++ b/lib/Service/FoldersFilter.php @@ -21,8 +21,8 @@ namespace OCA\GroupFolders\Service; -use OCP\IUserSession; use OCP\IGroupManager; +use OCP\IUserSession; class FoldersFilter { private IUserSession $userSession; diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 64c51516c..664de179c 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -26,8 +26,8 @@ use OCA\GroupFolders\Service\DelegationService; use OCP\App\IAppManager; use OCP\AppFramework\Http\TemplateResponse; -use OCP\Settings\IDelegatedSettings; use OCP\AppFramework\Services\IInitialState; +use OCP\Settings\IDelegatedSettings; class Admin implements IDelegatedSettings { @@ -36,7 +36,8 @@ public function __construct( private ApplicationService $applicationService, private DelegationService $delegationService, private IAppManager $appManager - ) {} + ) { + } public function getForm(): TemplateResponse { \OCP\Util::addScript(Application::APP_ID, 'groupfolders-settings'); @@ -54,7 +55,7 @@ public function getForm(): TemplateResponse { $this->initialState->provideInitialState( 'isCirclesEnabled', $this->appManager->isEnabledForUser('circles') - ); + ); return new TemplateResponse( Application::APP_ID, diff --git a/lib/Settings/Section.php b/lib/Settings/Section.php index fe3f7df28..31af2ccdd 100644 --- a/lib/Settings/Section.php +++ b/lib/Settings/Section.php @@ -30,7 +30,8 @@ class Section implements IIconSection { public function __construct( private IL10N $l, private IURLGenerator $url - ) {} + ) { + } /** * @return string The ID of the section. It is supposed to be a lower case string, e.g. 'ldap' diff --git a/lib/Trash/TrashBackend.php b/lib/Trash/TrashBackend.php index e1238519d..f3110f518 100644 --- a/lib/Trash/TrashBackend.php +++ b/lib/Trash/TrashBackend.php @@ -32,12 +32,11 @@ use OCA\GroupFolders\Versions\VersionsBackend; use OCP\Constants; use OCP\Files\Folder; -use OCP\Files\GenericFileException; +use OCP\Files\IRootFolder; use OCP\Files\Node; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\Files\Storage\IStorage; -use OCP\Files\IRootFolder; use OCP\IUser; use Psr\Log\LoggerInterface; @@ -282,7 +281,8 @@ private function getTrashRoot(): Folder { try { return $this->appFolder->get('trash'); } catch (NotFoundException $e) { - return $this->appFolder->newFolder('trash');; + return $this->appFolder->newFolder('trash'); + ; } } diff --git a/lib/Versions/VersionsBackend.php b/lib/Versions/VersionsBackend.php index 6a62ea13f..c27ec5ddc 100644 --- a/lib/Versions/VersionsBackend.php +++ b/lib/Versions/VersionsBackend.php @@ -28,6 +28,7 @@ use OCA\GroupFolders\Mount\GroupMountPoint; use OCA\GroupFolders\Mount\MountProvider; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Constants; use OCP\Files\File; use OCP\Files\FileInfo; use OCP\Files\Folder; @@ -35,7 +36,6 @@ use OCP\Files\NotFoundException; use OCP\Files\Storage\IStorage; use OCP\IUser; -use OCP\Constants; use Psr\Log\LoggerInterface; class VersionsBackend implements IVersionBackend { diff --git a/tests/ACL/ACLStorageWrapperTest.php b/tests/ACL/ACLStorageWrapperTest.php index bea217490..1f84f4314 100644 --- a/tests/ACL/ACLStorageWrapperTest.php +++ b/tests/ACL/ACLStorageWrapperTest.php @@ -24,11 +24,11 @@ namespace OCA\groupfolders\tests\ACL; use OC\Files\Storage\Temporary; -use Test\TestCase; use OCA\GroupFolders\ACL\ACLManager; use OCA\GroupFolders\ACL\ACLStorageWrapper; use OCP\Constants; use OCP\Files\Storage\IStorage; +use Test\TestCase; class ACLStorageWrapperTest extends TestCase { /** @var ACLManager|\PHPUnit_Framework_MockObject_MockObject */ diff --git a/tests/ACL/RuleManagerTest.php b/tests/ACL/RuleManagerTest.php index c3c431810..3dce92688 100644 --- a/tests/ACL/RuleManagerTest.php +++ b/tests/ACL/RuleManagerTest.php @@ -29,8 +29,8 @@ use OCA\GroupFolders\ACL\UserMapping\IUserMappingManager; use OCA\GroupFolders\ACL\UserMapping\UserMapping; use OCP\EventDispatcher\IEventDispatcher; -use OCP\Log\Audit\CriticalActionPerformedEvent; use OCP\IUser; +use OCP\Log\Audit\CriticalActionPerformedEvent; use Test\TestCase; /**