From cd350c8691f447e4db11a05dc5364323866fd646 Mon Sep 17 00:00:00 2001 From: Baptiste Fotia Date: Mon, 3 Oct 2022 15:07:56 +0200 Subject: [PATCH 1/2] chore(PHP): Repair cs:fix The php cs comment was broke and I renmad. Signed-off-by: Baptiste Fotia --- .php_cs-fixer.dist.php => .php-cs-fixer.dist.php | 0 lib/Mount/GroupFolderStorage.php | 1 - tests/ACL/RuleManagerTest.php | 6 +++--- 3 files changed, 3 insertions(+), 4 deletions(-) rename .php_cs-fixer.dist.php => .php-cs-fixer.dist.php (100%) diff --git a/.php_cs-fixer.dist.php b/.php-cs-fixer.dist.php similarity index 100% rename from .php_cs-fixer.dist.php rename to .php-cs-fixer.dist.php diff --git a/lib/Mount/GroupFolderStorage.php b/lib/Mount/GroupFolderStorage.php index de9c674b0..fd8e2b9ed 100644 --- a/lib/Mount/GroupFolderStorage.php +++ b/lib/Mount/GroupFolderStorage.php @@ -26,7 +26,6 @@ use OC\Files\ObjectStore\ObjectStoreStorage; use OC\Files\Storage\Wrapper\Quota; use OCP\Files\Cache\ICacheEntry; -use OCP\Files\Storage\IDisableEncryptionStorage; use OCP\IUser; use OCP\IUserSession; diff --git a/tests/ACL/RuleManagerTest.php b/tests/ACL/RuleManagerTest.php index e86dd0c9f..c3c431810 100644 --- a/tests/ACL/RuleManagerTest.php +++ b/tests/ACL/RuleManagerTest.php @@ -79,7 +79,7 @@ public function testGetSetRule() { $this->eventDispatcher->expects($this->any()) ->method('dispatchTyped') ->withConsecutive( - [$this->callback(function(CriticalActionPerformedEvent $event): bool { + [$this->callback(function (CriticalActionPerformedEvent $event): bool { return $event->getParameters() === [ 'permissions' => 0b00001001, 'mask' => 0b00001111, @@ -87,7 +87,7 @@ public function testGetSetRule() { 'user' => 'The User (1)', ]; })], - [$this->callback(function(CriticalActionPerformedEvent $event): bool { + [$this->callback(function (CriticalActionPerformedEvent $event): bool { return $event->getParameters() === [ 'permissions' => 0b00001000, 'mask' => 0b00001111, @@ -95,7 +95,7 @@ public function testGetSetRule() { 'user' => 'The User (1)', ]; })], - [$this->callback(function(CriticalActionPerformedEvent $event): bool { + [$this->callback(function (CriticalActionPerformedEvent $event): bool { return $event->getParameters() === [ 'fileId' => 10, 'user' => 'The User (1)', From dc8a53720f7351f31b552cb89ac2297e03fbfc05 Mon Sep 17 00:00:00 2001 From: Baptiste Fotia Date: Mon, 3 Oct 2022 15:18:34 +0200 Subject: [PATCH 2/2] build(cs): Add new GitHub action to check the cs fix for php. Signed-off-by: Baptiste Fotia --- .github/workflows/lint-php-cs.yml | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/lint-php-cs.yml diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml new file mode 100644 index 000000000..f3d3d91a2 --- /dev/null +++ b/.github/workflows/lint-php-cs.yml @@ -0,0 +1,34 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +name: Lint + +on: + pull_request: + push: + branches: + - master + - stable* + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + coverage: none + + - name: Install dependencies + run: composer i + + - name: Lint + run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )