| Methods |
public
static
|
getRuleErrorTypes(): array<int, array{string, array<array{string, (string|null), string}>}>
|
#
|
public
static
|
message(string $message): self<RuleError>
|
#
|
public
|
line(int $line): self<T&LineRuleError>
|
#
|
public
|
file(string $file, ?string $fileDescription = null): self<T&FileRuleError>
|
#
|
public
|
fileDependency(string $file): self<T&FileDependenciesRuleError>
Declares that this error depends on the contents of another file, so that the result cache
re-analyses the file the error is reported in when that file appears, changes or is deleted.
The path must be absolute; it does not have to exist.
Declares that this error depends on the contents of another file, so that the result cache
re-analyses the file the error is reported in when that file appears, changes or is deleted.
The path must be absolute; it does not have to exist.
Deprecated
Call trackFileDependency() on the Scope instead (Scope&DependencyTracker) - it declares
the dependency whether the rule reports an error or not.
|
#
|
public
|
tip(string $tip): self<T&TipRuleError>
|
#
|
public
|
addTip(string $tip): self<T&TipRuleError>
|
#
|
public
|
discoveringSymbolsTip(): self<T&TipRuleError>
|
#
|
public
|
acceptsReasonsTip(list<string> $reasons): self<T&TipRuleError>
|
#
|
public
|
treatPhpDocTypesAsCertainTip(): self<T&TipRuleError>
|
#
|
public
|
possiblyImpureTip(list<string> $callDescriptions): self<T&TipRuleError>
|
#
|
public
|
identifier(string $identifier): self<T&IdentifierRuleError>
Sets an error identifier.
|
#
|
public
|
metadata(mixed[] $metadata): self<T&MetadataRuleError>
|
#
|
public
|
nonIgnorable(): self<T&NonIgnorableRuleError>
|
#
|
public
|
fixNode<TNode is Node>(
TNode $node,
callable(TNode): (Node|NodeVisitor::REMOVE_NODE) $cb,
string|null $file = null,
): self<T&FixableNodeRuleError>
Every call adds a change to the fix of the error. The changes are applied together or not at all.
Several changes of the same node are applied in the order they were added.
Every call adds a change to the fix of the error. The changes are applied together or not at all.
Several changes of the same node are applied in the order they were added.
Parameters
| $cb |
returning NodeVisitor::REMOVE_NODE works like removeNode()
|
| $file |
the file of the node when it is not the file of the error
|
|
#
|
public
|
removeNode(Node $node, string|null $file = null): self<T&FixableNodeRuleError>
Adds removing the node to the fix of the error, see fixNode(). Only a node in an array,
like a statement, an argument, or an array item, can be removed. Otherwise the error is not fixable.
Adds removing the node to the fix of the error, see fixNode(). Only a node in an array,
like a statement, an argument, or an array item, can be removed. Otherwise the error is not fixable.
Parameters
| $file |
the file of the node when it is not the file of the error
|
|
#
|
public
|
build(): T
|
#
|