Skip to content

Commit fa03931

Browse files
committed
Make DCD conditional on PHP 8.1+ to fix old PHP CI
Move DCD rules.neon include to ignore-by-php-version.neon.php so it only loads on PHP >= 8.1. Move inline @phpstan-ignore for BleedingEdgeToggle to neon config. Add reportUnmatched: false to all DCD-specific ignores. Co-Authored-By: Claude Code
1 parent 479b591 commit fa03931

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

build/ignore-by-php-version.neon.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
}
99
if (PHP_VERSION_ID >= 80100) {
1010
$includes[] = __DIR__ . '/baseline-8.1.neon';
11+
$includes[] = __DIR__ . '/../vendor/shipmonk/dead-code-detector/rules.neon';
1112
} else {
1213
$includes[] = __DIR__ . '/enums.neon';
1314
$includes[] = __DIR__ . '/readonly-property.neon';

build/phpstan.neon

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ includes:
44
- ../vendor/phpstan/phpstan-phpunit/extension.neon
55
- ../vendor/phpstan/phpstan-phpunit/rules.neon
66
- ../vendor/phpstan/phpstan-strict-rules/rules.neon
7-
- ../vendor/shipmonk/dead-code-detector/rules.neon
87
- ../conf/bleedingEdge.neon
98
- ../phpstan-baseline.neon
109
- ../phpstan-baseline.php
@@ -81,11 +80,17 @@ parameters:
8180
-
8281
identifier: shipmonk.deadMethod
8382
message: '#^Unused .*?Factory::create#' # likely used in DIC
83+
reportUnmatched: false
84+
-
85+
identifier: shipmonk.deadMethod
86+
message: '#^Unused PHPStan\\DependencyInjection\\BleedingEdgeToggle::isBleedingEdge#' # kept for future use
87+
reportUnmatched: false
8488
-
8589
identifier: shipmonk.deadMethod
8690
paths:
8791
- ../tests/PHPStan/Tests
8892
- ../tests/e2e
93+
reportUnmatched: false
8994
-
9095
identifier: shipmonk.deadConstant
9196
paths:
@@ -127,6 +132,7 @@ parameters:
127132
reportUnmatched: false
128133
-
129134
rawMessage: 'Property PHPStan\Command\CommandHelper::$reservedMemory is never read' # intentional
135+
reportUnmatched: false
130136
reportStaticMethodSignatures: true
131137
tmpDir: %rootDir%/tmp
132138
stubFiles:

src/DependencyInjection/BleedingEdgeToggle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ final class BleedingEdgeToggle
77

88
private static bool $bleedingEdge = false;
99

10-
public static function isBleedingEdge(): bool // @phpstan-ignore shipmonk.deadMethod (kept for future use)
10+
public static function isBleedingEdge(): bool
1111
{
1212
return self::$bleedingEdge;
1313
}

0 commit comments

Comments
 (0)