Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony 7 support #1933

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0967ec7
Update dependencies
l-you Dec 4, 2023
14917c4
add php 8.3
l-you Dec 4, 2023
6ba4850
add symfony 7 to tests
l-you Dec 4, 2023
6e4d891
exclude php 7.4 from tests for symfony 7
l-you Dec 4, 2023
c36fea7
Exclude all php versions prior to 8.2 for Symfony 7. Minimum supporte…
l-you Dec 4, 2023
5d556fe
Require minimum doctrine/phpcr-odm 1.5.3. This is the lowest version …
l-you Dec 4, 2023
22c8a4c
Exclude php 8.3 symfony 7 lowest dependencies from CI. Higher doctrin…
l-you Dec 4, 2023
8ebec77
Revert "Exclude php 8.3 symfony 7 lowest dependencies from CI. Higher…
l-you Dec 4, 2023
724e5ae
Run cs fixer
l-you Dec 4, 2023
916337a
fix code style
l-you Dec 4, 2023
1a637b1
fix a suddenly excluded case
l-you Dec 4, 2023
6b889af
Lock to symfony/console@^6.1 because of issue with doctrine/phpcr-odm…
l-you Dec 4, 2023
5621661
run cs fixer
l-you Dec 4, 2023
7450153
Bump jms/serializer-bundle to v5
l-you Dec 4, 2023
953d5d4
Remove jms/serializer-bundle v3 support because php 7.2 has reached a…
l-you Dec 4, 2023
8f43f71
add php 8.3 to phpstan
l-you Dec 4, 2023
a6e0a93
Update all Symfony references to ^6.3
l-you Dec 4, 2023
d47ae8e
Add symfony/console 7.0 to dependencies.
l-you Dec 4, 2023
35ac8e6
Normalize continuous integration matrix.
l-you Dec 4, 2023
92f62e1
Normalize continuous integration matrix.
l-you Dec 4, 2023
5d393fe
update gitignore
l-you Dec 12, 2023
c8652ab
fix gitignore
l-you Jan 30, 2024
78d403e
fix typo
l-you Jan 30, 2024
c48f5f8
Replace php-cs-fixer with a shim version. It allows us to lock with a…
l-you Feb 29, 2024
f773e12
Run php-cs-fixer with locked version 3.8.0.
l-you Feb 29, 2024
a85750b
Add support for doctrine/phpcr-odm 2-beta release.
l-you Feb 29, 2024
7d4a0d6
Cs fixer fix
l-you Feb 29, 2024
b5d922b
Bump knplabs/knp-components
l-you Feb 29, 2024
e69a186
Fix php cs fixer version.
l-you Feb 29, 2024
1f31f71
CS Fixer fixes with version 3.8.0.
l-you Feb 29, 2024
25c8b10
Add symfony/stopwatch because it's required by project
l-you Feb 29, 2024
bb351e8
Bumb jackalope/jackalope-doctrine-dbal to RC-1
l-you Feb 29, 2024
4320d34
Normalize composer
l-you Feb 29, 2024
015463c
Disable symfony testing with php 8.2 and 8.3
l-you Feb 29, 2024
5d30843
minimum stability RC
l-you Mar 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ jobs:
- '7.4'
- '8.1'
- '8.2'
- '8.3'
symfony:
- '4.4.*'
- '5.4.*'
- '6.2.*'
l-you marked this conversation as resolved.
Show resolved Hide resolved
- '7.0.*'
elasticsearch:
- '7.11.0'
dependencies:
Expand All @@ -58,6 +60,12 @@ jobs:
symfony: '6.2.*'
dependencies: 'highest'
elasticsearch: '7.11.0'
- php: '7.4'
symfony: '7.0.*'
- php: '8.0'
symfony: '7.0.*'
- php: '8.1'
symfony: '7.0.*'
fail-fast: false
steps:
- name: 'Checkout'
Expand Down Expand Up @@ -103,10 +111,12 @@ jobs:
- '7.4'
- '8.1'
- '8.2'
- '8.3'
symfony:
- '4.4.*'
- '5.4.*'
- '6.2.*'
- '7.0.*'
dependencies:
- 'highest'
include:
Expand All @@ -117,6 +127,13 @@ jobs:
- php: '7.4'
symfony: '6.2.*'
dependencies: 'highest'
- php: '7.4'
symfony: '7.0.*'
- php: '8.0'
symfony: '7.0.*'
- php: '8.1'
symfony: '7.0.*'

