Search by

konradmichalik / phpstan-typo3-dead-code

konradmichalik

TYPO3 entry points for shipmonk/dead-code-detector: DI constructors, route targets and TypoScript userFunc

Package info

github.com/konradmichalik/phpstan-typo3-dead-code

Type:phpstan-extension

pkg:composer/konradmichalik/phpstan-typo3-dead-code

Statistics

Installs: 84

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

0.2.0 2026-11-25 10:28 UTC

This package is auto-updated.

Last update: 2026-11-25 10:30:08 UTC


README

icon

PHPStan TYPO3 dead code

Coverage CGL Tests Supported PHP Versions

TYPO3 entry points for shipmonk/dead-code-detector. The detector has no TYPO3 support, so it reports everything TYPO3 calls from configuration instead of PHP code. A route target such as FacetsModalController::configuration is only named in Configuration/Backend/AjaxRoutes.php, and the detector reports it as unused.

Warning

The 0.x versions are still in development. Options and behaviour may change between minor versions.

✨ Features

  • Configuration entry points: route targets, TCA callbacks, TypoScript userFunc, Services.yaml listener methods and factories, and DataHandler hooks count as used
  • Container and Extbase conventions: Extbase actions are not reported, and by default neither are constructors, inject* methods and initializeObject
  • Optional event and Fluid support: keep the public API of dispatched events and the members read in Fluid templates
  • Fully qualified matching: class names are resolved, so two classes with the same short name do not cover each other

🔥 Installation

Requirements

  • PHP 8.2, 8.3, 8.4, 8.5 or 8.6
  • PHPStan 2.1.41 or newer
  • shipmonk/dead-code-detector 1.4 (installed automatically as a dependency)
  • typo3/class-alias-loader 1.2.1 or newer, if installed. Older versions hide vendor/ from the detector, which then reports every override of a TYPO3 method as unused

Composer

Packagist Packagist Downloads

composer require --dev konradmichalik/phpstan-typo3-dead-code

🚀 Quick start

With phpstan/extension-installer the detector and the provider are included automatically. Point PHPStan at the extension's code and configuration:

# phpstan.neon

parameters:
  paths:
    - Classes
    - Configuration
    - ext_localconf.php
// Configuration/Backend/AjaxRoutes.php
'target' => FacetsModalController::class . '::configuration', // FacetsModalController::configuration counts as used

See Usage for the manual setup and for running PHPStan from a subdirectory such as Tests/CGL.

📚 Documentation

Topic What's inside
Usage Extension installer, manual setup, PHPStan started from a subdirectory, result cache
Entry points Everything the provider marks as used, and what it does not cover
Configuration Every option with its default and effect

🧑‍💻 Contributing

Please have a look at CONTRIBUTING.md.

⭐ License

This project is licensed under GNU General Public License 3.0 (or later).