diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19c652b..c866c97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 10 matrix: - php: [ '7.2', '7.3', '7.4' ] + php: [ '8.0', '8.1' ] steps: - name: Set up PHP diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index e7bb66a..518ac9f 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v2 - name: PHPStan - uses: docker://oskarstark/phpstan-ga:0.12.85 + uses: docker://oskarstark/phpstan-ga:1.4.6 env: REQUIRE_DEV: true with: @@ -27,6 +27,6 @@ jobs: uses: actions/checkout@v2 - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga:2.19.0 + uses: docker://oskarstark/php-cs-fixer-ga:3.4.0 with: - args: --dry-run --diff-format udiff + args: --dry-run --diff diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 79% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index bb4d8ce..84512f8 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -1,8 +1,13 @@ setRiskyAllowed(true) - ->setRules( +$finder = PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->in(__DIR__.'/test') + ->exclude('support/_generated') + ->name('*.php'); + +$config = new PhpCsFixer\Config(); +return $config->setRules( [ '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], @@ -16,13 +21,17 @@ 'allow_single_line_closure' => true, ], 'class_attributes_separation' => [ - 'elements' => ['const', 'property', 'method'], + 'elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one', 'trait_import' => 'none'], ], 'declare_strict_types' => true, 'no_alternative_syntax' => true, 'no_leading_import_slash' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_short_echo_tag' => true, + 'multiline_whitespace_before_semicolons' => [ + 'strategy' => 'no_multi_line' + ], + 'echo_tag_syntax' => [ + 'format' => 'long' + ], 'no_spaces_inside_parenthesis' => true, 'no_useless_else' => true, 'not_operator_with_space' => false, @@ -48,7 +57,9 @@ ], 'single_quote' => true, 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, + 'trailing_comma_in_multiline' => [ + 'elements' => ['arrays'] + ], 'trim_array_spaces' => true, 'single_line_after_imports' => true, 'unary_operator_spaces' => true, @@ -56,12 +67,7 @@ 'yoda_style' => false, ] ) + ->setRiskyAllowed(true) ->setIndent(' ') ->setUsingCache(false) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__.'/src') - ->in(__DIR__.'/test') - ->exclude('support/_generated') - ->name('*.php') - ); + ->setFinder($finder); diff --git a/composer.json b/composer.json index fb5b3b4..faa5096 100644 --- a/composer.json +++ b/composer.json @@ -9,16 +9,16 @@ "type": "library", "license": "MIT", "require": { - "php": "^7.2", + "php": "^8.0", "codeception/codeception": "^4.0", - "codeception/lib-innerbrowser": "^1.0", - "slim/psr7": "^1.1", - "slim/slim": "^4.2" + "codeception/lib-innerbrowser": "^2.0", + "slim/psr7": "^1.3", + "slim/slim": "^4.7" }, "require-dev": { "ext-json": "*", - "codeception/module-asserts": "^1.2", - "codeception/module-rest": "^1.2" + "codeception/module-asserts": "^2.0", + "codeception/module-rest": "^2.0" }, "autoload": { "psr-4": {