doctrine-migrations icon indicating copy to clipboard operation
doctrine-migrations copied to clipboard

setService on DependencyFactory

Open haltuf opened this issue 7 months ago • 1 comments

For a rather unusual use case, I wanted to create my own comparator. So basically in index / bootstrap something like:

$service = $container->getByType(\Doctrine\Migrations\DependencyFactory::class);
$service->setService(\Doctrine\Migrations\Version\Comparator::class, new TimestampVersionComparator());

(the use case was: multiple namespaces of migrations; wanted the migration to run in the order derived from name of class, not from fully-qualified name including namespace...) e.g.

App\Migrations\Version20250414163315.php
App\CoreMigrations\Version20250414163728.php

instead of default behaviour of this package:

App\CoreMigrations\Version20250414163728.php
App\Migrations\Version20250414163315.php

Is there a way to set this via .neon config?

haltuf avatar Apr 14 '25 17:04 haltuf

At this time it's not possible in NEON, but I will implement it.

f3l1x avatar Apr 14 '25 17:04 f3l1x