Interface PHPStan\Analyser\DeclarationDependencyTracker

DependencyTracker for extensions that get no Scope because they describe a class rather than analyse code - class reflection extensions adding magic methods and properties, for example. Inject it into the extension's constructor. What PHPStan learns about a class this way is remembered and reused by every file analysed after it, so it's the class that depends on what the extension read, not the file being analysed: each method declares the dependency of $classReflection. When it changes, every file depending on the class - referencing it, calling its methods, reading its properties - is analysed again.

  • PHPStan\Analyser\DeclarationDependencyTracker
    • PHPStan\Analyser\ValueDependencyDeclarationDependencyTracker implements DeclarationDependencyTracker
Methods