Skip to content

Commit de29265

Browse files
janedbalondrejmirtes
authored andcommitted
Install & configure shipmonk/dead-code-detector
1 parent a5f7c06 commit de29265

File tree

3 files changed

+90
-2
lines changed

3 files changed

+90
-2
lines changed

build/phpstan.neon

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ 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
78
- ../conf/bleedingEdge.neon
89
- ../phpstan-baseline.neon
910
- ../phpstan-baseline.php
@@ -20,6 +21,10 @@ parameters:
2021
- ../tests/phpstan-bootstrap.php
2122
cache:
2223
nodesByStringCountMax: 128
24+
shipmonkDeadCode:
25+
usageExcluders:
26+
tests:
27+
enabled: true
2328
checkUninitializedProperties: true
2429
checkMissingCallableSignature: true
2530
excludePaths:
@@ -71,6 +76,12 @@ parameters:
7176
- '#should be contravariant with parameter \$node \(PhpParser\\Node\) of method PHPStan\\Rules\\Rule<PhpParser\\Node>::processNode\(\)$#'
7277
- '#Variable property access on PhpParser\\Node#'
7378
- '#Test::data[a-zA-Z0-9_]+\(\) return type has no value type specified in iterable type#'
79+
-
80+
identifier: shipmonk.deadMethod
81+
message: '#^Unused .*?Factory::create#' # likely used in DIC
82+
-
83+
identifier: shipmonk.deadMethod
84+
path: ../src/Reflection/BetterReflection/SourceLocator/FileReadTrapStreamWrapper.php
7485
-
7586
message: '#Fetching class constant class of deprecated class DeprecatedAnnotations\\DeprecatedFoo.#'
7687
path: ../tests/PHPStan/Reflection/Annotations/DeprecatedAnnotationsTest.php

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"phpstan/phpstan-strict-rules": "^2.0",
6363
"phpunit/phpunit": "^9.6",
6464
"shipmonk/composer-dependency-analyser": "^1.5",
65+
"shipmonk/dead-code-detector": "dev-api-phpdoc",
6566
"shipmonk/name-collision-detector": "^2.0"
6667
},
6768
"config": {

composer.lock

Lines changed: 78 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)