Skip to content

Commit

Permalink
Simplify service override
Browse files Browse the repository at this point in the history
  • Loading branch information
pspanja committed Feb 21, 2024
1 parent a2d3940 commit 9af5bf6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Container/Compiler/FieldType/RichTextIndexablePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
Expand Down

0 comments on commit 9af5bf6

Please sign in to comment.