From 2aa33aaafa931c84af3cee39e04be68b5c260702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Mirtes?= Date: Sat, 17 Dec 2022 23:12:38 +0100 Subject: [PATCH] Update PHPStan (#11222) Co-authored-by: Jordi Boggiano --- composer.json | 2 +- composer.lock | 84 +++++++++++++-------------- phpstan/config.neon | 1 - phpstan/locate-phpunit-autoloader.php | 22 ------- tests/bootstrap.php | 2 - 5 files changed, 42 insertions(+), 69 deletions(-) delete mode 100644 phpstan/locate-phpunit-autoloader.php diff --git a/composer.json b/composer.json index 86fd27907..da5389298 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ }, "require-dev": { "symfony/phpunit-bridge": "^6.0", - "phpstan/phpstan": "^1.4.1", + "phpstan/phpstan": "^1.9.3", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-deprecation-rules": "^1", "phpstan/phpstan-strict-rules": "^1", diff --git a/composer.lock b/composer.lock index 52c8a6709..7f8ea8091 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": "63b34757131aff5b81d2ed8ce5933fe4", + "content-hash": "c05209907d2737038b580f3345730346", "packages": [ { "name": "composer/ca-bundle", @@ -941,16 +941,16 @@ }, { "name": "symfony/console", - "version": "v5.4.15", + "version": "v5.4.16", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ea59bb0edfaf9f28d18d8791410ee0355f317669" + "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ea59bb0edfaf9f28d18d8791410ee0355f317669", - "reference": "ea59bb0edfaf9f28d18d8791410ee0355f317669", + "url": "https://api.github.com/repos/symfony/console/zipball/8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", + "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", "shasum": "" }, "require": { @@ -1020,7 +1020,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.15" + "source": "https://github.com/symfony/console/tree/v5.4.16" }, "funding": [ { @@ -1036,7 +1036,7 @@ "type": "tidelift" } ], - "time": "2022-10-26T21:41:52+00:00" + "time": "2022-11-25T14:09:27+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2038,16 +2038,16 @@ "packages-dev": [ { "name": "phpstan/phpstan", - "version": "1.9.2", + "version": "1.9.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" + "reference": "d03bccee595e2146b7c9d174486b84f4dc61b0f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d03bccee595e2146b7c9d174486b84f4dc61b0f2", + "reference": "d03bccee595e2146b7c9d174486b84f4dc61b0f2", "shasum": "" }, "require": { @@ -2077,7 +2077,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.2" + "source": "https://github.com/phpstan/phpstan/tree/1.9.4" }, "funding": [ { @@ -2093,36 +2093,34 @@ "type": "tidelift" } ], - "time": "2022-11-10T09:56:11+00:00" + "time": "2022-12-17T13:33:52+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682" + "reference": "2c6792eda026d9c474c14aa018aed312686714db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", - "reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/2c6792eda026d9c474c14aa018aed312686714db", + "reference": "2c6792eda026d9c474c14aa018aed312686714db", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0" + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.3" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-php-parser": "^1.1", "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^9.5" }, "type": "phpstan-extension", "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - }, "phpstan": { "includes": [ "rules.neon" @@ -2141,27 +2139,27 @@ "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.0.0" + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.1" }, - "time": "2021-09-23T11:02:21+00:00" + "time": "2022-12-13T14:26:20+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.2.2", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "dea1f87344c6964c607d9076dee42d891f3923f0" + "reference": "cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/dea1f87344c6964c607d9076dee42d891f3923f0", - "reference": "dea1f87344c6964c607d9076dee42d891f3923f0", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088", + "reference": "cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.8.11" + "phpstan/phpstan": "^1.9.3" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -2193,9 +2191,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.2.2" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.2" }, - "time": "2022-10-28T10:23:07+00:00" + "time": "2022-12-13T15:08:22+00:00" }, { "name": "phpstan/phpstan-strict-rules", @@ -2247,16 +2245,16 @@ }, { "name": "phpstan/phpstan-symfony", - "version": "1.2.16", + "version": "1.2.18", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "d6ea16206b1b645ded5b43736d8ef5ae1168eb55" + "reference": "3178f15a60b62df21ddd202f6a668851eeb138c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/d6ea16206b1b645ded5b43736d8ef5ae1168eb55", - "reference": "d6ea16206b1b645ded5b43736d8ef5ae1168eb55", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/3178f15a60b62df21ddd202f6a668851eeb138c7", + "reference": "3178f15a60b62df21ddd202f6a668851eeb138c7", "shasum": "" }, "require": { @@ -2312,22 +2310,22 @@ "description": "Symfony Framework extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/1.2.16" + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.2.18" }, - "time": "2022-11-04T13:16:15+00:00" + "time": "2022-12-16T09:43:26+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v6.1.6", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "07cf788ac9ae83b59d46599bb5098c3add88c68b" + "reference": "1bd3b17db6d2ec284efbdc916600e880d6d858df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/07cf788ac9ae83b59d46599bb5098c3add88c68b", - "reference": "07cf788ac9ae83b59d46599bb5098c3add88c68b", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/1bd3b17db6d2ec284efbdc916600e880d6d858df", + "reference": "1bd3b17db6d2ec284efbdc916600e880d6d858df", "shasum": "" }, "require": { @@ -2381,7 +2379,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.1.6" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.2.0" }, "funding": [ { @@ -2397,7 +2395,7 @@ "type": "tidelift" } ], - "time": "2022-10-07T08:04:03+00:00" + "time": "2022-11-18T19:08:09+00:00" } ], "aliases": [], diff --git a/phpstan/config.neon b/phpstan/config.neon index 2390fa97c..f37049ab4 100644 --- a/phpstan/config.neon +++ b/phpstan/config.neon @@ -45,7 +45,6 @@ parameters: - '~Dynamic call to static method PHPUnit\\Framework\\TestCase::(once|atLeast|exactly|will|exactly|returnValue|returnCallback|any|atLeastOnce|throwException|onConsecutiveCalls|never|returnValueMap)\(\)~' bootstrapFiles: - - ./locate-phpunit-autoloader.php - ../tests/bootstrap.php paths: diff --git a/phpstan/locate-phpunit-autoloader.php b/phpstan/locate-phpunit-autoloader.php deleted file mode 100644 index 93a179389..000000000 --- a/phpstan/locate-phpunit-autoloader.php +++ /dev/null @@ -1,22 +0,0 @@ -= 80000 && false !== strpos($dir, 'phpunit-9')) { - break; - } - if (PHP_VERSION_ID < 80000 && false !== strpos($dir, 'phpunit-8')) { - break; - } -} - -if (null === $bestDirFound) { - echo 'Run "composer test" to initialize PHPUnit sources before running PHPStan'.PHP_EOL; - exit(1); -} - -include $bestDirFound.'/vendor/autoload.php'; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 010ded939..494fa6894 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -25,8 +25,6 @@ if (!class_exists(InstalledVersions::class, false)) { require __DIR__.'/../src/Composer/InstalledVersions.php'; } -require __DIR__.'/Composer/Test/TestCase.php'; - Platform::putEnv('COMPOSER_TESTS_ARE_RUNNING', '1'); // symfony/phpunit-bridge sets some default env vars which we do not need polluting the test env