Skip to content

Commit 499578a

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

File tree

5 files changed

+102
-20
lines changed

5 files changed

+102
-20
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+
]);

tests/FeedIo/SpecificationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use FeedIo\Rule\DateTimeBuilder;
66
use FeedIo\Standard\Atom;
77
use FeedIo\Standard\Json;
8-
use PHPStan\Testing\TestCase;
8+
use PHPUnit\Framework\TestCase;
99
use Psr\Log\NullLogger;
1010

1111
class SpecificationTest extends TestCase

0 commit comments

Comments
 (0)