Reported automatically by a code-commandments agent.
|
|
| Prophet |
SuggestCompareSelfTraitProphet |
| Location |
src/Workflow/Graph/GraphValidator.php:266 |
What's wrong
Residual of the equals/instance fix (1.58.1): the VARIADIC helpers equalsAny/notEqualsAny still fail PHPStan. Both instance $kind->equalsAny(NodeType::Trigger, NodeType::Input) and static NodeType::equalsAny($x, A, B) report 'Parameter #2 ...$cases expects JesseGall\Workflows\Support\Enums\CompareSelf, NodeType::Input given'. The trait's @method ...$cases (typed self) resolves self to the CompareSelf trait rather than the using enum, so passing real enum cases is rejected. equals()/notEquals() were fixed but equalsAny()/notEqualsAny() have the same self-binding problem. Affects every multi-case comparison the prophet mandates (e.g. NodeType, MathOperator, WorkflowRunStatus).
Flagged code
if (! $descriptor->kind->equalsAny(NodeType::Trigger, NodeType::Input))
For the fixer
Decide whether this is a false positive (tighten/guard the prophet), a wrong rule (adjust the rule or its config), or correct-but-unclear (improve the message/scripture). Add a fixture from the flagged code above.
Reported automatically by a code-commandments agent.
SuggestCompareSelfTraitProphetsrc/Workflow/Graph/GraphValidator.php:266What's wrong
Residual of the equals/instance fix (1.58.1): the VARIADIC helpers equalsAny/notEqualsAny still fail PHPStan. Both instance
$kind->equalsAny(NodeType::Trigger, NodeType::Input)and staticNodeType::equalsAny($x, A, B)report 'Parameter #2 ...$cases expects JesseGall\Workflows\Support\Enums\CompareSelf, NodeType::Input given'. The trait's @method...$cases(typedself) resolvesselfto the CompareSelf trait rather than the using enum, so passing real enum cases is rejected. equals()/notEquals() were fixed but equalsAny()/notEqualsAny() have the same self-binding problem. Affects every multi-case comparison the prophet mandates (e.g. NodeType, MathOperator, WorkflowRunStatus).Flagged code
For the fixer
Decide whether this is a false positive (tighten/guard the prophet), a wrong rule (adjust the rule or its config), or correct-but-unclear (improve the message/scripture). Add a fixture from the flagged code above.