fail-fast: false
steps:
- name: 'Checkout'
Expand Down
26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,32 @@
"psr/log": "^1.0 || ^2.0 || ^3.0",
"ruflin/elastica": "^7.1",
"symfony/console": "^4.4 || ^5.4 || ^6.2",
l-you marked this conversation as resolved.
Show resolved Hide resolved
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.2",
"symfony/framework-bundle": "^4.4 || ^5.4 || ^6.2",
"symfony/property-access": "^4.4 || ^5.4 || ^6.2"
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.2 || ^7.0",
l-you marked this conversation as resolved.
Show resolved Hide resolved
"symfony/framework-bundle": "^4.4 || ^5.4 || ^6.2 || ^7.0",
"symfony/property-access": "^4.4 || ^5.4 || ^6.2 || ^7.0"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.1.1",
"doctrine/mongodb-odm": "^2.2",
"doctrine/orm": "^2.8",
"doctrine/phpcr-odm": "^1.4",
"doctrine/phpcr-odm": "^1.5.3",
"ergebnis/composer-normalize": "^2.28",
"friendsofphp/php-cs-fixer": "^3.0",
"jackalope/jackalope-doctrine-dbal": "^1.2",
"jms/serializer": "^3.8",
"jms/serializer-bundle": "^3.5 || ^4.0",
"jms/serializer-bundle": "^4.0 || ^5.0",
"knplabs/knp-components": "^2.4 || ^3.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-symfony": "^1.2",
"phpunit/phpunit": "^9.5",
"symfony/expression-language": "^4.4 || ^5.4 || ^6.2",
"symfony/messenger": "^4.4 || ^5.4 || ^6.2",
"symfony/serializer": "^4.4 || ^5.4 || ^6.2",
"symfony/twig-bundle": "^4.4 || ^5.4 || ^6.2",
"symfony/web-profiler-bundle": "^4.4 || ^5.4 || ^6.2",
"symfony/yaml": "^4.4 || ^5.4 || ^6.2"
"symfony/expression-language": "^4.4 || ^5.4 || ^6.2 || ^7.0",
"symfony/messenger": "^4.4 || ^5.4 || ^6.2 || ^7.0",
"symfony/serializer": "^4.4 || ^5.4 || ^6.2 || ^7.0",
"symfony/twig-bundle": "^4.4 || ^5.4 || ^6.2 || ^7.0",
"symfony/web-profiler-bundle": "^4.4 || ^5.4 || ^6.2 || ^7.0",
"symfony/yaml": "^4.4 || ^5.4 || ^6.2 || ^7.0"
},
"suggest": {
"enqueue/elastica-bundle": "For populating Elasticsearch indexes asynchronously and using significanly less resources. Uses Enqueue.",
Expand All @@ -78,8 +78,8 @@
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true,
"ergebnis/composer-normalize": true
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true
}
},
"extra": {
Expand Down
1 change: 1 addition & 0 deletions src/Configuration/ConfigManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ConfigManager implements ManagerInterface
{
/**
* @var IndexConfig[]
*
* @phpstan-var array<string, IndexConfigInterface>
*/
private $indexes = [];
Expand Down
1 change: 1 addition & 0 deletions src/Configuration/IndexConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function getNumericDetection(): ?bool;

/**
* @return string|bool|null
*
* @phpstan-return ?TDynamic
*/
public function getDynamic();
Expand Down
6 changes: 6 additions & 0 deletions src/Configuration/IndexConfigTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,27 @@ trait IndexConfigTrait
* An array of settings sent to ElasticSearch when creating the index.
*
* @var array
*
* @phpstan-var TSettings
*
* @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
*/
private $settings;

/**
* @var array
*
* @phpstan-var TConfig
*
* @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
*/
private $config;

/**
* @var array
*
* @phpstan-var TMapping
*
* @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
*/
private $mapping;
Expand Down
2 changes: 2 additions & 0 deletions src/Configuration/Source/ContainerSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ContainerSource implements SourceInterface
* The internal container representation of information.
*
* @var array
*
* @phpstan-var list<TConfig>
*/
private $configArray;
Expand All @@ -41,6 +42,7 @@ public function __construct(array $configArray)
* Should return all configuration available from the data source.
*
* @return IndexConfig[]
*
* @phpstan-return array<string, IndexConfig>
*/
public function getConfiguration(): array
Expand Down
1 change: 1 addition & 0 deletions src/Configuration/Source/SourceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface SourceInterface
* Should return all configuration available from the data source.
*
* @return \FOS\ElasticaBundle\Configuration\IndexConfig[]
*
* @phpstan-return array<string, IndexConfigInterface>
*/
public function getConfiguration(): array;
Expand Down
2 changes: 2 additions & 0 deletions src/Configuration/Source/TemplateContainerSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class TemplateContainerSource implements SourceInterface
* The internal container representation of information.
*
* @var array
*
* @phpstan-var list<TConfig>
*/
private $configArray;
Expand All @@ -41,6 +42,7 @@ public function __construct(array $configArray)
* Should return all configuration available from the data source.
*
* @return IndexTemplateConfig[]
*
* @phpstan-return array<string, IndexTemplateConfig>
*/
public function getConfiguration(): array
Expand Down
3 changes: 3 additions & 0 deletions src/Configuration/TypeConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ class TypeConfig
{
/**
* @var array
*
* @phpstan-var TElasticConfig
*/
private $config;

/**
* @var array
*
* @phpstan-var TMapping
*/
private $mapping;
Expand All @@ -38,6 +40,7 @@ class TypeConfig

/**
* @param TMapping $mapping
*
* @phpstan-param TElasticConfig $config
*/
public function __construct(string $name, array $mapping, array $config = [])
Expand Down
6 changes: 0 additions & 6 deletions src/DataCollector/ElasticaDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,11 @@ public function collect(Request $request, Response $response, ?\Throwable $excep
$this->data['queries'] = $this->logger->getQueries();
}

/**
* @return mixed
*/
public function getQueryCount()
{
return $this->data['nb_queries'];
}

/**
* @return mixed
*/
public function getQueries()
{
return $this->data['queries'];
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/FOSElasticaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class FOSElasticaExtension extends Extension
* An array of indexes as configured by the extension.
*
* @var array
*
* @phpstan-var array<string, TIndexConfig>
*/
private $indexConfigs = [];
Expand All @@ -49,6 +50,7 @@ class FOSElasticaExtension extends Extension
* An array of index templates as configured by the extension.
*
* @var array
*
* @phpstan-var array<string, TIndexTemplateConfig>
*/
private $indexTemplateConfigs = [];
Expand Down
7 changes: 2 additions & 5 deletions src/Doctrine/AbstractElasticaToModelTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public function getObjectClass(): string
*
* @param Result[] $elasticaObjects of elastica objects
*
* @throws \RuntimeException
*
* @return array
*
* @throws \RuntimeException
*/
public function transform(array $elasticaObjects)
{
Expand Down Expand Up @@ -144,9 +144,6 @@ public function hybridTransform(array $elasticaObjects)
return $result;
}

/**
* {@inheritdoc}
*/
public function getIdentifierField(): string
{
return $this->options['identifier'];
Expand Down
3 changes: 0 additions & 3 deletions src/Doctrine/MongoDBPagerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public function __construct(
$this->registerListenersService = $registerListenersService;
}

/**
* {@inheritdoc}
*/
public function provide(array $options = []): PagerInterface
{
$options = \array_replace($this->baseOptions, $options);
Expand Down
3 changes: 0 additions & 3 deletions src/Doctrine/ORMPagerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public function __construct(
$this->registerListenersService = $registerListenersService;
}

/**
* {@inheritdoc}
*/
public function provide(array $options = []): PagerInterface
{
$options = \array_replace($this->baseOptions, $options);
Expand Down
5 changes: 1 addition & 4 deletions src/Doctrine/PHPCRPagerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ public function __construct(ManagerRegistry $doctrine, RegisterListenersService
$this->registerListenersService = $registerListenersService;
}

/**
* {@inheritdoc}
*/
public function provide(array $options = []): PagerInterface
{
$options = \array_replace($this->baseOptions, $options);
Expand All @@ -73,7 +70,7 @@ public function provide(array $options = []): PagerInterface
$repository = $manager->getRepository($this->objectClass);

$adapter = new QueryAdapter(
\call_user_func([$repository, $options['query_builder_method']], static::ENTITY_ALIAS)
\call_user_func([$repository, $options['query_builder_method']], self::ENTITY_ALIAS)
);

$pager = new PagerfantaPager(new Pagerfanta($adapter));
Expand Down
3 changes: 0 additions & 3 deletions src/Doctrine/RepositoryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ public function __construct(ManagerRegistry $managerRegistry, RepositoryManagerI
$this->repositoryManager = $repositoryManager;
}

/**
* {@inheritdoc}
*/
public function addIndex(string $indexName, FinderInterface $finder, ?string $repositoryName = null): void
{
throw new \LogicException(__METHOD__.' should not be called. Call addIndex on the main repository manager');
Expand Down
2 changes: 0 additions & 2 deletions src/Elastica/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class Client extends BaseClient
private $stopwatch;

/**
* {@inheritdoc}
*
* @param array<mixed> $data
* @param array<mixed> $query
*/
Expand Down
4 changes: 1 addition & 3 deletions src/Elastica/IndexTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@
*
* @author Dmitry Balabka <[email protected]>
*/
class IndexTemplate extends BaseIndexTemplate
{
}
class IndexTemplate extends BaseIndexTemplate {}
3 changes: 1 addition & 2 deletions src/Event/AbstractIndexPopulateEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ abstract class AbstractIndexPopulateEvent extends AbstractIndexEvent

/**
* @var array
*
* @phpstan-var TOptions
*/
protected $options;
Expand Down Expand Up @@ -67,8 +68,6 @@ public function getOptions(): array

/**
* @throws \InvalidArgumentException if option does not exist
*
* @return mixed
*/
public function getOption(string $name)
{
Expand Down
1 change: 1 addition & 0 deletions src/Event/AbstractTransformEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ abstract class AbstractTransformEvent extends Event

/**
* @var array
*
* @phpstan-var TFields
*/
private $fields;
Expand Down
1 change: 1 addition & 0 deletions src/Event/PostIndexMappingBuildEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ final class PostIndexMappingBuildEvent extends AbstractIndexEvent

/**
* @var array
*
* @phpstan-var TMapping
*/
private $mapping;
Expand Down
4 changes: 1 addition & 3 deletions src/Event/PostIndexPopulateEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

namespace FOS\ElasticaBundle\Event;

final class PostIndexPopulateEvent extends AbstractIndexPopulateEvent
{
}
final class PostIndexPopulateEvent extends AbstractIndexPopulateEvent {}
4 changes: 1 addition & 3 deletions src/Event/PostIndexResetEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

namespace FOS\ElasticaBundle\Event;

final class PostIndexResetEvent extends AbstractIndexResetEvent
{
}
final class PostIndexResetEvent extends AbstractIndexResetEvent {}
4 changes: 1 addition & 3 deletions src/Event/PostTransformEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

namespace FOS\ElasticaBundle\Event;

final class PostTransformEvent extends AbstractTransformEvent
{
}
final class PostTransformEvent extends AbstractTransformEvent {}
Loading
Loading