PHPStan 2.0

And update to PHP 8.1+
This commit is contained in:
Alexandre Alapetite 2025-01-11 14:00:47 +01:00
parent d6697d49c5
commit 6aa8814326
No known key found for this signature in database
GPG key ID: A24378C38E812B23
13 changed files with 297 additions and 284 deletions

View file

@ -29,7 +29,7 @@ try {
}
foreach ($repositories as $repository) {
if (null === $url = ($repository['url'] ?? null)) {
if (!is_array($repository) || !is_string($url = ($repository['url'] ?? null))) {
continue;
}
if (TYPE_GIT === ($repository['type'] ?? null)) {
@ -54,7 +54,7 @@ foreach ($gitRepositories as $key => $gitRepository) {
}
$directory = basename(dirname($metadataFile));
$metadata['url'] = $gitRepository;
$metadata['version'] = strval($metadata['version']);
$metadata['version'] = is_scalar($metadata['version'] ?? null) ? strval($metadata['version']) : '';
$metadata['method'] = TYPE_GIT;
$metadata['directory'] = ($directory === sha1($gitRepository)) ? '.' : $directory;
$extensions[] = $metadata;