Skip to content

Throw when createMany() is called from an instance #799

@nikophil

Description

@nikophil

This code should throw an exception:

SomeFactory::new()->createMany();

it was deprecated in Foundry 1.7, it is error prone (any state passed to new() will be ignored), and kinda hard to detect manually.

To detect if the call was made on an object, we can use debug_backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions