Skip to content

symfony ^6.3 || 7 #6007

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

Closed
wants to merge 13 commits into from
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: latest
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
ini-values: memory_limit=-1
Expand Down Expand Up @@ -451,6 +451,7 @@ jobs:
- name: Update project dependencies
run: |
composer update --no-interaction --no-progress --ansi
composer require --dev doctrine/mongodb-odm-bundle
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Clear test app cache
Expand Down
73 changes: 37 additions & 36 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"psr/container": "^1.0 || ^2.0",
"symfony/deprecation-contracts": "^3.1",
"symfony/http-foundation": "^6.1",
"symfony/http-kernel": "^6.1",
"symfony/property-access": "^6.1",
"symfony/property-info": "^6.1",
"symfony/serializer": "^6.1",
"symfony/http-foundation": "^6.1 || ^7.0",
"symfony/http-kernel": "^6.1 || ^7.0",
"symfony/property-access": "^6.1 || ^7.0",
"symfony/property-info": "^6.1 || ^7.0",
"symfony/serializer": "^6.1 || ^7.0",
"symfony/translation-contracts": "^3.3",
"symfony/web-link": "^6.1",
"symfony/web-link": "^6.1 || ^7.0",
"willdurand/negotiation": "^3.0"
},
"require-dev": {
Expand All @@ -35,7 +35,6 @@
"doctrine/dbal": "^3.4.0",
"doctrine/doctrine-bundle": "^1.12 || ^2.0",
"doctrine/mongodb-odm": "^2.2",
"doctrine/mongodb-odm-bundle": "^4.0",
"doctrine/orm": "^2.14",
"elasticsearch/elasticsearch": "^7.11.0",
"friends-of-behat/mink-browserkit-driver": "^1.3.1",
Expand All @@ -56,35 +55,36 @@
"ramsey/uuid-doctrine": "^1.4 || ^2.0",
"soyuka/contexts": "v3.3.9",
"soyuka/stubs-mongodb": "^1.0",
"symfony/asset": "^6.1",
"symfony/browser-kit": "^6.1",
"symfony/cache": "^6.1",
"symfony/config": "^6.1",
"symfony/console": "^6.1",
"symfony/css-selector": "^6.1",
"symfony/dependency-injection": "^6.1.12",
"symfony/doctrine-bridge": "^6.1",
"symfony/dom-crawler": "^6.1",
"symfony/error-handler": "^6.1",
"symfony/event-dispatcher": "^6.1",
"symfony/expression-language": "^6.1",
"symfony/finder": "^6.1",
"symfony/form": "^6.1",
"symfony/framework-bundle": "^6.1",
"symfony/http-client": "^6.1",
"symfony/intl": "^6.1",
"symfony/asset": "^6.1 || ^7.0",
"symfony/browser-kit": "^6.1 || ^7.0",
"symfony/cache": "^6.1 || ^7.0",
"symfony/config": "^6.1 || ^7.0",
"symfony/console": "^6.1 || ^7.0",
"symfony/css-selector": "^6.1 || ^7.0",
"symfony/dependency-injection": "^6.1 || ^7.0.12",
"symfony/doctrine-bridge": "^6.1 || ^7.0",
"symfony/dom-crawler": "^6.1 || ^7.0",
"symfony/error-handler": "^6.1 || ^7.0",
"symfony/event-dispatcher": "^6.1 || ^7.0",
"symfony/expression-language": "^6.1 || ^7.0",
"symfony/finder": "^6.1 || ^7.0",
"symfony/form": "^6.1 || ^7.0",
"symfony/framework-bundle": "^6.1 || ^7.0",
"symfony/http-client": "^6.1 || ^7.0",
"symfony/intl": "^6.1 || ^7.0",
"symfony/maker-bundle": "^1.24",
"symfony/mercure-bundle": "*",
"symfony/messenger": "^6.1",
"symfony/phpunit-bridge": "^6.1",
"symfony/routing": "^6.1",
"symfony/security-bundle": "^6.1",
"symfony/security-core": "^6.1",
"symfony/twig-bundle": "^6.1",
"symfony/uid": "^6.1",
"symfony/validator": "^6.1",
"symfony/web-profiler-bundle": "^6.1",
"symfony/yaml": "^6.1",
"symfony/messenger": "^6.1 || ^7.0",
"symfony/phpunit-bridge": "^6.1 || ^7.0",
"symfony/routing": "^6.1 || ^7.0",
"symfony/security-bundle": "^6.1 || ^7.0",
"symfony/security-core": "^6.1 || ^7.0",
"symfony/stopwatch": "^6.1 || ^7.0",
"symfony/twig-bundle": "^6.1 || ^7.0",
"symfony/uid": "^6.1 || ^7.0",
"symfony/validator": "^6.1 || ^7.0",
"symfony/web-profiler-bundle": "^6.1 || ^7.0",
"symfony/yaml": "^6.1 || ^7.0",
"twig/twig": "^1.42.3 || ^2.12 || ^3.0",
"webonyx/graphql-php": "^14.0 || ^15.0"
},
Expand Down Expand Up @@ -135,15 +135,16 @@
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"php-http/discovery": true
}
},
"extra": {
"branch-alias": {
"dev-main": "3.3.x-dev"
},
"symfony": {
"require": "^6.1"
"require": "^6.1 || ^7.0"
}
}
}
3 changes: 2 additions & 1 deletion features/json/relation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Feature: JSON relations support
"badFourthLevel": null,
"id": 1,
"level": 3,
"test": true
"test": true,
"relatedDummies": []
}
"""

Expand Down
90 changes: 90 additions & 0 deletions features/jsonapi/related-resouces-inclusion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,18 @@ Feature: JSON API Inclusion of Related Resources
"type": "FourthLevel",
"id": "/fourth_levels/1"
}
},
"relatedDummies": {
"data": [
{
"type": "RelatedDummy",
"id": "/related_dummies/1"
},
{
"type": "RelatedDummy",
"id": "/related_dummies/2"
}
]
}
}
},
Expand Down Expand Up @@ -581,6 +593,16 @@ Feature: JSON API Inclusion of Related Resources
"_id": 1,
"level": 3,
"test": true
},
"relationships": {
"relatedDummies": {
"data": [
{
"type": "RelatedDummy",
"id": "/related_dummies/1"
}
]
}
}
},
{
Expand Down Expand Up @@ -618,6 +640,16 @@ Feature: JSON API Inclusion of Related Resources
"_id": 2,
"level": 3,
"test": true
},
"relationships": {
"relatedDummies": {
"data": [
{
"type": "RelatedDummy",
"id": "/related_dummies/2"
}
]
}
}
},
{
Expand Down Expand Up @@ -655,6 +687,16 @@ Feature: JSON API Inclusion of Related Resources
"_id": 3,
"level": 3,
"test": true
},
"relationships": {
"relatedDummies": {
"data": [
{
"type": "RelatedDummy",
"id": "/related_dummies/3"
}
]
}
}
}
]
Expand Down Expand Up @@ -802,6 +844,24 @@ Feature: JSON API Inclusion of Related Resources
"_id": 1,
"level": 3,
"test": true
},
"relationships": {
"relatedDummies": {
"data": [
{
"type": "RelatedDummy",
"id": "/related_dummies/1"
},
{
"type": "RelatedDummy",
"id": "/related_dummies/2"
},
{
"type": "RelatedDummy",
"id": "/related_dummies/3"
}
]
}
}
},
{
Expand Down Expand Up @@ -1286,6 +1346,16 @@ Feature: JSON API Inclusion of Related Resources
"_id": 1,
"level": 3,
"test": true
},
"relationships": {
"relatedDummies": {
"data": [
{
"type": "RelatedDummy",
"id": "/related_dummies/1"
}
]
}
}
},
{
Expand Down Expand Up @@ -1323,6 +1393,16 @@ Feature: JSON API Inclusion of Related Resources
"_id": 2,
"level": 3,
"test": true
},
"relationships": {
"relatedDummies": {
"data": [
{
"type": "RelatedDummy",
"id": "/related_dummies/2"
}
]
}
}
},
{
Expand Down Expand Up @@ -1360,6 +1440,16 @@ Feature: JSON API Inclusion of Related Resources
"_id": 3,
"level": 3,
"test": true
},
"relationships": {
"relatedDummies": {
"data": [
{
"type": "RelatedDummy",
"id": "/related_dummies/3"
}
]
}
}
}
]
Expand Down
3 changes: 2 additions & 1 deletion features/main/relation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Feature: Relations support
"badFourthLevel": null,
"id": 1,
"level": 3,
"test": true
"test": true,
"relatedDummies": []
}
"""

