From 75dfcaffb880de0102c5a5239be4553a70412e21 Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Tue, 19 Dec 2023 14:56:19 +0200 Subject: [PATCH] Move tokenizer listeners to init method --- src/Bootloader/AnnotatedBootloader.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Bootloader/AnnotatedBootloader.php b/src/Bootloader/AnnotatedBootloader.php index 1fad6ae..f22d332 100644 --- a/src/Bootloader/AnnotatedBootloader.php +++ b/src/Bootloader/AnnotatedBootloader.php @@ -33,22 +33,20 @@ final class AnnotatedBootloader extends Bootloader ListenerEmbeddingsLocator::class => ListenerEmbeddingsLocator::class, ]; - public function init(SchemaBootloader $schema): void - { - $schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\Embeddings::class); - $schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\Entities::class); - $schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\TableInheritance::class); - $schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\MergeColumns::class); - $schema->addGenerator(SchemaBootloader::GROUP_RENDER, Annotated\MergeIndexes::class); - } - - public function boot( + public function init( + SchemaBootloader $schema, TokenizerListenerBootloader $tokenizer, ListenerEntityLocator $entityLocator, ListenerEmbeddingsLocator $embeddingsLocator ): void { $tokenizer->addListener($entityLocator); $tokenizer->addListener($embeddingsLocator); + + $schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\Embeddings::class); + $schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\Entities::class); + $schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\TableInheritance::class); + $schema->addGenerator(SchemaBootloader::GROUP_INDEX, Annotated\MergeColumns::class); + $schema->addGenerator(SchemaBootloader::GROUP_RENDER, Annotated\MergeIndexes::class); } private function initEmbeddings(