Skip to content

Commit 095a3a4

Browse files
Allow Symfony 7 versions (#37)
1 parent ab0f1ad commit 095a3a4

22 files changed

+113
-49
lines changed

.github/workflows/test-application.yaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,30 @@ jobs:
7070
elasticsearch-package-constraint: '^7.0'
7171
env: {}
7272

73+
- php-version: '8.2'
74+
job-name-prefix: 'Allow to fail: '
75+
elasticsearch-version: '7.11.1'
76+
lint: true
77+
symfony-version: '^7.0'
78+
elasticsearch-package-constraint: '^7.0'
79+
env: {}
80+
81+
- php-version: '8.3'
82+
job-name-prefix: 'Allow to fail: '
83+
elasticsearch-version: '7.11.1'
84+
lint: true
85+
symfony-version: '^7.0'
86+
elasticsearch-package-constraint: '^7.0'
87+
env: {}
88+
89+
- php-version: '8.4'
90+
job-name-prefix: 'Allow to fail: '
91+
elasticsearch-version: '7.11.1'
92+
lint: true
93+
symfony-version: '^7.0'
94+
elasticsearch-package-constraint: '^7.0'
95+
env: {}
96+
7397
services:
7498
elasticsearch:
7599
image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch-version }}
@@ -107,9 +131,12 @@ jobs:
107131
- name: Install dependencies
108132
run: |
109133
composer validate
110-
composer require --no-update symfony/symfony:${{ matrix.symfony-version }}
134+
composer require --no-update symfony/flex:"^1.0 || ^2.0"
135+
composer config --no-plugins allow-plugins.symfony/flex true
111136
composer require --no-update elasticsearch/elasticsearch:${{ matrix.elasticsearch-package-constraint }}
112-
composer install --no-interaction --prefer-dist
137+
composer update --no-interaction --prefer-dist --no-scripts
138+
env:
139+
SYMFONY_VERSION: ${{ matrix.symfony-version }}
113140

114141
- name: Fix code style
115142
if: ${{ matrix.lint }}

Command/AbstractManagerAwareCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(array $managers, $name = null)
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
protected function configure()
37+
protected function configure(): void
3838
{
3939
$this->addOption(
4040
'manager',

Command/CacheClearCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(array $managers = [])
3030
/**
3131
* {@inheritdoc}
3232
*/
33-
protected function configure()
33+
protected function configure(): void
3434
{
3535
parent::configure();
3636

@@ -42,7 +42,7 @@ protected function configure()
4242
/**
4343
* {@inheritdoc}
4444
*/
45-
protected function execute(InputInterface $input, OutputInterface $output)
45+
protected function execute(InputInterface $input, OutputInterface $output): int
4646
{
4747
$io = new SymfonyStyle($input, $output);
4848
$this

Command/DocumentGenerateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function __construct(
7878
/**
7979
* {@inheritdoc}
8080
*/
81-
protected function configure()
81+
protected function configure(): void
8282
{
8383
parent::configure();
8484

@@ -90,7 +90,7 @@ protected function configure()
9090
/**
9191
* {@inheritdoc}
9292
*/
93-
protected function execute(InputInterface $input, OutputInterface $output)
93+
protected function execute(InputInterface $input, OutputInterface $output): int
9494
{
9595
if ($input->hasParameterOption(['--no-interaction', '-n'])) {
9696
throw $this->getException('No interaction mode is not allowed!');

Command/IndexCreateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(IndexSuffixFinder $indexSuffixFinder, array $manager
3939
/**
4040
* {@inheritdoc}
4141
*/
42-
protected function configure()
42+
protected function configure(): void
4343
{
4444
parent::configure();
4545

@@ -66,7 +66,7 @@ protected function configure()
6666
/**
6767
* {@inheritdoc}
6868
*/
69-
protected function execute(InputInterface $input, OutputInterface $output)
69+
protected function execute(InputInterface $input, OutputInterface $output):int
7070
{
7171
$io = new SymfonyStyle($input, $output);
7272
$manager = $this->getManager($input->getOption('manager'));

Command/IndexDropCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class IndexDropCommand extends AbstractManagerAwareCommand
2626
/**
2727
* {@inheritdoc}
2828
*/
29-
protected function configure()
29+
protected function configure(): void
3030
{
3131
parent::configure();
3232

@@ -44,7 +44,7 @@ protected function configure()
4444
/**
4545
* {@inheritdoc}
4646
*/
47-
protected function execute(InputInterface $input, OutputInterface $output)
47+
protected function execute(InputInterface $input, OutputInterface $output): int
4848
{
4949
$io = new SymfonyStyle($input, $output);
5050
if ($input->getOption('force')) {

Command/IndexExportCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(ExportService $exportService, array $managers = [])
4040
/**
4141
* {@inheritdoc}
4242
*/
43-
protected function configure()
43+
protected function configure(): void
4444
{
4545
parent::configure();
4646

@@ -74,7 +74,7 @@ protected function configure()
7474
/**
7575
* {@inheritdoc}
7676
*/
77-
protected function execute(InputInterface $input, OutputInterface $output)
77+
protected function execute(InputInterface $input, OutputInterface $output): int
7878
{
7979
$io = new SymfonyStyle($input, $output);
8080
$manager = $this->getManager($input->getOption('manager'));

Command/IndexImportCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(ImportService $importService, array $managers = [])
4040
/**
4141
* {@inheritdoc}
4242
*/
43-
protected function configure()
43+
protected function configure(): void
4444
{
4545
parent::configure();
4646

@@ -70,7 +70,7 @@ protected function configure()
7070
/**
7171
* {@inheritdoc}
7272
*/
73-
protected function execute(InputInterface $input, OutputInterface $output)
73+
protected function execute(InputInterface $input, OutputInterface $output): int
7474
{
7575
$io = new SymfonyStyle($input, $output);
7676
$manager = $this->getManager($input->getOption('manager'));
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace ONGR\ElasticsearchBundle\DependencyInjection\Compiler;
4+
5+
use Doctrine\Common\Annotations\AnnotationReader;
6+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7+
use Symfony\Component\DependencyInjection\ContainerBuilder;
8+
use Symfony\Component\DependencyInjection\Definition;
9+
10+
/**
11+
* @internal
12+
*/
13+
class AnnotationReaderPass implements CompilerPassInterface
14+
{
15+
public function process(ContainerBuilder $container): void
16+
{
17+
if ($container->hasDefinition('es.annotations.reader')) {
18+
return;
19+
}
20+
21+
$definition = new Definition(AnnotationReader::class);
22+
$definition->addMethodCall('addGlobalIgnoredName', ['required']);
23+
$container->setDefinition('es.annotations.reader', $definition);
24+
}
25+
}

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Configuration implements ConfigurationInterface
2323
/**
2424
* {@inheritdoc}
2525
*/
26-
public function getConfigTreeBuilder()
26+
public function getConfigTreeBuilder(): TreeBuilder
2727
{
2828
$treeBuilder = new TreeBuilder('ongr_elasticsearch');
2929

0 commit comments

Comments
 (0)