Expand Down
6 changes: 5 additions & 1 deletion features/main/sub_resource.feature
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,11 @@ Feature: Sub-resource support
"badFourthLevel": null,
"id": 1,
"level": 3,
"test": true
"test": true,
"relatedDummies": [
"/related_dummies/1",
"/related_dummies/2"
]
}
"""

Expand Down
23 changes: 23 additions & 0 deletions features/openapi/docs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,26 @@ Feature: Documentation support
"nullable":true
}
"""

@!mongodb
Scenario: Retrieve the OpenAPI documentation for Entity Dto Wrappers
Given I send a "GET" request to "/docs.json"
Then the response status code should be 200
And the response should be in JSON
And the header "Content-Type" should be equal to "application/json; charset=utf-8"
And the OpenAPI class "WrappedResponseEntity-read" exists
And the "id" property exists for the OpenAPI class "WrappedResponseEntity-read"
And the "id" property for the OpenAPI class "WrappedResponseEntity-read" should be equal to:
"""
{
"type": "string"
}
"""
And the OpenAPI class "WrappedResponseEntity.CustomOutputEntityWrapperDto-read" exists
And the "data" property exists for the OpenAPI class "WrappedResponseEntity.CustomOutputEntityWrapperDto-read"
And the "data" property for the OpenAPI class "WrappedResponseEntity.CustomOutputEntityWrapperDto-read" should be equal to:
"""
{
"$ref": "#\/components\/schemas\/WrappedResponseEntity-read"
}
"""
2 changes: 1 addition & 1 deletion src/Doctrine/Common/Filter/SearchFilterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ abstract protected function getProperties(): ?array;

