Skip to content

[prophet-report] PreferTypeMethodOverInlineDispatch: False positive: this match($this) IS the type-method the rule asks for — toke… #11

@jessegall

Description

@jessegall

Reported automatically by a code-commandments agent.

Prophet PreferTypeMethodOverInlineDispatch
Location src/Pipeline/Execution/WireCategory.php:32

What's wrong

False positive: this match($this) IS the type-method the rule asks for — token() already lives ON WireCategory and dispatches on its own cases. The rule's prescribed fix ('give self a method, call $this->method()') is literally this code; a per-case enum method's body must be a match($this). There is no outer type to move behaviour onto.

Flagged code

return match ($this)

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