Skip to content

Commit 0d37caa

Browse files
authored
Merge pull request api-platform#4503 from dunglas/feat/symfony-5.4
Compatibility with Symfony 5.4
2 parents 25c71b2 + 87ad91f commit 0d37caa

File tree

211 files changed

+836
-996
lines changed

Some content is hidden

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

211 files changed

+836
-996
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ jobs:
1515
strategy:
1616
matrix:
1717
php:
18-
- '7.4'
18+
- '8.0'
1919
fail-fast: false
20-
env:
21-
PHP_CS_FIXER_FUTURE_MODE: '1'
2220
steps:
2321
- name: Checkout
2422
uses: actions/checkout@v2
@@ -40,7 +38,7 @@ jobs:
4038
strategy:
4139
matrix:
4240
php:
43-
- '7.4'
41+
- '8.0'
4442
fail-fast: false
4543
env:
4644
APP_DEBUG: '1' # https://github.com/phpstan/phpstan-symfony/issues/37

.php-cs-fixer.dist.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
'@PHPUnit60Migration:risky' => true,
3636
'@Symfony' => true,
3737
'@Symfony:risky' => true,
38-
'single_line_comment_style' => false, // Temporary fix for compatibility with PHP 8 attributes, see https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/5284
39-
'comment_to_phpdoc' => true, // Temporary fix for compatibility with PHP 8 attributes, see https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/5284
4038
'align_multiline_comment' => [
4139
'comment_type' => 'phpdocs_like',
4240
],
@@ -75,9 +73,10 @@
7573
],
7674
],
7775
'no_superfluous_elseif' => true,
78-
'no_superfluous_phpdoc_tags' => [
79-
'allow_mixed' => false,
80-
],
76+
// To re-enable in API Platform 3: https://github.com/symfony/symfony/issues/43021
77+
//'no_superfluous_phpdoc_tags' => [
78+
// 'allow_mixed' => false,
79+
//],
8180
'no_unset_cast' => true,
8281
'no_unset_on_property' => true,
8382
'no_useless_else' => true,

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"symfony/form": "^3.4 || ^4.4 || ^5.1",
7373
"symfony/framework-bundle": "^4.4 || ^5.1",
7474
"symfony/http-client": "^4.4 || ^5.1",
75+
"symfony/intl": "^4.4 || ^5.3",
7576
"symfony/mercure-bundle": "*",
7677
"symfony/messenger": "^4.4 || ^5.1",
7778
"symfony/phpunit-bridge": "^5.1.7",

features/main/custom_normalized.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Feature: Using custom normalized entity
5353
}
5454
"""
5555

56-
Scenario: Create a resource with a custom normalized dummy and an id
56+
Scenario: Update a resource with a custom normalized dummy and an id
5757
When I add "Content-Type" header equal to "application/json"
5858
When I add "Accept" header equal to "application/json"
5959
And I send a "PUT" request to "/related_normalized_dummies/1" with body:

phpstan.neon.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ parameters:
8686
path: tests/GraphQl/Type/TypesContainerTest.php
8787

8888
# Expected, due to PHP 8 attributes
89-
- '#ReflectionProperty::getAttributes\(\)#'
90-
- '#ReflectionMethod::getAttributes\(\)#'
91-
- '#ReflectionClass<object>::getAttributes\(\)#'
9289
- '#Constructor of class ApiPlatform\\Core\\Annotation\\ApiResource has an unused parameter#'
9390
- '#Constructor of class ApiPlatform\\Core\\Annotation\\ApiProperty has an unused parameter#'
9491

src/Api/ResourceClassResolverInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface ResourceClassResolverInterface
2727
*
2828
* @param string $resourceClass The expected resource class
2929
* @param bool $strict If true, value must match the expected resource class
30+
* @param mixed $value
3031
*
3132
* @throws InvalidArgumentException
3233
*/

src/Bridge/Doctrine/Common/DataPersister.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public function remove($data, array $context = [])
7878

7979
/**
8080
* Gets the Doctrine object manager associated with given data.
81+
*
82+
* @param mixed $data
8183
*/
8284
private function getManager($data): ?DoctrineObjectManager
8385
{
@@ -86,6 +88,8 @@ private function getManager($data): ?DoctrineObjectManager
8688

8789
/**
8890
* Checks if doctrine does not manage data automatically.
91+
*
92+
* @param mixed $data
8993
*/
9094
private function isDeferredExplicit(DoctrineObjectManager $manager, $data): bool
9195
{

src/Bridge/Doctrine/EventListener/WriteListener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public function onKernelView(ViewEvent $event): void
7171

7272
/**
7373
* Gets the manager if applicable.
74+
*
75+
* @param mixed $data
7476
*/
7577
private function getManager(string $resourceClass, $data): ?ObjectManager
7678
{

src/Bridge/Doctrine/MongoDbOdm/CollectionDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function supports(string $resourceClass, string $operationName = null, ar
5656
*
5757
* @throws RuntimeException
5858
*/
59-
public function getCollection(string $resourceClass, string $operationName = null, array $context = [])
59+
public function getCollection(string $resourceClass, string $operationName = null, array $context = []): iterable
6060
{
6161
/** @var DocumentManager $manager */
6262
$manager = $this->managerRegistry->getManagerForClass($resourceClass);

src/Bridge/Doctrine/MongoDbOdm/Filter/AbstractFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ public function apply(Builder $aggregationBuilder, string $resourceClass, string
6060

6161
/**
6262
* Passes a property through the filter.
63+
*
64+
* @param mixed $value
6365
*/
6466
abstract protected function filterProperty(string $property, $value, Builder $aggregationBuilder, string $resourceClass, string $operationName = null, array &$context = []);
6567

0 commit comments

Comments
 (0)