Skip to content

[prophet-report] ExplicitDataFactory: False positive: EloquentModelUnpacker::from(Model): array is a custom domain … #10

@jessegall

Description

@jessegall

Reported automatically by a code-commandments agent.

Prophet ExplicitDataFactory
Location src/Workflow/Nodes/UnpackRegistry.php:256

What's wrong

False positive: EloquentModelUnpacker::from(Model): array is a custom domain Unpacker method (returns an array, NOT a Spatie Data class), so there is no magic object dispatch to make explicit. The prophet flags any ::from($object) call, but Unpacker::from is an unrelated contract method. Same for line 251 ($unpackerClass::from($instance)).

Flagged code

return Option::some(EloquentModelUnpacker::from($instance));

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