linkorb / haigha

Alice fixtures for database tables
MIT License
24 stars 8 forks source link

Symfony requirements #11

Closed Seldaek closed 4 months ago

Seldaek commented 4 years ago

Hey, thanks for the quick merge, but now I noticed I can't update to latest as it requires symfony4. Given the usage you make of console and dotenv, I'd imagine a require on both of these of "^3.4 || ^4.3 || ^5.0" would probably work (and includes only the still-maintained releases). I haven't checked, but unless you are aware of a reason not to do this, it'd be nice to relax the constraint a bit.

joostfaassen commented 4 years ago

You're right, that's better. How's this? https://github.com/linkorb/haigha/releases/tag/v2.8.0

Seldaek commented 4 years ago

It does install, but it fails hard now.. nelmio/alice v3 has no Nelmio\Alice\Instances\Instantiator\Methods\MethodInterface which is used by Haigha's TableRecordInstantiator. Have you tried this stuff at all since 2.7? :)

Seldaek commented 4 years ago

So yeah ideally what I am looking for I guess is a 2.8 release here but allowing nelmio/alice 2.x, because migrating to v3 seems impossible right now.

joostfaassen commented 4 years ago

Have you tried this stuff at all since 2.7? :)

not really! we've been using it as a global tool, instead of a project dependency. That might be a quick workaround for you too?

as for the proper solution: a switch to alice 3.x would probably be the best way forward, not sure what that'd entail though. Can give it a quick try in the upcoming days, but my time is very limited atm.

Seldaek commented 4 years ago

Had a quick chat with @theofidry who maintains alice now and it seems quite different.. Should be doable but will require some migration on the fixture side as alice v3 can only hydrate data into objects, you can't create your own instantiator anymore to generate arrays, so instead of table.foo it'd have to be stdClass or create a class TableFoo extends stdClass {} so you can do TableFoo in fixtures, then you get objects and can cast those to arrays and then persist as it used to do I guess..

joostfaassen commented 4 months ago

@Seldaek @theofidry we found it difficult to use Alice in a way that it probably wasn't meant for (i.e. for orm agnostic purposes) so we've deprecated Haigha in favor of https://github.com/linkorb/hatter - thanks for showing interest in Haigha, and I'm hoping Hatter will better serve your purposes.. it works well for us 😄