Namespace PHPStan\Collectors

Classes
CollectedData
Interfaces
Collector

This is the interface custom collectors implement. To register it in the configuration file use the phpstan.collector service tag: ``` services: - class: App\MyCollector tags: - phpstan.collector

CollectorWithPaths

Implement this next to Collector when the collected data contains filesystem paths. The result cache stores paths relative to the install location so that it survives a change of the project's absolute path prefix - a fresh CI checkout directory, a git worktree. Collected data is opaque to the cache, so paths inside it can only be rewritten by the collector that produced it. Without this hook they stay absolute and make the cache non-portable. The method is static because the cache only ever holds the collector's class name (CollectedData::getCollectorType()), never an instance.