From 19b2a25d96083c0f6fb5a883d93594535761edb6 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 4 Oct 2021 11:32:34 +0200 Subject: [PATCH 1/2] Fix PHPCS config file --- .github/workflows/coding-standards.yml | 4 ++-- .php_cs => .php-cs-fixer.php | 15 ++++++++------- composer.json | 2 +- phpstan.neon | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) rename .php_cs => .php-cs-fixer.php (67%) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index e7449bc..2c23bd4 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: php: - - "7.3" + - "7.4" steps: - name: "Checkout" @@ -30,7 +30,7 @@ jobs: with: coverage: "none" php-version: "${{ matrix.php }}" - tools: cs2pr, composer:v1 + tools: cs2pr, composer:v2 ini-values: "date.timezone=Europe/Paris" env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.php_cs b/.php-cs-fixer.php similarity index 67% rename from .php_cs rename to .php-cs-fixer.php index 5dc5396..19cd18d 100644 --- a/.php_cs +++ b/.php-cs-fixer.php @@ -1,6 +1,11 @@ in(__DIR__) + ->exclude(['vendor', 'var', 'web']) +; + +return (new PhpCsFixer\Config()) ->setUsingCache(true) ->setRiskyAllowed(true) ->setRules([ @@ -9,7 +14,7 @@ return PhpCsFixer\Config::create() 'array_syntax' => ['syntax' => 'short'], 'combine_consecutive_unsets' => true, 'heredoc_to_nowdoc' => true, - 'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'], + 'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']], 'no_unreachable_default_argument_value' => true, 'no_useless_else' => true, 'no_useless_return' => true, @@ -22,9 +27,5 @@ return PhpCsFixer\Config::create() 'strict_param' => true, 'concat_space' => ['spacing' => 'one'], ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude(['vendor']) - ->in(__DIR__) - ) + ->setFinder($finder) ; diff --git a/composer.json b/composer.json index c0a1574..d32d576 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.14", "monolog/monolog": "^1.24|^2.1", - "symfony/phpunit-bridge": "^4.2.3" + "symfony/phpunit-bridge": "^4.4|^5.3" }, "suggest": { "ext-tidy": "Used to clean up given HTML and to avoid problems with bad HTML structure." diff --git a/phpstan.neon b/phpstan.neon index 7c1f51c..cde561a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,7 +6,7 @@ parameters: # https://github.com/phpstan/phpstan/issues/694#issuecomment-350724288 bootstrapFiles: - - vendor/bin/.phpunit/phpunit-7.5-0/vendor/autoload.php + - vendor/bin/.phpunit/phpunit-8.5-0/vendor/autoload.php includes: - vendor/phpstan/phpstan-phpunit/extension.neon From 635f8963dcc7fc2ed2a05102d381dc19a9905bd9 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 4 Oct 2021 11:37:33 +0200 Subject: [PATCH 2/2] Fix Travis & PHPStan --- .travis.yml | 2 +- phpstan.neon | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index da28dd6..2ed6a99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_install: install: - if [ "$CS_FIXER" != "run" ]; then composer remove friendsofphp/php-cs-fixer --dev --no-progress --no-update ; fi; - - composer update --prefer-dist --no-progress --no-suggest -o $ + - composer update --prefer-dist --no-progress -o - php vendor/bin/simple-phpunit install before_script: diff --git a/phpstan.neon b/phpstan.neon index cde561a..7c1f51c 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,7 +6,7 @@ parameters: # https://github.com/phpstan/phpstan/issues/694#issuecomment-350724288 bootstrapFiles: - - vendor/bin/.phpunit/phpunit-8.5-0/vendor/autoload.php + - vendor/bin/.phpunit/phpunit-7.5-0/vendor/autoload.php includes: - vendor/phpstan/phpstan-phpunit/extension.neon