Skip to content

Commit

Permalink
Merge pull request #6011 from soyuka/merge-32
Browse files Browse the repository at this point in the history
Merge 3.1
  • Loading branch information
soyuka committed Nov 30, 2023
2 parents 5e35252 + 183b4d6 commit 3408c31
Show file tree
Hide file tree
Showing 37 changed files with 347 additions and 119 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Update project dependencies
run: composer update --no-interaction --no-progress --ansi
run: |
composer update --no-interaction --no-progress --ansi
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Cache PHPStan results
Expand Down Expand Up @@ -456,6 +457,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
71 changes: 35 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 || ^8.4",
"friends-of-behat/mink-browserkit-driver": "^1.3.1",
Expand All @@ -56,36 +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/stopwatch": "^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 @@ -145,7 +144,7 @@
"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
24 changes: 24 additions & 0 deletions features/openapi/docs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -368,3 +368,27 @@ Feature: Documentation support
And I send a "GET" request to "/"
Then the response status code should be 200
And the header "Content-Type" should be equal to "text/html; charset=utf-8"

@!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:
"""
{
"owl:maxCardinality": 1,
"$ref": "#\/components\/schemas\/WrappedResponseEntity-read"
}
"""
10 changes: 9 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ parameters:
- src/Symfony/Bundle/DependencyInjection/Configuration.php
# Templates for Maker
- src/Symfony/Maker/Resources/skeleton
# subtree split
- **vendor**
# Symfony 6 support
- src/OpenApi/Serializer/CacheableSupportsMethodInterface.php
- src/Serializer/CacheableSupportsMethodInterface.php
- tests/Hal/Serializer/ItemNormalizerTest.php
- tests/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php
earlyTerminatingMethodCalls:
PHPUnit\Framework\Constraint\Constraint:
- fail
Expand Down Expand Up @@ -72,7 +78,6 @@ parameters:
# Expected, due to optional interfaces
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::denormalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::normalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
- '#Method Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface::supportsNormalization\(\) invoked with 3 parameters, 1-2 required\.#'

# Expected, due to backward compatibility
-
Expand All @@ -90,3 +95,6 @@ parameters:
-
message: '#^Class .+ not found.$#'
path: src/Elasticsearch/Tests
# Backward compatibility
- '#Call to method hasCacheableSupportsMethod\(\) on an unknown class Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface\.#'
- '#Class Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface not found\.#'
1 change: 1 addition & 0 deletions src/Doctrine/Orm/Extension/EagerLoadingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,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
2 changes: 1 addition & 1 deletion src/Elasticsearch/Serializer/DocumentNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(
*/
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
{
return self::FORMAT === $format && $this->decoratedNormalizer->supportsDenormalization($data, $type, $format, $context); // @phpstan-ignore-line symfony bc-layer
return self::FORMAT === $format && $this->decoratedNormalizer->supportsDenormalization($data, $type, $format, $context);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Elasticsearch/Serializer/ItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function supportsDenormalization(mixed $data, string $type, string $forma
throw new LogicException(sprintf('The decorated normalizer must be an instance of "%s".', DenormalizerInterface::class));
}

return DocumentNormalizer::FORMAT !== $format && $this->decorated->supportsDenormalization($data, $type, $format, $context); // @phpstan-ignore-line symfony bc-layer
return DocumentNormalizer::FORMAT !== $format && $this->decorated->supportsDenormalization($data, $type, $format, $context);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Elasticsearch/Tests/Serializer/ItemNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ public function testGetSupportedTypes(): void

// TODO: use prophecy when getSupportedTypes() will be added to the interface
$this->itemNormalizer = new ItemNormalizer(new class() implements NormalizerInterface {
public function normalize(mixed $object, string $format = null, array $context = [])
public function normalize(mixed $object, string $format = null, array $context = []): \ArrayObject|array|string|int|float|bool|null
{
return null;
}

public function supportsNormalization(mixed $data, string $format = null): bool
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
{
return true;
}
Expand Down

0 comments on commit 3408c31

Please sign in to comment.