diff --git a/composer.json b/composer.json index 7210d41a..f3b7cd0c 100644 --- a/composer.json +++ b/composer.json @@ -32,9 +32,10 @@ "require-dev": { "phpunit/phpunit": "~9.3.0", "monolog/monolog": "1.*|2.*", - "phpstan/phpstan": "^0.12.81", + "phpstan/phpstan": "^2.1.22", "friendsofphp/php-cs-fixer": "^3.5", - "php-http/mock-client": "^1.5" + "php-http/mock-client": "^1.5", + "rector/rector": "^2.1" }, "suggest": { "monolog/monolog": "Allows to handle logs", diff --git a/composer.lock b/composer.lock index 4cc3e1e7..2a5cff26 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fc7d0cfb157d28568ea5453c2ece4a54", + "content-hash": "61dd5ee073d8375252d4c1122e48d372", "packages": [ { "name": "nyholm/psr7", @@ -1994,20 +1994,20 @@ }, { "name": "phpstan/phpstan", - "version": "0.12.100", + "version": "2.1.22", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "48236ddf823547081b2b153d1cd2994b784328c3" + "reference": "41600c8379eb5aee63e9413fe9e97273e25d57e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/48236ddf823547081b2b153d1cd2994b784328c3", - "reference": "48236ddf823547081b2b153d1cd2994b784328c3", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/41600c8379eb5aee63e9413fe9e97273e25d57e4", + "reference": "41600c8379eb5aee63e9413fe9e97273e25d57e4", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -2017,11 +2017,6 @@ "phpstan.phar" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -2032,9 +2027,16 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.100" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -2044,13 +2046,9 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2022-11-01T09:52:08+00:00" + "time": "2025-08-04T19:17:37+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3103,6 +3101,66 @@ ], "time": "2024-06-11T12:45:25+00:00" }, + { + "name": "rector/rector", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "40a71441dd73fa150a66102f5ca1364c44fc8fff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/40a71441dd73fa150a66102f5ca1364c44fc8fff", + "reference": "40a71441dd73fa150a66102f5ca1364c44fc8fff", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0", + "phpstan/phpstan": "^2.1.18" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "homepage": "https://getrector.com/", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/2.1.2" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2025-07-17T19:30:06+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.2", diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 00000000..4d08f439 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,7 @@ +parameters: + errorFormat: table + level: 5 + paths: + - %currentWorkingDirectory%/src + bootstrapFiles: + - %currentWorkingDirectory%/vendor/autoload.php diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..2bb5054d --- /dev/null +++ b/rector.php @@ -0,0 +1,16 @@ +withPaths([ + __DIR__ . '/src', + ]) + ->withPhpVersion(PhpVersion::PHP_84) + ->withRules([ + ExplicitNullableParamTypeRector::class, + ]); diff --git a/tests/FeedIo/SpecificationTest.php b/tests/FeedIo/SpecificationTest.php index 0b43e951..2dcdef60 100644 --- a/tests/FeedIo/SpecificationTest.php +++ b/tests/FeedIo/SpecificationTest.php @@ -5,7 +5,7 @@ use FeedIo\Rule\DateTimeBuilder; use FeedIo\Standard\Atom; use FeedIo\Standard\Json; -use PHPStan\Testing\TestCase; +use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; class SpecificationTest extends TestCase