Skip to content

Commit

Permalink
Increase Symfony version in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 16, 2024
1 parent b52ea5d commit 8dd144c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ jobs:
job-name-prefix: 'Allow to fail: '
elasticsearch-version: '7.11.1'
lint: true
symfony-version: '^6.0'
symfony-version: '^7.0'
elasticsearch-package-constraint: '^7.0'
env: {}

- php-version: '8.3'
job-name-prefix: 'Allow to fail: '
elasticsearch-version: '7.11.1'
lint: true
symfony-version: '^6.0'
symfony-version: '^7.0'
elasticsearch-package-constraint: '^7.0'
env: {}

- php-version: '8.4'
job-name-prefix: 'Allow to fail: '
elasticsearch-version: '7.11.1'
lint: true
symfony-version: '^6.0'
symfony-version: '^7.0'
elasticsearch-package-constraint: '^7.0'
env: {}

Expand Down
25 changes: 25 additions & 0 deletions DependencyInjection/Compiler/AnnotationReaderPass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace ONGR\ElasticsearchBundle\DependencyInjection\Compiler;

use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

/**
* @internal
*/
class AnnotationReaderPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if ($container->hasDefinition('es.annotation_reader')) {
return;
}

$definition = new Definition(AnnotationReader::class);
$definition->addMethodCall('addGlobalIgnoredName', ['required']);
$container->setDefinition('es.annotation_reader', $definition);
}
}
2 changes: 2 additions & 0 deletions ONGRElasticsearchBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace ONGR\ElasticsearchBundle;

use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\AnnotationReaderPass;
use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\ManagerPass;
use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\MappingPass;
use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\RepositoryPass;
Expand All @@ -32,6 +33,7 @@ public function build(ContainerBuilder $container)

$container->addCompilerPass(new MappingPass());
$container->addCompilerPass(new ManagerPass());
$container->addCompilerPass(new AnnotationReaderPass());
// The `RepositoryPass` need to be behind the Symfony `DecoratorServicePass`
// to allow decorating the annotation reader
$container->addCompilerPass(new RepositoryPass(), PassConfig::TYPE_OPTIMIZE, -10);
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
es.annotations.cached_reader:
class: 'Doctrine\Common\Annotations\CachedReader'
public: true
arguments: ["@annotations.reader", "@es.cache_engine", "%kernel.debug%"]
arguments: ["@es.annotations.reader", "@es.cache_engine", "%kernel.debug%"]

es.document_finder:
class: 'ONGR\ElasticsearchBundle\Mapping\DocumentFinder'
Expand Down

0 comments on commit 8dd144c

Please sign in to comment.