Skip to content

Commit

Permalink
Upgrade to PHPStan 2 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk authored Nov 12, 2024
1 parent 0a695df commit 5e6207b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
tools: composer-normalize,composer-require-checker,composer-unused
- uses: "ramsey/composer-install@v2"
- uses: "ramsey/composer-install@v3"

- run: "composer validate --strict"
- run: "composer-normalize --dry-run"
Expand All @@ -54,7 +54,7 @@ jobs:
coverage: "${{ matrix.code-coverage }}"
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v2"
- uses: "ramsey/composer-install@v3"

- run: "vendor/bin/phpunit --no-coverage --no-logging"
if: ${{ matrix.code-coverage == 'none' }}
Expand All @@ -79,7 +79,7 @@ jobs:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v2"
- uses: "ramsey/composer-install@v3"

- run: "vendor/bin/php-cs-fixer fix --verbose --dry-run --diff"

Expand All @@ -98,6 +98,6 @@ jobs:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v2"
- uses: "ramsey/composer-install@v3"

- run: "vendor/bin/phpstan analyse --no-progress --error-format=github"
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"friendsofphp/php-cs-fixer": "^3.64.0"
},
"require-dev": {
"phpstan/phpstan": "^1.12.10",
"phpstan/phpstan-phpunit": "^1.4.0",
"phpstan/phpstan": "^2.0.1",
"phpstan/phpstan-phpunit": "^2",
"phpunit/phpunit": "^11.4.3"
},
"autoload": {
Expand Down
9 changes: 8 additions & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
parameters:
ignoreErrors:
-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNotEmpty\\(\\) with false will always evaluate to false\\.$#"
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNotEmpty\(\) with false will always evaluate to false\.$#'
identifier: staticMethod.impossibleType
count: 1
path: tests/ConfigTest.php

-
message: '#^Strict comparison using \!\=\= between false and array\{allow_mixed\: true\}\|array\{comment_type\: ''all_multiline''\}\|array\{const\: ''single'', property\: ''single'', method\: ''single''\}\|array\{default\: ''align_single_space''\}\|array\{include\: array\{''@internal''\}\}\|array\{keep_multiple_spaces_after_comma\: true\}\|array\{order\: array\{''use_trait'', ''constant_public'', ''constant_protected'', ''constant_private'', ''property'', ''construct'', ''destruct'', ''magic'', \.\.\.\}\}\|array\{spacing\: ''one''\}\|true will always evaluate to true\.$#'
identifier: notIdentical.alwaysTrue
count: 1
path: tests/ConfigTest.php
2 changes: 0 additions & 2 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace SlamCsFixer\Tests;

use PhpCsFixer\ConfigInterface;
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
use PhpCsFixer\Fixer\FixerInterface;
use PhpCsFixer\FixerFactory;
Expand All @@ -23,7 +22,6 @@ public function testConfig(): void
{
$config = new Config();

self::assertInstanceOf(ConfigInterface::class, $config);
self::assertNotEmpty($config->getCustomFixers());
}

Expand Down

0 comments on commit 5e6207b

Please sign in to comment.