Skip to content

Commit 3408c31

Browse files
authored
Merge pull request #6011 from soyuka/merge-32
Merge 3.1
2 parents 5e35252 + 183b4d6 commit 3408c31

37 files changed

+347
-119
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ jobs:
8787
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
8888
restore-keys: ${{ runner.os }}-composer-
8989
- name: Update project dependencies
90-
run: composer update --no-interaction --no-progress --ansi
90+
run: |
91+
composer update --no-interaction --no-progress --ansi
9192
- name: Install PHPUnit
9293
run: vendor/bin/simple-phpunit --version
9394
- name: Cache PHPStan results
@@ -456,6 +457,7 @@ jobs:
456457
- name: Update project dependencies
457458
run: |
458459
composer update --no-interaction --no-progress --ansi
460+
composer require --dev doctrine/mongodb-odm-bundle
459461
- name: Install PHPUnit
460462
run: vendor/bin/simple-phpunit --version
461463
- name: Clear test app cache

composer.json

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
"psr/cache": "^1.0 || ^2.0 || ^3.0",
1919
"psr/container": "^1.0 || ^2.0",
2020
"symfony/deprecation-contracts": "^3.1",
21-
"symfony/http-foundation": "^6.1",
22-
"symfony/http-kernel": "^6.1",
23-
"symfony/property-access": "^6.1",
24-
"symfony/property-info": "^6.1",
25-
"symfony/serializer": "^6.1",
21+
"symfony/http-foundation": "^6.1 || ^7.0",
22+
"symfony/http-kernel": "^6.1 || ^7.0",
23+
"symfony/property-access": "^6.1 || ^7.0",
24+
"symfony/property-info": "^6.1 || ^7.0",
25+
"symfony/serializer": "^6.1 || ^7.0",
2626
"symfony/translation-contracts": "^3.3",
27-
"symfony/web-link": "^6.1",
27+
"symfony/web-link": "^6.1 || ^7.0",
2828
"willdurand/negotiation": "^3.0"
2929
},
3030
"require-dev": {
@@ -35,7 +35,6 @@
3535
"doctrine/dbal": "^3.4.0",
3636
"doctrine/doctrine-bundle": "^1.12 || ^2.0",
3737
"doctrine/mongodb-odm": "^2.2",
38-
"doctrine/mongodb-odm-bundle": "^4.0",
3938
"doctrine/orm": "^2.14",
4039
"elasticsearch/elasticsearch": "^7.11 || ^8.4",
4140
"friends-of-behat/mink-browserkit-driver": "^1.3.1",
@@ -56,36 +55,36 @@
5655
"ramsey/uuid-doctrine": "^1.4 || ^2.0",
5756
"soyuka/contexts": "v3.3.9",
5857
"soyuka/stubs-mongodb": "^1.0",
59-
"symfony/asset": "^6.1",
60-
"symfony/browser-kit": "^6.1",
61-
"symfony/cache": "^6.1",
62-
"symfony/config": "^6.1",
63-
"symfony/console": "^6.1",
64-
"symfony/css-selector": "^6.1",
65-
"symfony/dependency-injection": "^6.1.12",
66-
"symfony/doctrine-bridge": "^6.1",
67-
"symfony/dom-crawler": "^6.1",
68-
"symfony/error-handler": "^6.1",
69-
"symfony/event-dispatcher": "^6.1",
70-
"symfony/expression-language": "^6.1",
71-
"symfony/finder": "^6.1",
72-
"symfony/form": "^6.1",
73-
"symfony/framework-bundle": "^6.1",
74-
"symfony/http-client": "^6.1",
75-
"symfony/intl": "^6.1",
58+
"symfony/asset": "^6.1 || ^7.0",
59+
"symfony/browser-kit": "^6.1 || ^7.0",
60+
"symfony/cache": "^6.1 || ^7.0",
61+
"symfony/config": "^6.1 || ^7.0",
62+
"symfony/console": "^6.1 || ^7.0",
63+
"symfony/css-selector": "^6.1 || ^7.0",
64+
"symfony/dependency-injection": "^6.1 || ^7.0.12",
65+
"symfony/doctrine-bridge": "^6.1 || ^7.0",
66+
"symfony/dom-crawler": "^6.1 || ^7.0",
67+
"symfony/error-handler": "^6.1 || ^7.0",
68+
"symfony/event-dispatcher": "^6.1 || ^7.0",
69+
"symfony/expression-language": "^6.1 || ^7.0",
70+
"symfony/finder": "^6.1 || ^7.0",
71+
"symfony/form": "^6.1 || ^7.0",
72+
"symfony/framework-bundle": "^6.1 || ^7.0",
73+
"symfony/http-client": "^6.1 || ^7.0",
74+
"symfony/intl": "^6.1 || ^7.0",
7675
"symfony/maker-bundle": "^1.24",
7776
"symfony/mercure-bundle": "*",
78-
"symfony/messenger": "^6.1",
79-
"symfony/phpunit-bridge": "^6.1",
80-
"symfony/routing": "^6.1",
81-
"symfony/security-bundle": "^6.1",
82-
"symfony/security-core": "^6.1",
83-
"symfony/stopwatch": "^6.1",
84-
"symfony/twig-bundle": "^6.1",
85-
"symfony/uid": "^6.1",
86-
"symfony/validator": "^6.1",
87-
"symfony/web-profiler-bundle": "^6.1",
88-
"symfony/yaml": "^6.1",
77+
"symfony/messenger": "^6.1 || ^7.0",
78+
"symfony/phpunit-bridge": "^6.1 || ^7.0",
79+
"symfony/routing": "^6.1 || ^7.0",
80+
"symfony/security-bundle": "^6.1 || ^7.0",
81+
"symfony/security-core": "^6.1 || ^7.0",
82+
"symfony/stopwatch": "^6.1 || ^7.0",
83+
"symfony/twig-bundle": "^6.1 || ^7.0",
84+
"symfony/uid": "^6.1 || ^7.0",
85+
"symfony/validator": "^6.1 || ^7.0",
86+
"symfony/web-profiler-bundle": "^6.1 || ^7.0",
87+
"symfony/yaml": "^6.1 || ^7.0",
8988
"twig/twig": "^1.42.3 || ^2.12 || ^3.0",
9089
"webonyx/graphql-php": "^14.0 || ^15.0"
9190
},
@@ -145,7 +144,7 @@
145144
"dev-main": "3.3.x-dev"
146145
},
147146
"symfony": {
148-
"require": "^6.1"
147+
"require": "^6.1 || ^7.0"
149148
}
150149
}
151150
}