abstract protected function getLogger(): LoggerInterface;

abstract protected function getIriConverter(): IriConverterInterface;
abstract protected function getIriConverter(): LegacyIriConverterInterface|IriConverterInterface;

abstract protected function getPropertyAccessor(): PropertyAccessorInterface;

Expand Down
1 change: 1 addition & 0 deletions src/Doctrine/Orm/Extension/EagerLoadingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ private function joinRelations(QueryBuilder $queryBuilder, QueryNameGeneratorInt
if (
null !== $parentAssociation
&& isset($mapping['inversedBy'])
&& $mapping['sourceEntity'] === $mapping['targetEntity']
&& $mapping['inversedBy'] === $parentAssociation
&& $mapping['type'] & ClassMetadata::TO_ONE
) {
Expand Down
8 changes: 7 additions & 1 deletion src/GraphQl/Type/FieldsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,14 @@ public function getEnumFields(string $enumClass): array
$rEnum = new \ReflectionEnum($enumClass);

$enumCases = [];
/* @var \ReflectionEnumUnitCase|\ReflectionEnumBackedCase */
foreach ($rEnum->getCases() as $rCase) {
$enumCase = ['value' => $rCase->getBackingValue()];
if ($rCase instanceof \ReflectionEnumBackedCase) {
$enumCase = ['value' => $rCase->getBackingValue()];
} else {
$enumCase = ['value' => $rCase->getValue()];
}

$propertyMetadata = $this->propertyMetadataFactory->create($enumClass, $rCase->getName());
if ($enumCaseDescription = $propertyMetadata->getDescription()) {
$enumCase['description'] = $enumCaseDescription;
Expand Down
Loading