Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c0b33c

Browse files
authored
Update PHPStan and PHP-CS-Fixer to their latest version (getsentry#578)
* Update PHPStan and PHP-CS-Fixer to their latest version * Raise the PHPStan level to 9 * Fix failing test due to wrong assertion * Fix code style * Bump minimum required version of `friendsofphp/php-cs-fixer` * Update PHPStan and Psalm baselines * Raise the minimum required version of PHPStan * Bump minimum required version of `PHP-CS-Fixer` * Update PHPStan and Psalm baselines * Widen the version constraint range for PHP-CS-Fixer * Revert breaking change
1 parent dd37786 commit 0c0b33c

25 files changed

+307
-57
lines changed

.github/workflows/static-analysis.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup PHP
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: '8.0'
22+
php-version: '8.1'
2323

2424
- name: Install dependencies
2525
run: composer update --no-progress --no-interaction --prefer-dist
@@ -36,6 +36,8 @@ jobs:
3636

3737
- name: Setup PHP
3838
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: '8.1'
3941

4042
- name: Install dependencies
4143
run: composer update --no-progress --no-interaction --prefer-dist
@@ -53,7 +55,7 @@ jobs:
5355
- name: Setup PHP
5456
uses: shivammathur/setup-php@v2
5557
with:
56-
php-version: '8.0'
58+
php-version: '8.1'
5759

5860
- name: Install dependencies
5961
run: composer update --no-progress --no-interaction --prefer-dist

.github/workflows/tests.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ jobs:
7171
- name: Setup Problem Matchers for PHPUnit
7272
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
7373

74-
- name: Remove PHP-CS-Fixer
75-
run: composer remove --dev friendsofphp/php-cs-fixer --no-update
76-
7774
- name: Remove Symfony Messenger
7875
run: composer remove --dev symfony/messenger --no-update
7976
if: matrix.symfony-version == '3.4.*'

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
package.xml
33
/vendor
44
.idea
5-
.php_cs.cache
5+
.php-cs-fixer.cache
66
.phpunit.result.cache
77
docs/_build
88
var

.php_cs.dist renamed to .php-cs-fixer.dist.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
return PhpCsFixer\Config::create()
3+
declare(strict_types=1);
4+
5+
return (new PhpCsFixer\Config())
6+
->setRiskyAllowed(true)
47
->setRules([
58
'@PSR2' => true,
69
'@Symfony' => true,
@@ -11,8 +14,6 @@
1114
'imports_order' => ['class', 'function', 'const'],
1215
],
1316
'declare_strict_types' => true,
14-
'psr0' => true,
15-
'psr4' => true,
1617
'random_api_migration' => true,
1718
'yoda_style' => true,
1819
'self_accessor' => false,
@@ -27,7 +28,6 @@
2728
'property' => 'multi',
2829
],
2930
])
30-
->setRiskyAllowed(true)
3131
->setFinder(
3232
PhpCsFixer\Finder::create()
3333
->in(__DIR__)

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@
4040
"require-dev": {
4141
"doctrine/dbal": "^2.13||^3.0",
4242
"doctrine/doctrine-bundle": "^1.12||^2.5",
43-
"friendsofphp/php-cs-fixer": "^2.18",
44-
"jangregor/phpstan-prophecy": "^0.8",
43+
"friendsofphp/php-cs-fixer": "^2.19||^3.6",
44+
"jangregor/phpstan-prophecy": "^1.0",
4545
"monolog/monolog": "^1.3||^2.0",
4646
"phpspec/prophecy": "!=1.11.0",
4747
"phpspec/prophecy-phpunit": "^1.1||^2.0",
4848
"phpstan/extension-installer": "^1.0",
49-
"phpstan/phpstan": "^0.12",
50-
"phpstan/phpstan-phpunit": "^0.12",
49+
"phpstan/phpstan": "^1.3",
50+
"phpstan/phpstan-phpunit": "^1.0",
51+
"phpstan/phpstan-symfony": "^1.0",
5152
"phpunit/phpunit": "^8.5.14||^9.3.9",
5253
"symfony/browser-kit": "^3.4.44||^4.4.20||^5.0.11||^6.0",
5354
"symfony/cache": "^3.4.44||^4.4.20||^5.0.11||^6.0",

0 commit comments

Comments
 (0)