From 490497236c7d9133117e8c9b056f58ee9820adc3 Mon Sep 17 00:00:00 2001 From: Sergio Mendolia Date: Sat, 25 Apr 2026 15:32:10 +0200 Subject: [PATCH] chore(sf): Allow symfony 8 --- composer.json | 24 +++++++++---------- src/Client/ClientInterface.php | 2 ++ src/CollectionAlias/AliasException.php | 2 ++ .../CollectionAliasInterface.php | 2 ++ src/Exception/SearchException.php | 2 ++ src/Indexer/IndexerInterface.php | 2 ++ src/Mapper/CollectionManagerInterface.php | 2 ++ .../Exception/ValueExtractorException.php | 2 ++ .../Field/FieldConverterInterface.php | 2 ++ src/Mapper/Converter/ToTypesenseInterface.php | 2 ++ .../Converter/ValueConverterInterface.php | 2 ++ src/Mapper/Converter/ValueExtractor.php | 2 ++ .../Converter/ValueExtractorInterface.php | 2 ++ src/Mapper/DataGeneratorInterface.php | 2 ++ .../EntityCollectionManagerInterface.php | 2 ++ .../Entity/EntityTransformerInterface.php | 2 ++ .../Entity/Identifier/EntityIdentifier.php | 2 ++ .../Identifier/EntityIdentifierInterface.php | 2 ++ src/Mapper/Fields/FieldMappingInterface.php | 2 ++ .../Locator/InvalidTypeMapperException.php | 2 ++ src/Mapper/Locator/MapperLocatorInterface.php | 2 ++ src/Mapper/Mapping/MappingInterface.php | 2 ++ src/Mapper/MappingGeneratorInterface.php | 2 ++ src/Mapper/Metadata/MetadataMapping.php | 2 ++ .../Metadata/MetadataMappingInterface.php | 2 ++ .../Options/CollectionOptionsInterface.php | 2 ++ .../StandaloneCollectionManagerInterface.php | 2 ++ src/Populate/BatchGenerator.php | 2 ++ .../WaitFor/WaitForDatabaseService.php | 2 ++ src/Populate/WaitFor/WaitForInterface.php | 2 ++ .../WaitFor/WaitForTypesenseService.php | 2 ++ src/Query/SearchQuery.php | 2 +- src/Query/SearchQueryInterface.php | 2 ++ src/Query/VectorQuery.php | 2 ++ src/Query/VectorQueryInterface.php | 2 ++ src/Query/VoiceQueryInterface.php | 2 ++ .../Hydrate/HydrateRepositoryInterface.php | 2 ++ .../Hydrate/HydrateSearchResultInterface.php | 2 ++ src/Search/SearchCollectionInterface.php | 2 ++ src/Search/SearchInterface.php | 2 ++ src/Type/DataTypeEnum.php | 2 ++ src/Type/FacetStrategyEnum.php | 2 ++ src/Type/InfixEnum.php | 2 ++ tests/Client/ServiceWithClient.php | 2 ++ tests/DataFixtures/ProductFixtures.php | 2 ++ .../ValueConversionExceptionTest.php | 2 ++ .../Exception/ValueExtractorExceptionTest.php | 2 ++ tests/Mapper/Converter/TestBackedEnum.php | 2 ++ tests/Mapper/Converter/TestUnitEnum.php | 2 ++ tests/Mapper/EntityIdentifierTest.php | 2 ++ tests/Mapper/Metadata/MetadataMappingTest.php | 2 ++ tests/Mapper/MyInvalidMapper.php | 2 ++ tests/Mapper/ProductDataGenerator.php | 2 ++ tests/Mapper/ProductMapper.php | 2 ++ tests/Mapping/MappingTest.php | 2 ++ tests/Query/VectorQueryTest.php | 2 ++ tests/Repository/ProductRepository.php | 2 ++ tests/Search/SearchResultHydratedTest.php | 2 ++ tests/TestKernel.php | 14 +++++------ tests/bootstrap.php | 2 ++ 60 files changed, 133 insertions(+), 21 deletions(-) diff --git a/composer.json b/composer.json index 2c017d1..f7f6bc3 100644 --- a/composer.json +++ b/composer.json @@ -10,12 +10,12 @@ "psr/http-client-implementation": "1.0", "psr/http-factory": "^1.0", "psr/log": "^3.0", - "symfony/framework-bundle": "^6.4|^7.0 || 8.0.3", - "symfony/http-client": "^6.4.18|^7.2 || 8.0.3", - "symfony/http-kernel": "^6.4|^7.2 || 8.0.3", - "symfony/property-access": "^6.4|^7.2 || 8.0.3", + "symfony/framework-bundle": "^7.2 || ^8.0", + "symfony/http-client": "^7.2 || ^8.0", + "symfony/http-kernel": "^7.2 || ^8.0", + "symfony/property-access": "^7.2 || ^8.0", "symfony/service-contracts": "^3.5", - "symfony/var-exporter": "^6.4|^7.2 || 8.0.0", + "symfony/var-exporter": "^7.2 || ^8.0", "typesense/typesense-php": "^4.9|^5.0" }, "require-dev": { @@ -29,15 +29,14 @@ "phpstan/phpstan-symfony": "^2.0", "phpunit/phpunit": "^11.5|^12.0", "rector/rector": "^2.0.8", - "symfony/console": "^6.4|^7.2 || 8.0.3", - "symfony/dotenv": "^6.4|^7.2 || 8.0.0", - "symfony/phpunit-bridge": "^7.0 || ^8.0", - "symfony/runtime": "^6.4|^7.2 || 8.0.1", - "symfony/yaml": "^6.4|^7.0 || 8.0.1" + "symfony/console": "^7.2 || ^8.0", + "symfony/dotenv": "^7.2 || ^8.0", + "symfony/phpunit-bridge": "^7.2 || ^8.0", + "symfony/runtime": "^7.2 || ^8.0", + "symfony/yaml": "^7.2 || ^8.0" }, "conflict": { - "php-http/httplug": "<1.5", - "symfony/var-exporter": ">=8" + "php-http/httplug": "<1.5" }, "config": { "sort-packages": true, @@ -61,7 +60,6 @@ "auto-scripts": { "cache:clear": "symfony-cmd" }, - "phpstan": [ "Composer\\Config::disableProcessTimeout", "./vendor/bin/phpstan analyse --memory-limit=-1" diff --git a/src/Client/ClientInterface.php b/src/Client/ClientInterface.php index 734d52a..22a62f3 100644 --- a/src/Client/ClientInterface.php +++ b/src/Client/ClientInterface.php @@ -1,5 +1,7 @@ =7) - // The constant hack is just for rector to not consider this branch as "Always true" and remove it - if (constant(Kernel::class.'::VERSION_ID') < 70000) { - return; + // symfony/var-exporter v8 removed ProxyHelper::generateLazyGhost(); on + // PHP 8.4+ Doctrine can fall back to native lazy objects instead. + if (\PHP_VERSION_ID >= 80400 && !method_exists(ProxyHelper::class, 'generateLazyGhost')) { // @phpstan-ignore-line + $containerBuilder->prependExtensionConfig('doctrine', [ + 'orm' => ['enable_native_lazy_objects' => true], + ]); } - $containerBuilder->prependExtensionConfig('framework', [ - 'property_info' => ['with_constructor_extractor' => false], - ]); } private function clearCache(): void diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 9089622..bbbba61 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,5 +1,7 @@