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

2.x checklist #516

Open
1 of 6 tasks
kbond opened this issue Nov 7, 2023 · 2 comments
Open
1 of 6 tasks

2.x checklist #516

kbond opened this issue Nov 7, 2023 · 2 comments

Comments

@kbond
Copy link
Member

kbond commented Nov 7, 2023

(to be moved to 2.x PR)

  • remove deprecated code
  • migrate remaining features from foundry-next
  • deprecate Zenstruck\Foundry\anonymous() in favor of Zenstruck\Foundry\factory()
  • split packages? (foundry-persistence, foundry-orm, foundry-mongo)
  • remove requirement/need for zenstruck/callback
  • Attributes can be a callable that accepts an int (marking the current # being created when creating a collection)
@nikophil
Copy link
Member

nikophil commented Dec 21, 2023

Static analysis

  • I think we have a complex SCA problem:
// SomeObjectFactory extends PersistentProxyObjectFactory
return $this->instantiateWith(
    static fn () => new SomeObject()
)

this code results in this error (I've replaced the full object FQCN by T for better readability)

Parameter #1 $instantiator of method Zenstruck\Foundry\ObjectFactory<T&Zenstruck\Foundry\Persistence\Proxy>::instantiateWith()
expects (callable(array<string, mixed>, class-string<T&Zenstruck\Foundry\Persistence\Proxy>): (T&Zenstruck\Foundry\Persistence\Proxy))|Zenstruck\Foundry\Object\Instantiator,
Closure(): T given.

=> phpstan wants a closure which returns a T&Proxy<T> because the factory is a "persistence with proxy", and the template type is T&Proxy<T>. I think this is a blocker

@nikophil nikophil mentioned this issue May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants