shipmonk/dead-code-detector
Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.
1.3.3
4.6M downloads/mo
#941 most downloaded on Packagist
shipmonk-rnd/dead-code-detector
What this package is like to depend on
Last release 17 days ago
06 Aug 2026
Release timing varies
gaps range from 8 days to 3 months
Rarely documented
notes for 10 of 47 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
47 releases · first in 2023
18 releases in the last 12 months
see the full history below
Release timeline
47 releases · Dec 2023 to Aug 2026Releases
latest 47-
1.3.306 Aug 2026Release notes
Open source →Fixes:
- Symfony: fix crash on
#[Assert\Callback]with closure callback (PHP 8.5) #405
- Symfony: fix crash on
-
1.3.215 Jul 2026 -
1.3.108 Jul 2026Release notes
Open source →Improvements:
- Generic:
- Detect class constants referenced in PhpDocs (#393)
- Laravel:
- Detect notification methods (#386, @lorenzolosa)
afterSending/shouldSend, plus queueable hooks (viaConnections,viaQueues,withDelay,withMessageGroups,messageGroup,deduplicationId,withDeduplicators) onShouldQueuenotifications
- Detect reportable/renderable exception methods (#387, @lorenzolosa)
context()/render()/report()on anyThrowable
- Support for real-time facades (#395, @lorenzolosa)
\Facades\App\SomeClass::someMethod()marks the underlying\App\SomeClass::someMethod()as used
- Detect notification methods (#386, @lorenzolosa)
- Performance
- Free the usage graph after emitting errors (#392, @ondrejmirtes)
- Generic:
-
1.3.030 Jun 2026Release notes
Open source →New features:
- PHPat support (#381)
test*/#[TestRule]public methods registered underphpat.testtag in PHPStan DIC
Fixes:
- PHPat support (#381)
-
1.2.112 Jun 2026Release notes
Open source →Fixes:
- Fix crash on array callable with unknown part, since PHPStan 2.1.54 (#373, @alfredbez)
-
1.2.002 Jun 2026Release notes
Open source →New features:
- Nette: support constructor calls of DIC services (#369, @spaze)
- requires
neon/neonto be installed - enable via:
- requires
parameters: shipmonkDeadCode: usageProviders: nette: containerNeonPaths: - app/config/services.neon
Improvements:
- Symfony: expose public members of
#[AsTwigComponent]classes to templates (#366) - Laravel: add missing
FormRequestmethods (#370, @JeftaAtSiip)
- Nette: support constructor calls of DIC services (#369, @spaze)
-
1.1.318 May 2026 -
1.1.211 May 2026 -
1.1.104 May 2026 -
1.1.017 Apr 2026Release notes
Open source →New features:
- Laravel: Blade view data support (#333)
- Marks public members of objects passed to views via
view(),View::make()/first(),response()->view(),->with()as used - View composers/creators via
View::composer()/View::creator(), including'Class@method'syntax
- Marks public members of objects passed to views via
- Symfony forms
data_classmapping (#334)- Marks accessor methods (
get*/set*/is*/has*/can*/add*/remove*), public properties, and__constructon data classes as used - Detects
data_classfromOptionsResolver,AbstractController::createForm(),FormFactoryInterface::create()and related methods
- Marks accessor methods (
- Detect property reads via native operations (#332)
(array)cast,get_object_vars(),get_mangled_object_vars(),json_encode(),serialize()- Respects
JsonSerializable,__serialize(),Serializable
Improvements:
- Symfony:
- Resolve string tags in
#[AutowireIterator]/#[AutowireLocator]via DIC XML (#336)- String tags (e.g.
'app.handler') are now mapped to concrete classes, fixing false positives ondefaultIndexMethod/defaultPriorityMethod shipmonkDeadCode.usageProviders.symfony.containerXmlPathsmust be set up
- String tags (e.g.
- Support
#[AsTwigComponent(template: new FromMethod(...))](#341) - Symfony: support
#[MapInput]in console commands (#340) - Mark enum cases as used in invokable command parameters (#343)
- Resolve string tags in
- Doctrine:
- PHPUnit:
- Add cross-class
@dataProviderannotation recognition (#338)
- Add cross-class
- Laravel: Blade view data support (#333)
-
1.0.008 Apr 2026Nothing published for this version
-
0.15.106 Mar 2026Nothing published for this version
-
0.15.004 Mar 2026Nothing published for this version
-
0.14.118 Dec 2025Nothing published for this version
-
0.14.025 Nov 2025Nothing published for this version
-
0.13.513 Oct 2025Nothing published for this version
-
0.13.409 Oct 2025Nothing published for this version
-
0.13.301 Sep 2025Nothing published for this version
-
0.13.214 Aug 2025Nothing published for this version
-
0.13.104 Aug 2025Nothing published for this version
-
0.13.021 Jul 2025Nothing published for this version
-
0.12.426 Jun 2025Nothing published for this version
-
0.12.311 Jun 2025Nothing published for this version
-
0.12.222 May 2025Nothing published for this version
-
0.12.120 May 2025Nothing published for this version
-
0.12.016 May 2025Nothing published for this version
-
0.11.115 May 2025Nothing published for this version
-
0.11.004 Apr 2025Nothing published for this version
-
0.10.228 Mar 2025Nothing published for this version
-
0.10.125 Mar 2025Nothing published for this version
-
0.10.021 Mar 2025Nothing published for this version
-
0.9.207 Mar 2025Nothing published for this version
-
0.9.105 Mar 2025Nothing published for this version
-
0.9.004 Mar 2025Nothing published for this version
-
0.8.122 Jan 2025Nothing published for this version
-
0.8.021 Jan 2025Nothing published for this version
-
0.7.023 Dec 2024Nothing published for this version
-
0.6.011 Nov 2024Nothing published for this version
-
0.5.105 Nov 2024Nothing published for this version
-
0.5.004 Nov 2024Nothing published for this version
-
0.4.024 Oct 2024Nothing published for this version
-
0.3.013 Sep 2024Nothing published for this version
-
0.2.105 Sep 2024Nothing published for this version
-
0.2.004 Sep 2024Nothing published for this version
-
0.1.215 Jul 2024Nothing published for this version
-
0.1.105 Jul 2024Nothing published for this version
-
0.1.028 Dec 2023Nothing published for this version