diff --git a/composer.json b/composer.json index 3e7a908..8f2fa57 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "infection/infection": "^0.27.0", "patchlevel/coding-standard": "^1.3.0", "phpspec/prophecy-phpunit": "^2.1.0", - "phpstan/phpstan": "^1.10.48", + "phpstan/phpstan": "^2.1.0", "phpunit/phpunit": "^10.5.2", "psalm/plugin-symfony": "^5.2", "roave/security-advisories": "dev-master", diff --git a/composer.lock b/composer.lock index e93b3a5..a1070c0 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": "74ad5d89e85c9bfc4fd8707a2250f4d8", + "content-hash": "745f337a1cb373e428cc120adb30cfb9", "packages": [ { "name": "brick/math", @@ -5655,20 +5655,20 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.67", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493" + "reference": "2392d360fdf54ea253aa6c68cad1d4ba2e54e927" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493", - "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2392d360fdf54ea253aa6c68cad1d4ba2e54e927", + "reference": "2392d360fdf54ea253aa6c68cad1d4ba2e54e927", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -5709,7 +5709,7 @@ "type": "github" } ], - "time": "2024-04-16T07:22:02+00:00" + "time": "2024-12-31T07:30:03+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c8ab33a..fed6df4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,32 +1,56 @@ parameters: ignoreErrors: - - message: "#^Method Patchlevel\\\\EventSourcingAdminBundle\\\\Decorator\\\\RequestIdDecorator\\:\\:__invoke\\(\\) has parameter \\$message with generic class Patchlevel\\\\EventSourcing\\\\Message\\\\Message but does not specify its types\\: T$#" + message: '#^Method Patchlevel\\EventSourcingAdminBundle\\Decorator\\RequestIdDecorator\:\:__invoke\(\) has parameter \$message with generic class Patchlevel\\EventSourcing\\Message\\Message but does not specify its types\: T$#' + identifier: missingType.generics count: 1 path: src/Decorator/RequestIdDecorator.php - - message: "#^Method Patchlevel\\\\EventSourcingAdminBundle\\\\Decorator\\\\RequestIdDecorator\\:\\:__invoke\\(\\) return type with generic class Patchlevel\\\\EventSourcing\\\\Message\\\\Message does not specify its types\\: T$#" + message: '#^Method Patchlevel\\EventSourcingAdminBundle\\Decorator\\RequestIdDecorator\:\:__invoke\(\) return type with generic class Patchlevel\\EventSourcing\\Message\\Message does not specify its types\: T$#' + identifier: missingType.generics count: 1 path: src/Decorator/RequestIdDecorator.php - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#' + identifier: method.notFound count: 1 path: src/DependencyInjection/Configuration.php - - message: "#^Only iterables can be unpacked, mixed given\\.$#" + message: '#^Cannot call method defaultFalse\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Cannot call method end\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Cannot call method scalarNode\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Only iterables can be unpacked, mixed given\.$#' + identifier: arrayUnpacking.nonIterable count: 1 path: src/DependencyInjection/CustomMessageHeaderCompilerPass.php - - message: "#^Method Patchlevel\\\\EventSourcingAdminBundle\\\\Twig\\\\DumpExtension\\:\\:dump\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method Patchlevel\\EventSourcingAdminBundle\\Twig\\DumpExtension\:\:dump\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/Twig/DumpExtension.php - - message: "#^Cannot cast mixed to string\\.$#" + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string count: 1 path: src/Twig/InspectionExtension.php diff --git a/src/TokenMapper.php b/src/TokenMapper.php index fb11890..9c5bf9d 100644 --- a/src/TokenMapper.php +++ b/src/TokenMapper.php @@ -74,6 +74,7 @@ private function load(): array } while ($row = fgetcsv($file)) { + /** @var array{0: string, 1: string} $row */ $map[$row[0]] = $row[1]; }