1
0
Fork 0

Update phpstan deps and fix a few array_filter issues

pull/11943/head
Jordi Boggiano 2024-04-19 16:54:04 +02:00
parent 3604996464
commit b0ec0f96ad
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
8 changed files with 47 additions and 36 deletions

40
composer.lock generated
View File

@ -2014,16 +2014,16 @@
"packages-dev": [
{
"name": "phpstan/phpstan",
"version": "1.10.66",
"version": "1.10.67",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "94779c987e4ebd620025d9e5fdd23323903950bd"
"reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/94779c987e4ebd620025d9e5fdd23323903950bd",
"reference": "94779c987e4ebd620025d9e5fdd23323903950bd",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493",
"reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493",
"shasum": ""
},
"require": {
@ -2066,13 +2066,9 @@
{
"url": "https://github.com/phpstan",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
"time": "2024-03-28T16:17:31+00:00"
"time": "2024-04-16T07:22:02+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",
@ -2176,21 +2172,21 @@
},
{
"name": "phpstan/phpstan-strict-rules",
"version": "1.5.2",
"version": "1.5.4",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
"reference": "7a50e9662ee9f3942e4aaaf3d603653f60282542"
"reference": "8afd4af32bbff7b1f6df3d42bda45b2e661ba297"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/7a50e9662ee9f3942e4aaaf3d603653f60282542",
"reference": "7a50e9662ee9f3942e4aaaf3d603653f60282542",
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/8afd4af32bbff7b1f6df3d42bda45b2e661ba297",
"reference": "8afd4af32bbff7b1f6df3d42bda45b2e661ba297",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.10.34"
"phpstan/phpstan": "^1.10.60"
},
"require-dev": {
"nikic/php-parser": "^4.13.0",
@ -2219,22 +2215,22 @@
"description": "Extra strict and opinionated rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.2"
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.4"
},
"time": "2023-10-30T14:35:06+00:00"
"time": "2024-04-19T14:48:30+00:00"
},
{
"name": "phpstan/phpstan-symfony",
"version": "1.3.9",
"version": "1.3.12",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-symfony.git",
"reference": "a32bc86da24495025d7aafd1ba62444d4a364a98"
"reference": "f4b9407fa3203aebafd422ae8f0eb1ef94659a80"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/a32bc86da24495025d7aafd1ba62444d4a364a98",
"reference": "a32bc86da24495025d7aafd1ba62444d4a364a98",
"url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/f4b9407fa3203aebafd422ae8f0eb1ef94659a80",
"reference": "f4b9407fa3203aebafd422ae8f0eb1ef94659a80",
"shasum": ""
},
"require": {
@ -2291,9 +2287,9 @@
"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.3.9"
"source": "https://github.com/phpstan/phpstan-symfony/tree/1.3.12"
},
"time": "2024-03-16T16:50:20+00:00"
"time": "2024-04-14T13:30:23+00:00"
},
{
"name": "symfony/phpunit-bridge",

View File

@ -33,9 +33,13 @@ class GlobalCommand extends BaseCommand
{
$application = $this->getApplication();
if ($input->mustSuggestArgumentValuesFor('command-name')) {
$suggestions->suggestValues(array_values(array_filter(array_map(static function (Command $command) {
return $command->isHidden() ? null : $command->getName();
}, $application->all()))));
$suggestions->suggestValues(array_values(array_filter(
array_map(static function (Command $command) {
return $command->isHidden() ? null : $command->getName();
}, $application->all()), function (?string $cmd) {
return $cmd !== null;
}
)));
return;
}

View File

@ -87,7 +87,7 @@ EOT
$io = $this->getIO();
$allowlist = ['name', 'description', 'author', 'type', 'homepage', 'require', 'require-dev', 'stability', 'license', 'autoload'];
$options = array_filter(array_intersect_key($input->getOptions(), array_flip($allowlist)));
$options = array_filter(array_intersect_key($input->getOptions(), array_flip($allowlist)), function ($val) { return $val !== null && $val !== []; });
if (isset($options['name']) && !Preg::isMatch('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $options['name'])) {
throw new \InvalidArgumentException(

View File

@ -296,7 +296,9 @@ EOT
}
} while (true);
$packages = array_filter($packages);
$packages = array_filter($packages, function (string $pkg) {
return $pkg !== '';
});
if (!$packages) {
throw new \InvalidArgumentException('You must enter minimum one package.');
}

View File

@ -99,7 +99,9 @@ class ArchiveManager
$parts['source_reference'] = substr(sha1($sourceReference), 0, 6);
}
$parts = array_filter($parts);
$parts = array_filter($parts, function (?string $part) {
return $part !== null;
});
foreach ($parts as $key => $part) {
$parts[$key] = str_replace('/', '-', $part);
}

View File

@ -63,7 +63,9 @@ class ErrorHandler
}
return null;
}, array_slice(debug_backtrace(), 2))));
}, array_slice(debug_backtrace(), 2)), function (?string $line) {
return $line !== null;
}));
}
}

View File

@ -76,13 +76,18 @@ final class TlsHelper
if (isset($info['extensions']['subjectAltName'])) {
$subjectAltNames = Preg::split('{\s*,\s*}', $info['extensions']['subjectAltName']);
$subjectAltNames = array_filter(array_map(static function ($name): ?string {
if (0 === strpos($name, 'DNS:')) {
return strtolower(ltrim(substr($name, 4)));
}
$subjectAltNames = array_filter(
array_map(static function ($name): ?string {
if (0 === strpos($name, 'DNS:')) {
return strtolower(ltrim(substr($name, 4)));
}
return null;
}, $subjectAltNames));
return null;
}, $subjectAltNames),
function (?string $san) {
return $san !== null;
}
);
$subjectAltNames = array_values($subjectAltNames);
}

View File

@ -1237,7 +1237,7 @@ Linked Version => 1.2.11',
$expectedLibraries = array_keys(array_filter($expectations, static function ($expectation): bool {
return $expectation !== false;
}));
self::assertCount(count(array_filter($expectedLibraries)), $libraries, sprintf('Expected: %s, got %s', var_export($expectedLibraries, true), var_export($libraries, true)));
self::assertCount(count($expectedLibraries), $libraries, sprintf('Expected: %s, got %s', var_export($expectedLibraries, true), var_export($libraries, true)));
foreach ($extensions as $extension) {
$expectations['ext-'.$extension] = $extensionVersion;