Skip to content

Commit

Permalink
Merge pull request #2512 from nextcloud/chore/php-cs-fix
Browse files Browse the repository at this point in the history
Update php-cs workflow from organization and run `composer cs:fix`
  • Loading branch information
icewind1991 authored Aug 14, 2023
2 parents 56d4619 + ecc20ef commit 71cc944
Show file tree
Hide file tree
Showing 26 changed files with 101 additions and 95 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/BackgroundJob/ExpireGroupPlaceholder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions lib/BackgroundJob/ExpireGroupTrash.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/BackgroundJob/ExpireGroupVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
58 changes: 29 additions & 29 deletions lib/Controller/FolderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
}
Expand All @@ -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]);
}
Expand All @@ -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]);
}
Expand All @@ -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]);
}
Expand All @@ -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]);
}
Expand All @@ -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]);
}
Expand All @@ -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]);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/DAV/PropFindPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
}
Expand Down
38 changes: 19 additions & 19 deletions lib/Folder/FolderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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);
Expand Down Expand Up @@ -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();
}
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version102020Date20180806161449.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version103000Date20180806161724.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version104000Date20180918132853.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version1401000Date20230426112002.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version201000Date20190111132839.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version201000Date20190212150323.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version401001Date20190715092137.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
Loading

0 comments on commit 71cc944

Please sign in to comment.