diff --git a/build/ignore-by-php-version.neon.php b/build/ignore-by-php-version.neon.php index caf93ca5b49..b6f92dfaae7 100644 --- a/build/ignore-by-php-version.neon.php +++ b/build/ignore-by-php-version.neon.php @@ -8,6 +8,7 @@ } if (PHP_VERSION_ID >= 80100) { $includes[] = __DIR__ . '/baseline-8.1.neon'; + $includes[] = __DIR__ . '/../vendor/shipmonk/dead-code-detector/rules.neon'; } else { $includes[] = __DIR__ . '/enums.neon'; $includes[] = __DIR__ . '/readonly-property.neon'; diff --git a/build/phpstan.neon b/build/phpstan.neon index 526f68798d2..274ec025011 100644 --- a/build/phpstan.neon +++ b/build/phpstan.neon @@ -4,7 +4,6 @@ includes: - ../vendor/phpstan/phpstan-phpunit/extension.neon - ../vendor/phpstan/phpstan-phpunit/rules.neon - ../vendor/phpstan/phpstan-strict-rules/rules.neon - - ../vendor/shipmonk/dead-code-detector/rules.neon - ../conf/bleedingEdge.neon - ../phpstan-baseline.neon - ../phpstan-baseline.php @@ -81,16 +80,27 @@ parameters: - identifier: shipmonk.deadMethod message: '#^Unused .*?Factory::create#' # likely used in DIC + reportUnmatched: false + - + identifier: shipmonk.deadMethod + message: '#^Unused PHPStan\\DependencyInjection\\BleedingEdgeToggle::isBleedingEdge#' # kept for future use + reportUnmatched: false - identifier: shipmonk.deadMethod paths: - ../tests/PHPStan/Tests - ../tests/e2e + reportUnmatched: false - identifier: shipmonk.deadConstant paths: - ../tests/PHPStan/Fixture reportUnmatched: false # constants on enums, not reported on PHP8- + - + identifier: shipmonk.deadEnumCase + paths: + - ../tests/PHPStan/Fixture + reportUnmatched: false # enum cases, not reported on PHP8- - message: ''' #^Access to constant on deprecated class DeprecatedAnnotations\\DeprecatedFoo\: @@ -120,6 +130,9 @@ parameters: identifier: shipmonk.deadMethod path: ../src/Internal/CombinationsHelper.php reportUnmatched: false + - + rawMessage: 'Property PHPStan\Command\CommandHelper::$reservedMemory is never read' # intentional + reportUnmatched: false reportStaticMethodSignatures: true tmpDir: %rootDir%/tmp stubFiles: diff --git a/composer.json b/composer.json index 7eb3aaa2d15..f03530eb81d 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,7 @@ "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^11.5.23", "shipmonk/composer-dependency-analyser": "^1.5", - "shipmonk/dead-code-detector": "^0.14.0", + "shipmonk/dead-code-detector": "^1.0.0", "shipmonk/name-collision-detector": "^2.0" }, "config": { diff --git a/composer.lock b/composer.lock index 16fe92f89ec..61f50d6b001 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": "0a496633f7bb3da8bde05678bc1262b3", + "content-hash": "ea8405e631700cf88d7327911ea0f9d2", "packages": [ { "name": "clue/ndjson-react", @@ -6702,50 +6702,57 @@ }, { "name": "shipmonk/dead-code-detector", - "version": "0.14.1", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/shipmonk-rnd/dead-code-detector.git", - "reference": "4fdc912b25b1e169041f534a517126a1090bb2f4" + "reference": "dd909a6e267ae03837f166bc5e9d2f0851b14ff0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/shipmonk-rnd/dead-code-detector/zipball/4fdc912b25b1e169041f534a517126a1090bb2f4", - "reference": "4fdc912b25b1e169041f534a517126a1090bb2f4", + "url": "https://api.github.com/repos/shipmonk-rnd/dead-code-detector/zipball/dd909a6e267ae03837f166bc5e9d2f0851b14ff0", + "reference": "dd909a6e267ae03837f166bc5e9d2f0851b14ff0", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.1.23" + "php": "^8.1", + "phpstan/phpstan": "^2.1.41" }, "require-dev": { + "behat/behat": "^3.14", "composer-runtime-api": "^2.0", "composer/semver": "^3.4", "doctrine/orm": "^2.19 || ^3.0", - "editorconfig-checker/editorconfig-checker": "^10.6.0", + "editorconfig-checker/editorconfig-checker": "^10.7.0", "ergebnis/composer-normalize": "^2.48.1", + "laravel/framework": "^10.0 || ^11.0 || ^12.0", "nette/application": "^3.1", "nette/component-model": "^3.0", + "nette/tester": "^2.4", "nette/utils": "^3.0 || ^4.0", "nikic/php-parser": "^5.4.0", "phpbench/phpbench": "^1.2", - "phpstan/phpstan-phpunit": "^2.0.4", - "phpstan/phpstan-strict-rules": "^2.0.3", - "phpstan/phpstan-symfony": "^2.0.2", - "phpunit/phpcov": "^8.2", - "phpunit/phpunit": "^9.6.22", - "shipmonk/coding-standard": "^0.2.0", - "shipmonk/composer-dependency-analyser": "^1.8.2", - "shipmonk/coverage-guard": "^1.0.0", + "phpstan/phpstan-phpunit": "^2.0.16", + "phpstan/phpstan-strict-rules": "^2.0.10", + "phpstan/phpstan-symfony": "^2.0.15", + "phpunit/phpcov": "^9.0.2", + "phpunit/phpunit": "^10.5.46", + "shipmonk/coding-standard": "^0.2.2", + "shipmonk/composer-dependency-analyser": "^1.8.4", + "shipmonk/coverage-guard": "^1.0.2", "shipmonk/name-collision-detector": "^2.1.1", - "shipmonk/phpstan-dev": "^0.1.1", - "shipmonk/phpstan-rules": "^4.1.0", + "shipmonk/phpstan-dev": "^0.1.6", + "shipmonk/phpstan-rules": "^4.3.6", "symfony/contracts": "^2.5 || ^3.0 || ^4.0", "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0 || ^8.0", "symfony/doctrine-bridge": "^5.4 || ^6.0 || ^7.0 || ^8.0", "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0", "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0", "symfony/routing": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/scheduler": "^6.3 || ^7.0 || ^8.0", + "symfony/ux-live-component": "^2.34", + "symfony/ux-twig-component": "^2.34", "symfony/validator": "^5.4 || ^6.0 || ^7.0 || ^8.0", "twig/twig": "^3.0" }, @@ -6775,9 +6782,9 @@ ], "support": { "issues": "https://github.com/shipmonk-rnd/dead-code-detector/issues", - "source": "https://github.com/shipmonk-rnd/dead-code-detector/tree/0.14.1" + "source": "https://github.com/shipmonk-rnd/dead-code-detector/tree/1.0.0" }, - "time": "2025-12-18T11:03:53+00:00" + "time": "2026-04-08T10:39:05+00:00" }, { "name": "shipmonk/name-collision-detector", diff --git a/src/DependencyInjection/BleedingEdgeToggle.php b/src/DependencyInjection/BleedingEdgeToggle.php index 98e9a52d41f..29170f7fe9a 100644 --- a/src/DependencyInjection/BleedingEdgeToggle.php +++ b/src/DependencyInjection/BleedingEdgeToggle.php @@ -7,7 +7,7 @@ final class BleedingEdgeToggle private static bool $bleedingEdge = false; - public static function isBleedingEdge(): bool // @phpstan-ignore shipmonk.deadMethod (kept for future use) + public static function isBleedingEdge(): bool { return self::$bleedingEdge; } diff --git a/src/Internal/DirectoryCreatorException.php b/src/Internal/DirectoryCreatorException.php index bafff9ab7ef..a762220f348 100644 --- a/src/Internal/DirectoryCreatorException.php +++ b/src/Internal/DirectoryCreatorException.php @@ -10,7 +10,7 @@ final class DirectoryCreatorException extends Exception { - public function __construct(public readonly string $directory) + public function __construct(string $directory) { $error = error_get_last();