Bump PHPStan to 2.1.13

This commit is contained in:
wn_ 2025-04-27 14:41:39 +00:00
parent 0961c8bd4c
commit 7ad1efed3e
13 changed files with 83 additions and 46 deletions

View File

@ -29,7 +29,7 @@
"guzzlehttp/guzzle": "^7.0" "guzzlehttp/guzzle": "^7.0"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "2.0.1", "phpstan/phpstan": "2.1.13",
"phpunit/phpunit": "9.5.16", "phpunit/phpunit": "9.5.16",
"phpunit/php-code-coverage": "^9.2" "phpunit/php-code-coverage": "^9.2"
} }

12
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": "1aa8437b32b5398144a47490f6bcdfa0", "content-hash": "ad2f3020f2db46475c16f9710a84bca4",
"packages": [ "packages": [
{ {
"name": "chillerlan/php-qrcode", "name": "chillerlan/php-qrcode",
@ -1648,16 +1648,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "2.0.1", "version": "2.1.13",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d" "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e55e03e6d4ac49cd1240907e5b08e5cd378572a9",
"reference": "ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d", "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1702,7 +1702,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-11-11T15:43:04+00:00" "time": "2025-04-27T12:28:25+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",

5
vendor/autoload.php vendored
View File

@ -14,10 +14,7 @@ if (PHP_VERSION_ID < 50600) {
echo $err; echo $err;
} }
} }
trigger_error( throw new RuntimeException($err);
$err,
E_USER_ERROR
);
} }
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';

View File

