Skip to content

Commit cb43901

Browse files
committed
Replace tomasvotruba/unused-public with shipmonk/dead-code-detector
1 parent 33926fa commit cb43901

3 files changed

Lines changed: 73 additions & 6 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151
"rector/jack": "^1.1",
5252
"rector/swiss-knife": "^2.6",
5353
"shipmonk/composer-dependency-analyser": "^1.8",
54+
"shipmonk/dead-code-detector": "^1.4",
5455
"symfony/process": "^8.1",
5556
"symplify/easy-coding-standard": "^13.2.13",
5657
"symplify/phpstan-rules": "^14.13",
5758
"tomasvotruba/class-leak": "^2.1",
5859
"tomasvotruba/fast-unit": "^0.1",
5960
"tomasvotruba/type-coverage": "^2.3.6",
60-
"tomasvotruba/unused-public": "^2.2",
6161
"tracy/tracy": "^2.12"
6262
},
6363
"replace": {

‎phpstan-baseline-dead-code.neon‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Unused Rector\\Php80\\Contract\\StrStartWithMatchAndRefactorInterface\:\:match$#'
5+
identifier: shipmonk.deadMethod
6+
count: 1
7+
path: rules/Php80/Contract/StrStartWithMatchAndRefactorInterface.php
8+
9+
-
10+
message: '#^Unused Rector\\Php80\\Contract\\StrStartWithMatchAndRefactorInterface\:\:refactorStrStartsWith$#'
11+
identifier: shipmonk.deadMethod
12+
count: 1
13+
path: rules/Php80/Contract/StrStartWithMatchAndRefactorInterface.php
14+
15+
-
16+
message: '#^Unused Rector\\BetterPhpDocParser\\Contract\\PhpDocParser\\PhpDocNodeDecoratorInterface\:\:decorate$#'
17+
identifier: shipmonk.deadMethod
18+
count: 1
19+
path: src/BetterPhpDocParser/Contract/PhpDocParser/PhpDocNodeDecoratorInterface.php
20+
21+
-
22+
message: '#^Unused Rector\\Parallel\\Contract\\SerializableInterface\:\:decode$#'
23+
identifier: shipmonk.deadMethod
24+
count: 1
25+
path: src/Parallel/Contract/SerializableInterface.php
26+
27+
-
28+
message: '#^Unused Rector\\PhpParser\\Printer\\BetterStandardPrinter\:\:pInterpolatedStringPart$#'
29+
identifier: shipmonk.deadMethod
30+
count: 1
31+
path: src/PhpParser/Printer/BetterStandardPrinter.php
32+
33+
-
34+
message: '#^Unused Rector\\PhpParser\\Printer\\BetterStandardPrinter\:\:pStmt_FileNode$#'
35+
identifier: shipmonk.deadMethod
36+
count: 1
37+
path: src/PhpParser/Printer/BetterStandardPrinter.php
38+
39+
-
40+
message: '#^Unused Rector\\Set\\Contract\\SetInterface\:\:getGroupName$#'
41+
identifier: shipmonk.deadMethod
42+
count: 1
43+
path: src/Set/Contract/SetInterface.php
44+
45+
-
46+
message: '#^Unused Rector\\Set\\Contract\\SetInterface\:\:getName$#'
47+
identifier: shipmonk.deadMethod
48+
count: 1
49+
path: src/Set/Contract/SetInterface.php
50+
51+
-
52+
message: '#^Unused Rector\\Set\\Contract\\SetInterface\:\:getSetFilePath$#'
53+
identifier: shipmonk.deadMethod
54+
count: 1
55+
path: src/Set/Contract/SetInterface.php
56+
57+
-
58+
message: '#^Property Rector\\Tests\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfoPrinter\\AbstractPhpDocInfoPrinterTestCase\:\:\$filePathHelper is never read$#'
59+
identifier: shipmonk.deadProperty.neverRead
60+
count: 1
61+
path: tests/BetterPhpDocParser/PhpDocInfo/PhpDocInfoPrinter/AbstractPhpDocInfoPrinterTestCase.php
62+
63+
-
64+
message: '#^Unused Rector\\Tests\\Caching\\ValueObject\\Storage\\FileCacheStorageTest\:\:provideConfigFilePath$#'
65+
identifier: shipmonk.deadMethod
66+
count: 1
67+
path: tests/Caching/ValueObject/Storage/FileCacheStorageTest.php

‎phpstan.neon‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
includes:
22
- vendor/symplify/phpstan-rules/config/rector-rules.neon
3+
- phpstan-baseline-dead-code.neon
34

45
rules:
56
- Rector\Utils\PHPStan\Rule\RegisterRelatedPolyfillRectorRule
@@ -58,11 +59,10 @@ parameters:
5859
narrow_param: true
5960
narrow_return: true
6061

61-
# see https://github.com/TomasVotruba/unused-public
62-
unused_public:
63-
methods: true
64-
properties: true
65-
constants: true
62+
# offload breaks cold-cache parallel runs, keep collector data in result cache
63+
shipmonkDeadCode:
64+
cache:
65+
offloadCollectorData: false
6666

6767
ignoreErrors:
6868
# keepComments() is a generic helper; do not narrow it after the deprecated CombineIfRector stopped calling it

0 commit comments

Comments
 (0)