Skip to content

Commit e79be9f

Browse files
feature(#58): Enable compatibility with Symfony 7
1 parent fbd6124 commit e79be9f

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

composer.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "fusonic/http-kernel-bundle",
33
"description": "Symfony bundle with extensions for Symfony's HttpKernel",
4-
"version": "1.0.1",
4+
"version": "1.1.0",
55
"type": "library",
66
"license": "MIT",
77
"authors": [
@@ -24,25 +24,25 @@
2424
"require": {
2525
"php": "^8.2",
2626
"phpdocumentor/reflection-docblock": "^5.3",
27-
"symfony/config": "^6.3",
28-
"symfony/dependency-injection": "^6.3",
29-
"symfony/http-kernel": "^6.3",
30-
"symfony/property-access": "^6.3",
31-
"symfony/property-info": "^6.3",
32-
"symfony/serializer": "^6.3",
33-
"symfony/validator": "^6.3"
27+
"symfony/config": "^6.3 || ^7.0",
28+
"symfony/dependency-injection": "^6.3 || ^7.0",
29+
"symfony/http-kernel": "^6.3 || ^7.0",
30+
"symfony/property-access": "^6.3 || ^7.0",
31+
"symfony/property-info": "^6.3 || ^7.0",
32+
"symfony/serializer": "^6.3 || ^7.0",
33+
"symfony/validator": "^6.3 || ^7.0"
3434
},
3535
"require-dev": {
36-
"friendsofphp/php-cs-fixer": "^3.26",
36+
"friendsofphp/php-cs-fixer": "^3.40",
3737
"phpstan/extension-installer": "^1.3",
3838
"phpstan/phpstan": "^1.10",
3939
"phpstan/phpstan-phpunit": "^1.3",
4040
"phpstan/phpstan-strict-rules": "^1.5",
4141
"phpstan/phpstan-symfony": "^1.3",
4242
"phpunit/phpunit": "^9.6",
4343
"roave/security-advisories": "dev-latest",
44-
"symfony/cache": "^6.3",
45-
"symfony/phpunit-bridge": "^6.3",
44+
"symfony/cache": "^6.3 || ^7.0",
45+
"symfony/phpunit-bridge": "^6.3 || ^7.0",
4646
"tomasvotruba/type-coverage": "^0.2"
4747
},
4848
"scripts": {

tests/Controller/RequestDtoResolverTest.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
use Symfony\Component\HttpFoundation\Request;
3333
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
3434
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
35+
use Symfony\Component\HttpKernel\Kernel;
3536
use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
3637
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
3738
use Symfony\Component\PropertyInfo\PropertyInfoExtractor;
@@ -657,8 +658,11 @@ private function createArgumentMetadata(string $class, array $arguments): Argume
657658

658659
private function getValidator(): ValidatorInterface
659660
{
660-
return Validation::createValidatorBuilder()
661-
->enableAnnotationMapping()
662-
->getValidator();
661+
$validatorBuilder = Validation::createValidatorBuilder();
662+
663+
// @phpstan-ignore-next-line
664+
Kernel::VERSION_ID >= 70000 ? $validatorBuilder->enableAttributeMapping() : $validatorBuilder->enableAnnotationMapping();
665+
666+
return $validatorBuilder->getValidator();
663667
}
664668
}

0 commit comments

Comments
 (0)