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.
| Methods | ||
|---|---|---|
public
|
trackValueDependency(
ClassReflection $classReflection,
class-string<ResultCacheValueExtension> $extensionClass,
string $key,
): void
|
# |
public
|
trackFileDependency(ClassReflection $classReflection, string $file): void
|
# |
public
|
trackDirectoryDependency(ClassReflection $classReflection, string $directory, string $pattern = '*'): void
|
# |
public
|
trackClassDependency(ClassReflection $classReflection, string $className): void
|
# |