1
0
Fork 0

Update PHPStan (#11222)

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
pull/11230/head
Ondřej Mirtes 2022-12-17 23:12:38 +01:00 committed by GitHub
parent 957e7a9165
commit 2aa33aaafa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 69 deletions

View File

@ -46,7 +46,7 @@
}, },
"require-dev": { "require-dev": {
"symfony/phpunit-bridge": "^6.0", "symfony/phpunit-bridge": "^6.0",
"phpstan/phpstan": "^1.4.1", "phpstan/phpstan": "^1.9.3",
"phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1", "phpstan/phpstan-deprecation-rules": "^1",
"phpstan/phpstan-strict-rules": "^1", "phpstan/phpstan-strict-rules": "^1",

84
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "63b34757131aff5b81d2ed8ce5933fe4", "content-hash": "c05209907d2737038b580f3345730346",
"packages": [ "packages": [
{ {
"name": "composer/ca-bundle", "name": "composer/ca-bundle",
@ -941,16 +941,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v5.4.15", "version": "v5.4.16",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "ea59bb0edfaf9f28d18d8791410ee0355f317669" "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/ea59bb0edfaf9f28d18d8791410ee0355f317669", "url": "https://api.github.com/repos/symfony/console/zipball/8e9b9c8dfb33af6057c94e1b44846bee700dc5ef",
"reference": "ea59bb0edfaf9f28d18d8791410ee0355f317669", "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1020,7 +1020,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v5.4.15" "source": "https://github.com/symfony/console/tree/v5.4.16"
}, },
"funding": [ "funding": [
{ {
@ -1036,7 +1036,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-10-26T21:41:52+00:00" "time": "2022-11-25T14:09:27+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@ -2038,16 +2038,16 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.9.2", "version": "1.9.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" "reference": "d03bccee595e2146b7c9d174486b84f4dc61b0f2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d03bccee595e2146b7c9d174486b84f4dc61b0f2",
"reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", "reference": "d03bccee595e2146b7c9d174486b84f4dc61b0f2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2077,7 +2077,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan/issues", "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": [ "funding": [
{ {
@ -2093,36 +2093,34 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-11-10T09:56:11+00:00" "time": "2022-12-17T13:33:52+00:00"
}, },
{ {
"name": "phpstan/phpstan-deprecation-rules", "name": "phpstan/phpstan-deprecation-rules",
"version": "1.0.0", "version": "1.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan-deprecation-rules.git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git",
"reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682" "reference": "2c6792eda026d9c474c14aa018aed312686714db"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/2c6792eda026d9c474c14aa018aed312686714db",
"reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", "reference": "2c6792eda026d9c474c14aa018aed312686714db",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1 || ^8.0", "php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.0" "phpstan/phpstan": "^1.9.3"
}, },
"require-dev": { "require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2", "php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-php-parser": "^1.1",
"phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5" "phpunit/phpunit": "^9.5"
}, },
"type": "phpstan-extension", "type": "phpstan-extension",
"extra": { "extra": {
"branch-alias": {
"dev-master": "1.0-dev"
},
"phpstan": { "phpstan": {
"includes": [ "includes": [
"rules.neon" "rules.neon"
@ -2141,27 +2139,27 @@
"description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.",
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", "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", "name": "phpstan/phpstan-phpunit",
"version": "1.2.2", "version": "1.3.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan-phpunit.git", "url": "https://github.com/phpstan/phpstan-phpunit.git",
"reference": "dea1f87344c6964c607d9076dee42d891f3923f0" "reference": "cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/dea1f87344c6964c607d9076dee42d891f3923f0", "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088",
"reference": "dea1f87344c6964c607d9076dee42d891f3923f0", "reference": "cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2 || ^8.0", "php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.8.11" "phpstan/phpstan": "^1.9.3"
}, },
"conflict": { "conflict": {
"phpunit/phpunit": "<7.0" "phpunit/phpunit": "<7.0"
@ -2193,9 +2191,9 @@
"description": "PHPUnit extensions and rules for PHPStan", "description": "PHPUnit extensions and rules for PHPStan",
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan-phpunit/issues", "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", "name": "phpstan/phpstan-strict-rules",
@ -2247,16 +2245,16 @@
}, },
{ {
"name": "phpstan/phpstan-symfony", "name": "phpstan/phpstan-symfony",
"version": "1.2.16", "version": "1.2.18",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan-symfony.git", "url": "https://github.com/phpstan/phpstan-symfony.git",
"reference": "d6ea16206b1b645ded5b43736d8ef5ae1168eb55" "reference": "3178f15a60b62df21ddd202f6a668851eeb138c7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/d6ea16206b1b645ded5b43736d8ef5ae1168eb55", "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/3178f15a60b62df21ddd202f6a668851eeb138c7",
"reference": "d6ea16206b1b645ded5b43736d8ef5ae1168eb55", "reference": "3178f15a60b62df21ddd202f6a668851eeb138c7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2312,22 +2310,22 @@
"description": "Symfony Framework extensions and rules for PHPStan", "description": "Symfony Framework extensions and rules for PHPStan",
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan-symfony/issues", "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", "name": "symfony/phpunit-bridge",
"version": "v6.1.6", "version": "v6.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/phpunit-bridge.git", "url": "https://github.com/symfony/phpunit-bridge.git",
"reference": "07cf788ac9ae83b59d46599bb5098c3add88c68b" "reference": "1bd3b17db6d2ec284efbdc916600e880d6d858df"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/07cf788ac9ae83b59d46599bb5098c3add88c68b", "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/1bd3b17db6d2ec284efbdc916600e880d6d858df",
"reference": "07cf788ac9ae83b59d46599bb5098c3add88c68b", "reference": "1bd3b17db6d2ec284efbdc916600e880d6d858df",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2381,7 +2379,7 @@
"description": "Provides utilities for PHPUnit, especially user deprecation notices management", "description": "Provides utilities for PHPUnit, especially user deprecation notices management",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/phpunit-bridge/tree/v6.1.6" "source": "https://github.com/symfony/phpunit-bridge/tree/v6.2.0"
}, },
"funding": [ "funding": [
{ {
@ -2397,7 +2395,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-10-07T08:04:03+00:00" "time": "2022-11-18T19:08:09+00:00"
} }
], ],
"aliases": [], "aliases": [],

View File

@ -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)\(\)~' - '~Dynamic call to static method PHPUnit\\Framework\\TestCase::(once|atLeast|exactly|will|exactly|returnValue|returnCallback|any|atLeastOnce|throwException|onConsecutiveCalls|never|returnValueMap)\(\)~'
bootstrapFiles: bootstrapFiles:
- ./locate-phpunit-autoloader.php
- ../tests/bootstrap.php - ../tests/bootstrap.php
paths: paths:

View File

@ -1,22 +0,0 @@
<?php
$bestDirFound = null;
$dirs = glob(__DIR__.'/../vendor/bin/.phpunit/phpunit-*', GLOB_ONLYDIR);
natsort($dirs);
foreach (array_reverse($dirs) as $dir) {
$bestDirFound = $dir;
if (PHP_VERSION_ID >= 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';

View File

@ -25,8 +25,6 @@ if (!class_exists(InstalledVersions::class, false)) {
require __DIR__.'/../src/Composer/InstalledVersions.php'; require __DIR__.'/../src/Composer/InstalledVersions.php';
} }
require __DIR__.'/Composer/Test/TestCase.php';
Platform::putEnv('COMPOSER_TESTS_ARE_RUNNING', '1'); Platform::putEnv('COMPOSER_TESTS_ARE_RUNNING', '1');
// symfony/phpunit-bridge sets some default env vars which we do not need polluting the test env // symfony/phpunit-bridge sets some default env vars which we do not need polluting the test env