Skip to content

[prophet-report] SuggestCompareSelfTraitProphet: Residual of the equals/instance fix (1.58.1): the VARIADIC helpers equalsAny/… #8

Description

@jessegall

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions