|
126 | 126 | use Patchlevel\EventSourcingBundle\DataCollector\MessageCollectorEventBus; |
127 | 127 | use Patchlevel\EventSourcingBundle\Doctrine\DbalConnectionFactory; |
128 | 128 | use Patchlevel\EventSourcingBundle\EventBus\SymfonyEventBus; |
| 129 | +use Patchlevel\EventSourcingBundle\Normalizer\SymfonyGuesser; |
129 | 130 | use Patchlevel\EventSourcingBundle\QueryBus\SymfonyQueryBus; |
130 | 131 | use Patchlevel\EventSourcingBundle\RequestListener\AutoSetupListener; |
131 | 132 | use Patchlevel\EventSourcingBundle\RequestListener\SubscriptionRebuildAfterFileChangeListener; |
|
140 | 141 | use Patchlevel\Hydrator\Cryptography\PayloadCryptographer; |
141 | 142 | use Patchlevel\Hydrator\Cryptography\PersonalDataPayloadCryptographer; |
142 | 143 | use Patchlevel\Hydrator\Cryptography\Store\CipherKeyStore; |
| 144 | +use Patchlevel\Hydrator\Guesser\BuiltInGuesser; |
| 145 | +use Patchlevel\Hydrator\Guesser\ChainGuesser; |
| 146 | +use Patchlevel\Hydrator\Guesser\Guesser; |
143 | 147 | use Patchlevel\Hydrator\Hydrator; |
144 | 148 | use Patchlevel\Hydrator\Metadata\AttributeMetadataFactory; |
145 | 149 | use Patchlevel\Hydrator\Metadata\MetadataFactory; |
@@ -463,7 +467,10 @@ static function (ChildDefinition $definition): void { |
463 | 467 | continue; |
464 | 468 | } |
465 | 469 |
|
466 | | - throw new InvalidArgumentException(sprintf('Unknown retry strategy type "%s"', $strategyConfig['type'])); |
| 470 | + throw new InvalidArgumentException(sprintf( |
| 471 | + 'Unknown retry strategy type "%s"', |
| 472 | + $strategyConfig['type'], |
| 473 | + )); |
467 | 474 | } |
468 | 475 | } |
469 | 476 |
|
@@ -617,7 +624,24 @@ static function (ChildDefinition $definition): void { |
617 | 624 |
|
618 | 625 | private function configureHydrator(ContainerBuilder $container): void |
619 | 626 | { |
620 | | - $container->register(AttributeMetadataFactory::class); |
| 627 | + $container->register(ChainGuesser::class) |
| 628 | + ->setArguments([new TaggedIteratorArgument('event_sourcing.hydrator.guesser')]); |
| 629 | + |
| 630 | + $container->register(BuiltInGuesser::class) |
| 631 | + ->addTag('event_sourcing.hydrator.guesser', ['priority' => -100]); |
| 632 | + |
| 633 | + $container->register(SymfonyGuesser::class) |
| 634 | + ->addTag('event_sourcing.hydrator.guesser', ['priority' => -50]); |
| 635 | + |
| 636 | + $container->registerForAutoconfiguration(Guesser::class) |
| 637 | + ->addTag('event_sourcing.hydrator.guesser'); |
| 638 | + |
| 639 | + $container->register(AttributeMetadataFactory::class) |
| 640 | + ->setArguments([ |
| 641 | + null, |
| 642 | + new Reference(ChainGuesser::class), |
| 643 | + ]); |
| 644 | + |
621 | 645 | $container->setAlias(MetadataFactory::class, AttributeMetadataFactory::class); |
622 | 646 |
|
623 | 647 | $container->register(MetadataHydrator::class) |
|
0 commit comments