Interface PHPStan\Collectors\CollectorWithPaths

<out TNodeType is Node, TValue>

extends Collector<TNodeType, TValue>

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.

  • PHPStan\Collectors\CollectorWithPaths extends Collector<TNodeType, TValue>
    • PHPStan\Rules\Comparison\ConstantConditionInTraitCollector implements CollectorWithPaths<never, array{class-string<Rule<out Node>>, trait-string, string, null}|array{class-string<Rule<out Node>>, trait-string, string, bool, (Error|array<mixed>)}>
    • PHPStan\Rules\Comparison\FunctionCallConstantConditionCollector implements CollectorWithPaths<never, array{class-string<Rule<out Node>>, (trait-string|null), string, null}|array{class-string<Rule<out Node>>, (trait-string|null), string, bool, (Error|array<mixed>)}>
Methods
Methods inherited from PHPStan\Collectors\Collector
getNodeType(), processNode()