Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nikophil opened this issue Jan 28, 2025 · 0 comments
Open

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

nikophil opened this issue Jan 28, 2025 · 0 comments
Labels
good first issue Good for newcomers

Comments

@nikophil
Copy link
Member

nikophil commented Jan 28, 2025

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

@nikophil nikophil added the good first issue Good for newcomers label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Development

No branches or pull requests

1 participant