features/json/relation.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ Feature: JSON relations support
2525
"badFourthLevel": null,
2626
"id": 1,
2727
"level": 3,
28-
"test": true
28+
"test": true,
29+
"relatedDummies": []
2930
}
3031
"""
3132

features/jsonapi/related-resouces-inclusion.feature

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,18 @@ Feature: JSON API Inclusion of Related Resources
483483
"type": "FourthLevel",
484484
"id": "/fourth_levels/1"
485485
}
486+
},
487+
"relatedDummies": {
488+
"data": [
489+
{
490+
"type": "RelatedDummy",
491+
"id": "/related_dummies/1"
492+
},
493+
{
494+
"type": "RelatedDummy",
495+
"id": "/related_dummies/2"
496+
}
497+
]
486498
}
487499
}
488500
},
@@ -581,6 +593,16 @@ Feature: JSON API Inclusion of Related Resources
581593
"_id": 1,
582594
"level": 3,
583595
"test": true
596+
},
597+
"relationships": {
598+
"relatedDummies": {
599+
"data": [
600+
{
601+
"type": "RelatedDummy",
602+
"id": "/related_dummies/1"
603+
}
604+
]
605+
}
584606
}
585607
},
586608
{
@@ -618,6 +640,16 @@ Feature: JSON API Inclusion of Related Resources
618640
"_id": 2,
619641
"level": 3,
620642
"test": true
643+
},
644+
"relationships": {
645+
"relatedDummies": {
646+
"data": [
647+
{
648+
"type": "RelatedDummy",
649+
"id": "/related_dummies/2"
650+
}
651+
]
652+
}
621653
}
622654
},
623655
{
@@ -655,6 +687,16 @@ Feature: JSON API Inclusion of Related Resources
655687
"_id": 3,
656688
"level": 3,
657689
"test": true
690+
},
691+
"relationships": {
692+
"relatedDummies": {
693+
"data": [
694+
{
695+
"type": "RelatedDummy",
696+
"id": "/related_dummies/3"
697+
}
698+
]
699+
}
658700
}
659701
}
660702
]
@@ -802,6 +844,24 @@ Feature: JSON API Inclusion of Related Resources
802844
"_id": 1,
803845
"level": 3,
804846
"test": true
847+
},
848+
"relationships": {
849+
"relatedDummies": {
850+
"data": [
851+
{
852+
"type": "RelatedDummy",
853+
"id": "/related_dummies/1"
854+
},
855+
{
856+
"type": "RelatedDummy",
857+
"id": "/related_dummies/2"
858+
},
859+
{
860+
"type": "RelatedDummy",
861+
"id": "/related_dummies/3"
862+
}
863+
]
864+
}
805865
}
806866
},
807867
{
@@ -1286,6 +1346,16 @@ Feature: JSON API Inclusion of Related Resources
12861346
"_id": 1,
12871347
"level": 3,
12881348
"test": true
1349+
},
1350+
"relationships": {
1351+
"relatedDummies": {
1352+
"data": [
1353+
{
1354+
"type": "RelatedDummy",
1355+
"id": "/related_dummies/1"
1356+
}
1357+
]
1358+
}
12891359
}
12901360
},
12911361
{
@@ -1323,6 +1393,16 @@ Feature: JSON API Inclusion of Related Resources
13231393
"_id": 2,
13241394
"level": 3,
13251395
"test": true
1396+
},
1397+
"relationships": {
1398+
"relatedDummies": {
1399+
"data": [
1400+
{
1401+
"type": "RelatedDummy",
1402+
"id": "/related_dummies/2"
1403+
}
1404+
]
1405+
}
13261406
}
13271407
},
13281408
{
@@ -1360,6 +1440,16 @@ Feature: JSON API Inclusion of Related Resources
13601440
"_id": 3,
13611441
"level": 3,
13621442
"test": true
1443+
},
1444+
"relationships": {
1445+
"relatedDummies": {
1446+
"data": [
1447+
{
1448+
"type": "RelatedDummy",
1449+
"id": "/related_dummies/3"
1450+
}
1451+
]
1452+
}
13631453
}
13641454
}
13651455
]

features/main/relation.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Feature: Relations support
2323
"badFourthLevel": null,
2424
"id": 1,
2525
"level": 3,
26-
"test": true
26+
"test": true,
27+
"relatedDummies": []
2728
}
2829
"""
2930