@ -26,12 +26,23 @@ use Composer\Semver\VersionParser;
*/ */
class InstalledVersions class InstalledVersions
{ {
/**
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
* @internal
*/
private static $selfDir = null;
/** /**
* @var mixed[]|null * @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/ */
private static $installed; private static $installed;
/**
* @var bool
*/
private static $installedIsLocalDir;
/** /**
* @var bool|null * @var bool|null
*/ */
@ -309,6 +320,24 @@ class InstalledVersions
{ {
self::$installed = $data; self::$installed = $data;
self::$installedByVendor = array(); self::$installedByVendor = array();
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
// so we have to assume it does not, and that may result in duplicate data being returned when listing
// all installed packages for example
self::$installedIsLocalDir = false;
}
/**
* @return string
*/
private static function getSelfDir()
{
if (self::$selfDir === null) {
self::$selfDir = strtr(__DIR__, '\\', '/');
}
return self::$selfDir;
} }
/** /**
@ -322,19 +351,27 @@ class InstalledVersions
} }
$installed = array(); $installed = array();
$copiedLocalDir = false;
if (self::$canGetVendors) { if (self::$canGetVendors) {
$selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) { if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir]; $installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) { } elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php'; $required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required; self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { $installed[] = $required;
self::$installed = $installed[count($installed) - 1]; if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
self::$installed = $required;
self::$installedIsLocalDir = true;
} }
} }
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
$copiedLocalDir = true;
}
} }
} }
@ -350,7 +387,7 @@ class InstalledVersions
} }
} }
if (self::$installed !== array()) { if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed; $installed[] = self::$installed;
} }

View File

@ -14,6 +14,7 @@ return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'Config' => $baseDir . '/classes/Config.php', 'Config' => $baseDir . '/classes/Config.php',
'Counters' => $baseDir . '/classes/Counters.php', 'Counters' => $baseDir . '/classes/Counters.php',
'Crypt' => $baseDir . '/classes/Crypt.php',
'Db' => $baseDir . '/classes/Db.php', 'Db' => $baseDir . '/classes/Db.php',
'Db_Migrations' => $baseDir . '/classes/Db_Migrations.php', 'Db_Migrations' => $baseDir . '/classes/Db_Migrations.php',
'Db_Prefs' => $baseDir . '/classes/Db_Prefs.php', 'Db_Prefs' => $baseDir . '/classes/Db_Prefs.php',

View File

@ -6,7 +6,7 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
return array( return array(
'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'), 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-common/src'),
'chillerlan\\Settings\\' => array($vendorDir . '/chillerlan/php-settings-container/src'), 'chillerlan\\Settings\\' => array($vendorDir . '/chillerlan/php-settings-container/src'),
'chillerlan\\QRCode\\' => array($vendorDir . '/chillerlan/php-qrcode/src'), 'chillerlan\\QRCode\\' => array($vendorDir . '/chillerlan/php-qrcode/src'),
'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),

View File

@ -63,9 +63,9 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056
public static $prefixDirsPsr4 = array ( public static $prefixDirsPsr4 = array (
'phpDocumentor\\Reflection\\' => 'phpDocumentor\\Reflection\\' =>
array ( array (
0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src', 0 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src',
1 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src', 1 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
2 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src', 2 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src',
), ),
'chillerlan\\Settings\\' => 'chillerlan\\Settings\\' =>
array ( array (
@ -147,6 +147,7 @@ class ComposerStaticInit19fc2ff1c0f9a92279c7979386bb2056
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Config' => __DIR__ . '/../..' . '/classes/Config.php', 'Config' => __DIR__ . '/../..' . '/classes/Config.php',
'Counters' => __DIR__ . '/../..' . '/classes/Counters.php', 'Counters' => __DIR__ . '/../..' . '/classes/Counters.php',
'Crypt' => __DIR__ . '/../..' . '/classes/Crypt.php',
'Db' => __DIR__ . '/../..' . '/classes/Db.php', 'Db' => __DIR__ . '/../..' . '/classes/Db.php',
'Db_Migrations' => __DIR__ . '/../..' . '/classes/Db_Migrations.php', 'Db_Migrations' => __DIR__ . '/../..' . '/classes/Db_Migrations.php',
'Db_Prefs' => __DIR__ . '/../..' . '/classes/Db_Prefs.php', 'Db_Prefs' => __DIR__ . '/../..' . '/classes/Db_Prefs.php',

View File

@ -1235,17 +1235,17 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "2.0.1", "version": "2.1.13",
"version_normalized": "2.0.1.0", "version_normalized": "2.1.13.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d" "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e55e03e6d4ac49cd1240907e5b08e5cd378572a9",
"reference": "ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d", "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1254,7 +1254,7 @@
"conflict": { "conflict": {
"phpstan/phpstan-shim": "*" "phpstan/phpstan-shim": "*"
}, },
"time": "2024-11-11T15:43:04+00:00", "time": "2025-04-27T12:28:25+00:00",
"bin": [ "bin": [
"phpstan", "phpstan",
"phpstan.phar" "phpstan.phar"

View File

@ -3,7 +3,7 @@
'name' => '__root__', 'name' => '__root__',
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => 'cd2c10f9f71409df24fc74c1bbd7d5ddbf48d991', 'reference' => '0961c8bd4c8a4f61f9458c08bf0e91b5cc2aa5d0',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -13,7 +13,7 @@
'__root__' => array( '__root__' => array(
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => 'cd2c10f9f71409df24fc74c1bbd7d5ddbf48d991', 'reference' => '0961c8bd4c8a4f61f9458c08bf0e91b5cc2aa5d0',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -175,9 +175,9 @@
'dev_requirement' => true, 'dev_requirement' => true,
), ),
'phpstan/phpstan' => array( 'phpstan/phpstan' => array(
'pretty_version' => '2.0.1', 'pretty_version' => '2.1.13',
'version' => '2.0.1.0', 'version' => '2.1.13.0',
'reference' => 'ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d', 'reference' => 'e55e03e6d4ac49cd1240907e5b08e5cd378572a9',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../phpstan/phpstan', 'install_path' => __DIR__ . '/../phpstan/phpstan',
'aliases' => array(), 'aliases' => array(),

View File

@ -1,6 +1,7 @@
MIT License MIT License
Copyright (c) 2016 Ondřej Mirtes Copyright (c) 2016 Ondřej Mirtes
Copyright (c) 2025 PHPStan s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -60,11 +60,11 @@ can be checked before you run the actual line.
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<a href="https://inviqa.com/"><img src="website/src/images/sponsor/inviqa.png" alt="Inviqa" width="254" height="65"></a> <a href="https://inviqa.com/"><img src="website/src/images/sponsor/inviqa.png" alt="Inviqa" width="254" height="65"></a>
<br> <br>
<a href="https://www.getresponse.com/"><img src="website/src/images/sponsor/getresponse.png" alt="GetResponse" width="283" height="64"></a>
&nbsp;&nbsp;&nbsp;
<a href="https://www.shoptet.cz/"><img src="website/src/images/sponsor/shoptet.png" alt="Shoptet" width="283" height="64"></a> <a href="https://www.shoptet.cz/"><img src="website/src/images/sponsor/shoptet.png" alt="Shoptet" width="283" height="64"></a>
<br> &nbsp;&nbsp;&nbsp;
<a href="https://route4me.com/"><img src="website/src/images/sponsor/route4me.png" alt="Route4Me: Route Optimizer and Route Planner Software" width="283" height="64"></a> <a href="https://route4me.com/"><img src="website/src/images/sponsor/route4me.png" alt="Route4Me: Route Optimizer and Route Planner Software" width="283" height="64"></a>
<br>
<a href="https://werkenbijbelsimpel.nl/en/about-us/"><img src="website/src/images/sponsor/belsimpel.png" alt="Belsimpel" width="284" height="64"></a>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<a href="https://jobs.ticketswap.com/"><img src="website/src/images/sponsor/ticketswap.png" alt="TicketSwap" width="269" height="64"></a> <a href="https://jobs.ticketswap.com/"><img src="website/src/images/sponsor/ticketswap.png" alt="TicketSwap" width="269" height="64"></a>

Binary file not shown.

View File

@ -1,16 +1,16 @@
-----BEGIN PGP SIGNATURE----- -----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmcyJeMACgkQUcZzBf/C iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmgOIscACgkQUcZzBf/C
5cCV0A//Sg3/cyjMFpusDfq8uk57ADL2jerPD4oPRG9/smKWf14pAsWwk7PQOcQe 5cBGzA//Wya23VZ7JBZM3RNR4g4d3ez39/BIa5XBHAF1Hpm9dmliDlME6R73ZNHk
zb2f+YW1tEouiyc/+RQoc+Xkv2om2N7RwaH4C7/dNnV6HYEsQS3U5cP4le/d32U6 D7LT/tLU72AgYuWaIp0mADIkmqU+OPZTGKXkncJHxWlcJm5QLZxy6tYvC8MUvjHK
0wtu0Se6FieFEc5Z/wEZzbGZCa3xToIFXIC8awNvZO6p5JGB29dWeIZgbmpHHN/6 lv2Vs1Ito9rbnnTHTieAnjvp7Ne3YUmVMLTHPP+R8tyPcNeHbHpUqlQf83sb6OK7
yIxBGom0PYIf5My+J9nTlM0hYICKKGzU4NdCQzFVdenA/YCdXwr8lvec1ZwKcb2z 7fZKBeHvb98p1ii9uNetzjC/CWbknHddq9viT46TZYuwXMVKYOuMkweppMHlxOY0
Y6sJWaBvYIGPg4ej5oVuEm/vUx4NXnKpmn5Up+wOXRjzoS6ZcduO9gxCwgJ8Uh1r 741+FQQ3dJB7Jp3NOLwYYqe7WcMyKrYiXJuIvpUSK38EbHg6NTDqwvenXTDMN45i
MzdTbeopFh/ZIw7HgoG32BS1yZWjBFzW5MUwCzugil9Q6wfkc5hCWFG0DvKbhZK3 x8vhc5mhJHkuNfjqgjgpvvqFMt1WtoYa3a26ArwVcEKfptAkgGsNxvs4TS5xx9xC
6rCPqfJQ//8C+870Ej+rX6nndn93KHp696dRjiSDFVnB3kFOUcHhFYdaSzdaWZ2x fFzyOhMEPbHRSe7DnctOKSR075ylrd+jBfSH7ldoHE5L2H+qSsZIxHZ/cgqmCwVn
E26PwyI4NBIynS153EIo2S1poIAWsAXQTWaFyRqrUq+QkeioxdKJr7UVtmZJcqH3 eGEetLf5raNyojipMXzJYO3JQtTRkUJ1V9FPK603CNEEXJGW6ZFSSFgsF+PCvWg4
v5lytzJwYvmYk57CjCoJDWwY6y1b7YN1zkjzlNozlcvbF4ftzIIXZW5CcOeg1Dij Op5w3OlxpjLRYgtzSSrLZlABNoNbG680+nf7YKaBRbuF4K0IaSBC9Og+KKtCf3MH
jZEOhVnEygbCvYcXCn3RSC5OZe0wz/B5EuT4HnLpeyyE+tLg2evqfJXqwagwRZoL hQrVEPJH9M7jvt3Vc8l5KRqALi3AgN0qAXzQWd8X4xUfS9oKEyZjnrfdvmwqk3gg
EiMpKZlYY2kEdgezzefYH1ElCvmjaa5BRTlXYswVW/G7KKJ6fq8= gZW5hZsGpwY0mgtBV1lRnhv4tLWzhMee3VHZVtVmalz/K0HXdQ0=
=lVJA =s49h
-----END PGP SIGNATURE----- -----END PGP SIGNATURE-----