diff --git a/composer.json b/composer.json index 921c28e..6e13fa4 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "require-dev": { "phpunit/phpunit": "^10.1", - "phpstan/phpstan": "^1.10", + "phpstan/phpstan": "^2.2", "phpmd/phpmd": "^2.15", "squizlabs/php_codesniffer": "^4.0" }, diff --git a/composer.lock b/composer.lock index 235ab5b..46c44ee 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": "fd58ffa879d9c60bd19c77f5a66992f5", + "content-hash": "340bb7e2d9652e2a8ff91070b5615665", "packages": [ { "name": "composer/semver", @@ -936,15 +936,15 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.33", + "version": "2.2.11", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/37982d6fc7cbb746dda7773530cda557cdf119e1", - "reference": "37982d6fc7cbb746dda7773530cda557cdf119e1", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0eb899d48d9b784eee3f1b58a6c9dc79734cf811", + "reference": "0eb899d48d9b784eee3f1b58a6c9dc79734cf811", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -963,6 +963,17 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Ondřej Mirtes" + }, + { + "name": "Markus Staab" + }, + { + "name": "Vincent Langlet" + } + ], "description": "PHPStan - PHP Static Analysis Tool", "keywords": [ "dev", @@ -985,7 +996,7 @@ "type": "github" } ], - "time": "2026-02-28T20:30:03+00:00" + "time": "2026-08-31T10:33:10+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/src/Build.php b/src/Build.php index df35b02..5999423 100644 --- a/src/Build.php +++ b/src/Build.php @@ -23,7 +23,7 @@ public function __construct( /** * For each task, ensure all requirements are met. * @param array|null $errors - * @SuppressWarnings(PHPMD.StaticAccess) + * @SuppressWarnings("PHPMD.StaticAccess") */ public function check(?array &$errors = null):int { $count = 0; diff --git a/src/BuildRunner.php b/src/BuildRunner.php index 63346aa..2e8f3ef 100644 --- a/src/BuildRunner.php +++ b/src/BuildRunner.php @@ -28,7 +28,7 @@ public function __construct(?string $path = null, ?Stream $stream = null) { $this->stream = $stream; } - /** @SuppressWarnings(PHPMD.ExitExpression) */ + /** @SuppressWarnings("PHPMD.ExitExpression") */ public function run( bool $continue = true, ?string $mode = null @@ -66,7 +66,7 @@ protected function formatWorkingDirectory():string { return rtrim($this->workingDirectory, "/\\"); } - /** @SuppressWarnings(PHPMD.ExitExpression) */ + /** @SuppressWarnings("PHPMD.ExitExpression") */ protected function getJsonPath(string $workingDirectory):string { $jsonPath = $this->resolveConfigPath($workingDirectory) ?? $this->resolveConfigPath($this->defaultPath); @@ -112,7 +112,7 @@ protected function resolveConfigPath(string $path):?string { } /** - * @SuppressWarnings(PHPMD.ExitExpression) + * @SuppressWarnings("PHPMD.ExitExpression") * @param array $errors */ protected function checkRequirements( @@ -134,7 +134,9 @@ protected function checkRequirements( exit(1); } - $build->check($errors); + $requirementErrors = $errors; + $build->check($requirementErrors); + $errors = $requirementErrors ?? []; return $build; } diff --git a/src/Requirement.php b/src/Requirement.php index 73d3b21..0f924a1 100644 --- a/src/Requirement.php +++ b/src/Requirement.php @@ -86,7 +86,7 @@ protected function getVersionFromVersionString(string $string):string { return $matches[1] ?? "0.0.0"; } - /** @SuppressWarnings(PHPMD.StaticAccess) */ + /** @SuppressWarnings("PHPMD.StaticAccess") */ protected function isVersionStringValid(string $versionInstalled):bool { if($this->version === "*") { return true; diff --git a/src/Task.php b/src/Task.php index 4398bfc..2faf101 100644 --- a/src/Task.php +++ b/src/Task.php @@ -22,7 +22,7 @@ class Task { protected array $fileHashList = []; /** - * @SuppressWarnings(PHPMD.StaticAccess) + * @SuppressWarnings("PHPMD.StaticAccess") */ public function __construct( TaskBlock $taskBlock, @@ -39,7 +39,7 @@ public function __construct( } public function __toString():string { - return $this->name ?? $this->execute->command; + return $this->name; } /** @param array|null $errors */ @@ -57,7 +57,7 @@ public function check(?array &$errors = null):void { } /** - * @SuppressWarnings(PHPMD.StaticAccess) + * @SuppressWarnings("PHPMD.StaticAccess") * @param array|null $errors */ public function build(?array &$errors = null):bool {