features/main/sub_resource.feature

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ Feature: Sub-resource support
376376
"badFourthLevel": null,
377377
"id": 1,
378378
"level": 3,
379-
"test": true
379+
"test": true,
380+
"relatedDummies": [
381+
"/related_dummies/1",
382+
"/related_dummies/2"
383+
]
380384
}
381385
"""
382386

features/openapi/docs.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,27 @@ Feature: Documentation support
368368
And I send a "GET" request to "/"
369369
Then the response status code should be 200
370370
And the header "Content-Type" should be equal to "text/html; charset=utf-8"
371+
372+
@!mongodb
373+
Scenario: Retrieve the OpenAPI documentation for Entity Dto Wrappers
374+
Given I send a "GET" request to "/docs.json"
375+
Then the response status code should be 200
376+
And the response should be in JSON
377+
And the header "Content-Type" should be equal to "application/json; charset=utf-8"
378+
And the OpenAPI class "WrappedResponseEntity-read" exists
379+
And the "id" property exists for the OpenAPI class "WrappedResponseEntity-read"
380+
And the "id" property for the OpenAPI class "WrappedResponseEntity-read" should be equal to:
381+
"""
382+
{
383+
"type": "string"
384+
}
385+
"""
386+
And the OpenAPI class "WrappedResponseEntity.CustomOutputEntityWrapperDto-read" exists
387+
And the "data" property exists for the OpenAPI class "WrappedResponseEntity.CustomOutputEntityWrapperDto-read"
388+
And the "data" property for the OpenAPI class "WrappedResponseEntity.CustomOutputEntityWrapperDto-read" should be equal to:
389+
"""
390+
{
391+
"owl:maxCardinality": 1,
392+
"$ref": "#\/components\/schemas\/WrappedResponseEntity-read"
393+
}
394+
"""

phpstan.neon.dist

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ parameters:
2626
- src/Symfony/Bundle/DependencyInjection/Configuration.php
2727
# Templates for Maker
2828
- src/Symfony/Maker/Resources/skeleton
29+
# subtree split
2930
- **vendor**
31+
# Symfony 6 support
32+
- src/OpenApi/Serializer/CacheableSupportsMethodInterface.php
33+
- src/Serializer/CacheableSupportsMethodInterface.php
34+
- tests/Hal/Serializer/ItemNormalizerTest.php
35+
- tests/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php
3036
earlyTerminatingMethodCalls:
3137
PHPUnit\Framework\Constraint\Constraint:
3238
- fail
@@ -72,7 +78,6 @@ parameters:
7278
# Expected, due to optional interfaces
7379
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::denormalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
7480
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::normalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
75-
- '#Method Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface::supportsNormalization\(\) invoked with 3 parameters, 1-2 required\.#'
7681

7782
# Expected, due to backward compatibility
7883
-
@@ -90,3 +95,6 @@ parameters:
9095
-
9196
message: '#^Class .+ not found.$#'
9297
path: src/Elasticsearch/Tests
98+
# Backward compatibility
99+
- '#Call to method hasCacheableSupportsMethod\(\) on an unknown class Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface\.#'
100+
- '#Class Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface not found\.#'

src/Doctrine/Orm/Extension/EagerLoadingExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ private function joinRelations(QueryBuilder $queryBuilder, QueryNameGeneratorInt
169169
if (
170170
null !== $parentAssociation
171171
&& isset($mapping['inversedBy'])
172+
&& $mapping['sourceEntity'] === $mapping['targetEntity']
172173
&& $mapping['inversedBy'] === $parentAssociation
173174
&& $mapping['type'] & ClassMetadata::TO_ONE
174175
) {

src/Elasticsearch/Serializer/DocumentNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct(
5858
*/
5959
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
6060
{
61-
return self::FORMAT === $format && $this->decoratedNormalizer->supportsDenormalization($data, $type, $format, $context); // @phpstan-ignore-line symfony bc-layer
61+
return self::FORMAT === $format && $this->decoratedNormalizer->supportsDenormalization($data, $type, $format, $context);
6262
}
6363

6464
/**

0 commit comments

Comments
 (0)