Skip to content

Commit 1784d6d

Browse files
committed
Updated PHPStan to latest version
Added rector to allow fixing common linting issues
1 parent 4b3bdfb commit 1784d6d

File tree

4 files changed

+101
-19
lines changed

4 files changed

+101
-19
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
"require-dev": {
3333
"phpunit/phpunit": "~9.3.0",
3434
"monolog/monolog": "1.*|2.*",
35-
"phpstan/phpstan": "^0.12.81",
35+
"phpstan/phpstan": "^2.1.22",
3636
"friendsofphp/php-cs-fixer": "^3.5",
37-
"php-http/mock-client": "^1.5"
37+
"php-http/mock-client": "^1.5",
38+
"rector/rector": "^2.1"
3839
},
3940
"suggest": {
4041
"monolog/monolog": "Allows to handle logs",

composer.lock

Lines changed: 75 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
errorFormat: table
3+
level: 5
4+
paths:
5+
- %currentWorkingDirectory%/src
6+
bootstrapFiles:
7+
- %currentWorkingDirectory%/vendor/autoload.php

rector.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector;
7+
use Rector\ValueObject\PhpVersion;
8+
9+
return RectorConfig::configure()
10+
->withPaths([
11+
__DIR__ . '/src',
12+
])
13+
->withPhpVersion(PhpVersion::PHP_84)
14+
->withRules([
15+
ExplicitNullableParamTypeRector::class,
16+
]);

0 commit comments

Comments
 (0)