From 9af5bf68ebe9dc332b78435160bdda3b0abb2446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20=C5=A0panja?= Date: Wed, 21 Feb 2024 11:08:02 +0100 Subject: [PATCH] Simplify service override --- lib/Container/Compiler/FieldType/RichTextIndexablePass.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Container/Compiler/FieldType/RichTextIndexablePass.php b/lib/Container/Compiler/FieldType/RichTextIndexablePass.php index 26ff3054..b017af16 100644 --- a/lib/Container/Compiler/FieldType/RichTextIndexablePass.php +++ b/lib/Container/Compiler/FieldType/RichTextIndexablePass.php @@ -8,6 +8,7 @@ use Netgen\IbexaSearchExtra\Core\FieldType\RichText\Indexable as IndexableRichText; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Definition; class RichTextIndexablePass implements CompilerPassInterface { @@ -23,10 +24,8 @@ public function process(ContainerBuilder $container): void private function redefineIndexableImplementation(ContainerBuilder $container, $shortTextLimit): void { - $definition = $container->findDefinition(SearchField::class); - - $definition->setClass(IndexableRichText::class); - $definition->setArgument(0, $shortTextLimit); + $definition = new Definition(IndexableRichText::class); + $definition->addArgument($shortTextLimit); $definition->addTag('ibexa.field_type.indexable', ['alias' => 'ezrichtext']); $container->setDefinition(SearchField::class, $definition);