Skip to content

Commit f7e0e7c

Browse files
authored
chore: support symfony 8 (#7561)
1 parent c857b52 commit f7e0e7c

File tree

274 files changed

+819
-1491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+819
-1491
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ composer.lock
1717
/tests/Metadata/Extractor/Adapter/*.yaml
1818
/vendor/
1919
/Dockerfile
20-
20+
tests/Fixtures/app/config/reference.php

.php-cs-fixer.dist.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
'docs/guides',
2222
'docs/var',
2323
'src/Doctrine/Orm/Tests/var',
24-
'src/Doctrine/Odm/Tests/var'
24+
'src/Doctrine/Odm/Tests/var',
2525
])
26+
->notPath('tests/Fixtures/app/config/reference.php')
2627
->notPath('src/Symfony/Bundle/DependencyInjection/Configuration.php')
2728
->append([
2829
'tests/Fixtures/app/console',
2930
]);
3031

3132
return (new PhpCsFixer\Config())
33+
->setUnsupportedPhpVersionAllowed(true)
3234
->setRiskyAllowed(true)
3335
->setRules([
3436
'@DoctrineAnnotation' => true,

composer.json

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"dev-main": "4.3.x-dev"
5454
},
5555
"symfony": {
56-
"require": "^6.4 || ^7.1"
56+
"require": "^6.4 || ^7.1 || ^8.0"
5757
},
5858
"pmu": {
5959
"projects": [
@@ -111,15 +111,15 @@
111111
"psr/cache": "^1.0 || ^2.0 || ^3.0",
112112
"psr/container": "^1.0 || ^2.0",
113113
"symfony/deprecation-contracts": "^3.1",
114-
"symfony/http-foundation": "^6.4.14 || ^7.0",
115-
"symfony/http-kernel": "^6.4 || ^7.0",
116-
"symfony/property-access": "^6.4 || ^7.0",
117-
"symfony/property-info": "^6.4 || ^7.1",
118-
"symfony/serializer": "^6.4 || ^7.0",
114+
"symfony/http-foundation": "^6.4.14 || ^7.0 || ^8.0",
115+
"symfony/http-kernel": "^6.4 || ^7.0 || ^8.0",
116+
"symfony/property-access": "^6.4 || ^7.0 || ^8.0",
117+
"symfony/property-info": "^6.4 || ^7.1 || ^8.0",
118+
"symfony/serializer": "^6.4 || ^7.0 || ^8.0",
119119
"symfony/translation-contracts": "^3.3",
120-
"symfony/type-info": "^7.3 || 7.4.x-dev",
121-
"symfony/validator": "^6.4.11 || ^7.1",
122-
"symfony/web-link": "^6.4 || ^7.1",
120+
"symfony/type-info": "^7.4 || ^8.0",
121+
"symfony/validator": "^6.4.11 || ^7.1 || ^8.0",
122+
"symfony/web-link": "^6.4 || ^7.1 || ^8.0",
123123
"willdurand/negotiation": "^3.1"
124124
},
125125
"require-dev": {
@@ -129,7 +129,7 @@
129129
"doctrine/cache": "^1.11 || ^2.1",
130130
"doctrine/common": "^3.2.2",
131131
"doctrine/dbal": "^4.0",
132-
"doctrine/doctrine-bundle": "^2.11",
132+
"doctrine/doctrine-bundle": "^2.11 || ^3.1",
133133
"doctrine/mongodb-odm": "^2.10",
134134
"doctrine/mongodb-odm-bundle": "^5.0",
135135
"doctrine/orm": "^2.17 || ^3.0",
@@ -163,38 +163,38 @@
163163
"soyuka/contexts": "^3.3.10",
164164
"soyuka/pmu": "^0.2.0",
165165
"soyuka/stubs-mongodb": "^1.0",
166-
"symfony/asset": "^6.4 || ^7.0",
167-
"symfony/browser-kit": "^6.4 || ^7.0",
168-
"symfony/cache": "^6.4 || ^7.0",
169-
"symfony/config": "^6.4 || ^7.0",
170-
"symfony/console": "^6.4 || ^7.0",
171-
"symfony/css-selector": "^6.4 || ^7.0",
172-
"symfony/dependency-injection": "^6.4 || ^7.0",
173-
"symfony/doctrine-bridge": "^6.4.2 || ^7.1",
174-
"symfony/dom-crawler": "^6.4 || ^7.0",
175-
"symfony/error-handler": "^6.4 || ^7.0",
176-
"symfony/event-dispatcher": "^6.4 || ^7.0",
177-
"symfony/expression-language": "^6.4 || ^7.0",
178-
"symfony/finder": "^6.4 || ^7.0",
179-
"symfony/form": "^6.4 || ^7.0",
180-
"symfony/framework-bundle": "^6.4 || ^7.0 || 7.4.x-dev",
181-
"symfony/http-client": "^6.4 || ^7.0",
182-
"symfony/intl": "^6.4 || ^7.0",
183-
"symfony/json-streamer": "7.4.x-dev",
166+
"symfony/asset": "^6.4 || ^7.0 || ^8.0",
167+
"symfony/browser-kit": "^6.4 || ^7.0 || ^8.0",
168+
"symfony/cache": "^6.4 || ^7.0 || ^8.0",
169+
"symfony/config": "^6.4 || ^7.0 || ^8.0",
170+
"symfony/console": "^6.4 || ^7.0 || ^8.0",
171+
"symfony/css-selector": "^6.4 || ^7.0 || ^8.0",
172+
"symfony/dependency-injection": "^6.4 || ^7.0 || ^8.0",
173+
"symfony/doctrine-bridge": "^6.4.2 || ^7.1 || ^8.0",
174+
"symfony/dom-crawler": "^6.4 || ^7.0 || ^8.0",
175+
"symfony/error-handler": "^6.4 || ^7.0 || ^8.0",
176+
"symfony/event-dispatcher": "^6.4 || ^7.0 || ^8.0",
177+
"symfony/expression-language": "^6.4 || ^7.0 || ^8.0",
178+
"symfony/finder": "^6.4 || ^7.0 || ^8.0",
179+
"symfony/form": "^6.4 || ^7.0 || ^8.0",
180+
"symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0",
181+
"symfony/http-client": "^6.4 || ^7.0 || ^8.0",
182+
"symfony/intl": "^6.4 || ^7.0 || ^8.0",
183+
"symfony/json-streamer": "^7.4 || ^8.0",
184184
"symfony/maker-bundle": "^1.24",
185185
"symfony/mercure-bundle": "*",
186-
"symfony/messenger": "^6.4 || ^7.0",
187-
"symfony/object-mapper": "^7.3 || 7.4.x-dev",
188-
"symfony/routing": "^6.4 || ^7.0",
189-
"symfony/security-bundle": "^6.4 || ^7.0",
190-
"symfony/security-core": "^6.4 || ^7.0",
191-
"symfony/stopwatch": "^6.4 || ^7.0",
192-
"symfony/string": "^6.4 || ^7.0",
193-
"symfony/twig-bundle": "^6.4 || ^7.0",
194-
"symfony/uid": "^6.4 || ^7.0",
195-
"symfony/var-exporter": "^7.3 || ^7.4.x-dev",
196-
"symfony/web-profiler-bundle": "^6.4 || ^7.0",
197-
"symfony/yaml": "^6.4 || ^7.0",
186+
"symfony/messenger": "^6.4 || ^7.0 || ^8.0",
187+
"symfony/object-mapper": "^7.4 || ^8.0",
188+
"symfony/routing": "^6.4 || ^7.0 || ^8.0",
189+
"symfony/security-bundle": "^6.4 || ^7.0 || ^8.0",
190+
"symfony/security-core": "^6.4 || ^7.0 || ^8.0",
191+
"symfony/stopwatch": "^6.4 || ^7.0 || ^8.0",
192+
"symfony/string": "^6.4 || ^7.0 || ^8.0",
193+
"symfony/twig-bundle": "^6.4 || ^7.0 || ^8.0",
194+
"symfony/uid": "^6.4 || ^7.0 || ^8.0",
195+
"symfony/var-exporter": "^7.4 || ^8.0",
196+
"symfony/web-profiler-bundle": "^6.4 || ^7.0 || ^8.0",
197+
"symfony/yaml": "^6.4 || ^7.0 || ^8.0",
198198
"twig/twig": "^1.42.3 || ^2.12 || ^3.0",
199199
"webonyx/graphql-php": "^15.0"
200200
},

docs/config/packages/doctrine.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ doctrine:
22
dbal:
33
url: 'sqlite:///%kernel.project_dir%/var/%guide%.db'
44
orm:
5-
auto_generate_proxy_classes: true
65
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
76
auto_mapping: false

phpstan.neon.dist

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ parameters:
4242
ApiPlatform\Metadata\Resource\ResourceMetadataCollection:
4343
- handleNotFound
4444
ignoreErrors:
45+
# ignore type todo remove in 5.0
46+
-
47+
message: '#Symfony\\Component\\PropertyInfo\\Type#'
48+
identifier: class.notFound
4549
# False positives
4650
- message: '#Call to an undefined method Negotiation\\AcceptHeader::getType\(\).#'
4751
-
@@ -78,32 +82,17 @@ parameters:
7882
message: '#Service "test" is not registered in the container\.#'
7983
path: src/GraphQl/Tests/Type/TypesContainerTest.php
8084

81-
# Expected, due to optional interfaces
82-
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::denormalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
83-
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::normalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
84-
8585
# Expected, due to backward compatibility
8686
- '#Method GraphQL\\Type\\Definition\\WrappingType::getWrappedType\(\) invoked with 1 parameter, 0 required\.#'
8787
- '#Access to an undefined property GraphQL\\Type\\Definition\\NamedType&GraphQL\\Type\\Definition\\Type::\$name\.#'
8888
- "#Call to function method_exists\\(\\) with GraphQL\\\\Type\\\\Definition\\\\Type&GraphQL\\\\Type\\\\Definition\\\\WrappingType and 'getInnermostType' will always evaluate to true\\.#"
89-
- "#Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Console\\\\Application and 'addCommand' will always evaluate to false\\.#"
9089
- "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\PropertyInfo\\\\\\\\PropertyInfoExtractor' and 'getType' will always evaluate to true\\.#"
9190
- "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\HttpFoundation\\\\\\\\Request' and 'getContentTypeFormat' will always evaluate to true\\.#"
9291
- '#Call to an undefined method Symfony\\Component\\HttpFoundation\\Request::getContentType\(\)\.#'
9392
- "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\Serializer\\\\\\\\Serializer' and 'getSupportedTypes' will always evaluate to true\\.#"
9493
- "#Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Serializer\\\\Normalizer\\\\NormalizerInterface and 'getSupportedTypes' will always evaluate to true\\.#"
9594
- "#Call to function method_exists\\(\\) with Doctrine\\\\ODM\\\\MongoDB\\\\Configuration and 'setMetadataCache' will always evaluate to true\\.#"
9695
- "#Call to function method_exists\\(\\) with Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\|Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata and 'isChangeTrackingDef…' will always evaluate to true\\.#"
97-
-
98-
message: '#Instanceof between Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface and Symfony\\Component\\Serializer\\NameConverter\\MetadataAwareNameConverter will always evaluate to false\.#'
99-
paths:
100-
- src/GraphQl/Serializer/SerializerContextBuilder.php
101-
- src/GraphQl/Type/FieldsBuilder.php
102-
-
103-
message: '#Instanceof between Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface\|null and Symfony\\Component\\Serializer\\NameConverter\\MetadataAwareNameConverter will always evaluate to false\.#'
104-
paths:
105-
- src/Serializer/AbstractConstraintViolationListNormalizer.php
106-
- src/Symfony/Validator/Serializer/ValidationExceptionNormalizer.php
10796

10897
# See https://github.com/phpstan/phpstan-symfony/issues/27
10998
-

src/Doctrine/Common/Tests/Fixtures/TestBundle/Entity/DummyFriend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use ApiPlatform\Metadata\ApiProperty;
1717
use ApiPlatform\Metadata\ApiResource;
1818
use Doctrine\ORM\Mapping as ORM;
19-
use Symfony\Component\Serializer\Annotation\Groups;
19+
use Symfony\Component\Serializer\Attribute\Groups;
2020
use Symfony\Component\Validator\Constraints as Assert;
2121

2222
/**

src/Doctrine/Common/Tests/Fixtures/TestBundle/Entity/EmbeddableDummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity;
1515

1616
use Doctrine\ORM\Mapping as ORM;
17-
use Symfony\Component\Serializer\Annotation\Groups;
17+
use Symfony\Component\Serializer\Attribute\Groups;
1818
use Symfony\Component\Validator\Constraints as Assert;
1919

2020
/**

src/Doctrine/Common/Tests/Fixtures/TestBundle/Entity/FourthLevel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use ApiPlatform\Metadata\Link;
1919
use Doctrine\Common\Collections\Collection;
2020
use Doctrine\ORM\Mapping as ORM;
21-
use Symfony\Component\Serializer\Annotation\Groups;
21+
use Symfony\Component\Serializer\Attribute\Groups;
2222

2323
/**
2424
* Fourth Level.

src/Doctrine/Common/Tests/Fixtures/TestBundle/Entity/ParentDummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace ApiPlatform\Doctrine\Common\Tests\Fixtures\TestBundle\Entity;
1515

1616
use Doctrine\ORM\Mapping as ORM;
17-
use Symfony\Component\Serializer\Annotation\Groups;
17+
use Symfony\Component\Serializer\Attribute\Groups;
1818

1919
/**
2020
* Parent Dummy.

src/Doctrine/Common/Tests/Fixtures/TestBundle/Entity/RelatedDummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
use Doctrine\Common\Collections\ArrayCollection;
2424
use Doctrine\Common\Collections\Collection;
2525
use Doctrine\ORM\Mapping as ORM;
26-
use Symfony\Component\Serializer\Annotation\Groups;
26+
use Symfony\Component\Serializer\Attribute\Groups;
2727
use Symfony\Component\Validator\Constraints as Assert;
2828

2929
/**

0 commit comments

Comments
 (0)