From 173968821fe90ab5235b4996835de88851e7b3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Niedzielski?= Date: Tue, 7 May 2024 10:06:23 +0200 Subject: [PATCH] IBX-8121: Fixed code style issues for 5.0 https://github.com/ibexa/cron/pull/15 --- .github/workflows/ci.yaml | 34 +++++++++++++++++++ composer.json | 7 ++-- .../Compiler/CronJobCompilerPass.php | 1 + .../IbexaCronExtension.php | 1 + src/bundle/IbexaCronBundle.php | 1 + src/bundle/Registry/CronJobsRegistry.php | 1 + 6 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..1a747d6 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: + - main + - '[0-9]+.[0-9]+' + pull_request: ~ + +jobs: + cs-fix: + name: Run code style check + runs-on: "ubuntu-22.04" + strategy: + matrix: + php: + - '8.3' + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP Action + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + extensions: 'pdo_sqlite, gd' + tools: cs2pr + + - uses: ramsey/composer-install@v3 + with: + dependency-versions: highest + + - name: Run code style check + run: composer run-script check-cs -- --format=checkstyle | cs2pr diff --git a/composer.json b/composer.json index c58a6a4..b4d248c 100644 --- a/composer.json +++ b/composer.json @@ -33,11 +33,11 @@ "symfony/process": "^5.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.0", - "ibexa/code-style": "^1.0", + "ibexa/code-style": "~2.0.0", "ibexa/doctrine-schema": "~5.0.x-dev" }, "scripts": { + "check-cs": "@fix-cs --dry-run", "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots" }, "extra": { @@ -46,6 +46,7 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": false } } diff --git a/src/bundle/DependencyInjection/Compiler/CronJobCompilerPass.php b/src/bundle/DependencyInjection/Compiler/CronJobCompilerPass.php index 9c5c447..d0af13e 100644 --- a/src/bundle/DependencyInjection/Compiler/CronJobCompilerPass.php +++ b/src/bundle/DependencyInjection/Compiler/CronJobCompilerPass.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\Cron\DependencyInjection\Compiler; use Ibexa\Bundle\Cron\Registry\CronJobsRegistry; diff --git a/src/bundle/DependencyInjection/IbexaCronExtension.php b/src/bundle/DependencyInjection/IbexaCronExtension.php index 06db718..f6f0e5f 100644 --- a/src/bundle/DependencyInjection/IbexaCronExtension.php +++ b/src/bundle/DependencyInjection/IbexaCronExtension.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\Cron\DependencyInjection; use Symfony\Component\Config\FileLocator; diff --git a/src/bundle/IbexaCronBundle.php b/src/bundle/IbexaCronBundle.php index 839d4a0..b993ae7 100644 --- a/src/bundle/IbexaCronBundle.php +++ b/src/bundle/IbexaCronBundle.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\Cron; use Ibexa\Bundle\Cron\DependencyInjection\Compiler\CronJobCompilerPass; diff --git a/src/bundle/Registry/CronJobsRegistry.php b/src/bundle/Registry/CronJobsRegistry.php index a40cd95..6c8db44 100644 --- a/src/bundle/Registry/CronJobsRegistry.php +++ b/src/bundle/Registry/CronJobsRegistry.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\Cron\Registry; use Cron\Job\ShellJob;