| Methods |
abstract
protected
|
getRule(): TRule
|
#
|
protected
|
getCollectors(): array<Collector<Node, mixed>>
|
#
|
protected
|
getReadWritePropertiesExtensions(): ReadWritePropertiesExtension[]
No longer configures the analysis - register the extensions as services
in a config file returned from getAdditionalConfigFiles() instead.
Returning any extension fails the test.
No longer configures the analysis - register the extensions as services
in a config file returned from getAdditionalConfigFiles() instead.
Returning any extension fails the test.
|
#
|
protected
|
getTypeSpecifier(): TypeSpecifier
|
#
|
protected
|
createNodeScopeResolver(): NodeScopeResolver
|
#
|
public
|
analyse(string[] $files, list<array{0: string, 1: int, 2?: (string|null)}> $expectedErrors): void
|
#
|
public
|
fix(string $file, string $expectedFile): void
Like phpstan analyse --fix, the fixed code is analysed again until nothing is left to fix,
so fixes that overlap with other fixes and fixes of errors caused by other fixes are applied too.
A fix that is fixable again fails the test, it would not finish with --fix either.
Like phpstan analyse --fix, the fixed code is analysed again until nothing is left to fix,
so fixes that overlap with other fixes and fixes of errors caused by other fixes are applied too.
A fix that is fixable again fails the test, it would not finish with --fix either.
|
#
|
public
|
fixOtherFile(string $file, string $fixedFile, string $expectedFile): void
Analyses $file and $fixedFile together and asserts the fixes of $fixedFile,
like a trait file or a file the rule points to with RuleErrorBuilder::file().
Analyses $file and $fixedFile together and asserts the fixes of $fixedFile,
like a trait file or a file the rule points to with RuleErrorBuilder::file().
Fixes in rounds like fix(). Later rounds analyse copies of the files in a temporary directory,
so they do not fix traits, which are always read from their original file.
|
#
|
public
|
gatherAnalyserErrors(string[] $files): list<Error>
|
#
|
protected
|
shouldPolluteScopeWithLoopInitialAssignments(): bool
No longer configures the analysis - set the polluteScopeWithLoopInitialAssignments
parameter in a config file returned from getAdditionalConfigFiles() instead.
Returning a different value than the parameter fails the test.
No longer configures the analysis - set the polluteScopeWithLoopInitialAssignments
parameter in a config file returned from getAdditionalConfigFiles() instead.
Returning a different value than the parameter fails the test.
|
#
|
protected
|
shouldPolluteScopeWithAlwaysIterableForeach(): bool
No longer configures the analysis - set the polluteScopeWithAlwaysIterableForeach
parameter in a config file returned from getAdditionalConfigFiles() instead.
Returning a different value than the parameter fails the test.
No longer configures the analysis - set the polluteScopeWithAlwaysIterableForeach
parameter in a config file returned from getAdditionalConfigFiles() instead.
Returning a different value than the parameter fails the test.
|
#
|
protected
|
shouldFailOnPhpErrors(): bool
|
#
|
public
static
|
getAdditionalConfigFiles(): array
|
#
|