From 3a3a8e94efcdaf55f093467a615b3c8399076b11 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 11 Sep 2026 15:53:54 +0200 Subject: [PATCH 1/4] fix(test): use the extracted ApiTestCase namespace #7887 moved the test helpers to ApiPlatform\Test and deleted src/Symfony/Bundle/Test. 11 test files still referenced the old FQCN, either merged on main after #7887 or brought up from 4.3/4.4. The resulting fatal took down the whole PHPUnit matrix and PHPStan. Also stubs getFunction('csp_nonce') on the Twig double in EntrypointActionTest: #8310 updated GraphiQlActionTest but missed this one, which builds the same GraphiQlAction. --- src/GraphQl/Tests/Action/EntrypointActionTest.php | 1 + .../Doctrine/JoinedInheritanceSerializerGroupsTest.php | 2 +- tests/Functional/GraphQl/GraphiqlCspNonceTest.php | 2 +- tests/Functional/McpExceptionTest.php | 2 +- tests/Functional/Parameters/ChainFilterMongoDbTest.php | 2 +- tests/Functional/Parameters/ChainFilterTest.php | 2 +- tests/Functional/Parameters/ParameterOnPropertiesTest.php | 2 +- .../Functional/Parameters/UriVariableParameterProviderTest.php | 2 +- tests/Functional/RepeatedDefaultParametersTest.php | 2 +- tests/Functional/Serializer/EmbeddedRelationNativeTypeTest.php | 2 +- tests/Functional/Serializer/SharedRouteIriTest.php | 2 +- tests/Functional/SwaggerUiCspNonceTest.php | 2 +- 12 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/GraphQl/Tests/Action/EntrypointActionTest.php b/src/GraphQl/Tests/Action/EntrypointActionTest.php index 3da6d37c96c..3e6a5bac9ed 100644 --- a/src/GraphQl/Tests/Action/EntrypointActionTest.php +++ b/src/GraphQl/Tests/Action/EntrypointActionTest.php @@ -265,6 +265,7 @@ private function getEntrypointAction(array $variables = ['graphqlVariable']): En $twigProphecy = $this->prophesize(TwigEnvironment::class); $twigProphecy->render(Argument::cetera())->willReturn(''); + $twigProphecy->getFunction('csp_nonce')->willReturn(null); $routerProphecy = $this->prophesize(RouterInterface::class); $routerProphecy->generate('api_graphql_entrypoint')->willReturn('/graphiql'); diff --git a/tests/Functional/Doctrine/JoinedInheritanceSerializerGroupsTest.php b/tests/Functional/Doctrine/JoinedInheritanceSerializerGroupsTest.php index e9a714cada5..8b4221de2e0 100644 --- a/tests/Functional/Doctrine/JoinedInheritanceSerializerGroupsTest.php +++ b/tests/Functional/Doctrine/JoinedInheritanceSerializerGroupsTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional\Doctrine; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue8113\BarJoined; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue8113\BarJoinedA; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue8113\BarJoinedB; diff --git a/tests/Functional/GraphQl/GraphiqlCspNonceTest.php b/tests/Functional/GraphQl/GraphiqlCspNonceTest.php index d773636a7c0..18e1c97ba5e 100644 --- a/tests/Functional/GraphQl/GraphiqlCspNonceTest.php +++ b/tests/Functional/GraphQl/GraphiqlCspNonceTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional\GraphQl; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Event\RequestEvent; diff --git a/tests/Functional/McpExceptionTest.php b/tests/Functional/McpExceptionTest.php index d1707c0d472..a3fc54fcf40 100644 --- a/tests/Functional/McpExceptionTest.php +++ b/tests/Functional/McpExceptionTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\McpExceptionTools; use ApiPlatform\Tests\RecreateSchemaTrait; use ApiPlatform\Tests\SetupClassResourcesTrait; diff --git a/tests/Functional/Parameters/ChainFilterMongoDbTest.php b/tests/Functional/Parameters/ChainFilterMongoDbTest.php index f3fd5c6c851..bb425f520bf 100644 --- a/tests/Functional/Parameters/ChainFilterMongoDbTest.php +++ b/tests/Functional/Parameters/ChainFilterMongoDbTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional\Parameters; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\Document\ChainFilterParameter; use ApiPlatform\Tests\RecreateSchemaTrait; use ApiPlatform\Tests\SetupClassResourcesTrait; diff --git a/tests/Functional/Parameters/ChainFilterTest.php b/tests/Functional/Parameters/ChainFilterTest.php index c68aa900da3..8f3ce6aee1e 100644 --- a/tests/Functional/Parameters/ChainFilterTest.php +++ b/tests/Functional/Parameters/ChainFilterTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional\Parameters; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\ChainFilterParameter; use ApiPlatform\Tests\RecreateSchemaTrait; use ApiPlatform\Tests\SetupClassResourcesTrait; diff --git a/tests/Functional/Parameters/ParameterOnPropertiesTest.php b/tests/Functional/Parameters/ParameterOnPropertiesTest.php index cd0d5c04ccf..4dbd3e85119 100644 --- a/tests/Functional/Parameters/ParameterOnPropertiesTest.php +++ b/tests/Functional/Parameters/ParameterOnPropertiesTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional\Parameters; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\Document\ParameterOnProperties as DocumentParameterOnProperties; use ApiPlatform\Tests\Fixtures\TestBundle\Document\ParameterOnPropertiesWithHeaderParameter as DocumentParameterOnPropertiesWithHeaderParameter; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\ParameterOnProperties; diff --git a/tests/Functional/Parameters/UriVariableParameterProviderTest.php b/tests/Functional/Parameters/UriVariableParameterProviderTest.php index a9437169b34..b7307a9cc27 100644 --- a/tests/Functional/Parameters/UriVariableParameterProviderTest.php +++ b/tests/Functional/Parameters/UriVariableParameterProviderTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional\Parameters; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\WriteUriVariableLinkResource; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Base64UriVariableDummy; use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Dummy; diff --git a/tests/Functional/RepeatedDefaultParametersTest.php b/tests/Functional/RepeatedDefaultParametersTest.php index 9b713b562fb..db0b2f6bd46 100644 --- a/tests/Functional/RepeatedDefaultParametersTest.php +++ b/tests/Functional/RepeatedDefaultParametersTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; final class RepeatedDefaultParametersTest extends ApiTestCase { diff --git a/tests/Functional/Serializer/EmbeddedRelationNativeTypeTest.php b/tests/Functional/Serializer/EmbeddedRelationNativeTypeTest.php index 849bca7ed06..cfd823a7c0d 100644 --- a/tests/Functional/Serializer/EmbeddedRelationNativeTypeTest.php +++ b/tests/Functional/Serializer/EmbeddedRelationNativeTypeTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional\Serializer; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\EmbeddedRelationNativeType\EmbeddedRelationChild; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\EmbeddedRelationNativeType\EmbeddedRelationParent; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\EmbeddedRelationNativeType\EmbeddedRelationTarget; diff --git a/tests/Functional/Serializer/SharedRouteIriTest.php b/tests/Functional/Serializer/SharedRouteIriTest.php index 2e285140490..4585b40c05b 100644 --- a/tests/Functional/Serializer/SharedRouteIriTest.php +++ b/tests/Functional/Serializer/SharedRouteIriTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional\Serializer; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\SharedRouteIri\CategoryProjection; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\SharedRouteIri\CategoryResource; use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\SharedRouteIri\TopicResource; diff --git a/tests/Functional/SwaggerUiCspNonceTest.php b/tests/Functional/SwaggerUiCspNonceTest.php index 7971b2ada76..a1731c13726 100644 --- a/tests/Functional/SwaggerUiCspNonceTest.php +++ b/tests/Functional/SwaggerUiCspNonceTest.php @@ -13,7 +13,7 @@ namespace ApiPlatform\Tests\Functional; -use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; +use ApiPlatform\Test\ApiTestCase; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Event\RequestEvent; From 515b6f4681bcd99596b40ed1a2ee93faab616fec Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 11 Sep 2026 15:53:55 +0200 Subject: [PATCH 2/4] feat(symfony): deprecate the moved test helper classes #7887 moved eight public classes out of api-platform/symfony without a deprecation path, so user test suites extending ApiTestCase break on a plain "class not found". Restore them at the old FQCNs as deprecated shims delegating to ApiPlatform\Test. Client, Response, ArraySubset and MatchesJsonSchema are final and cannot be subclassed, so they are class_alias'd; the traits are wrapped; ApiTestCase subclasses. Adds api-platform/test and symfony/deprecation-contracts to the component requirements. --- .../Bundle/Test/ApiTestAssertionsTrait.php | 26 +++++++++++++++++++ src/Symfony/Bundle/Test/ApiTestCase.php | 25 ++++++++++++++++++ src/Symfony/Bundle/Test/Client.php | 20 ++++++++++++++ src/Symfony/Bundle/Test/ClientTrait.php | 26 +++++++++++++++++++ .../Bundle/Test/Constraint/ArraySubset.php | 20 ++++++++++++++ .../Test/Constraint/ArraySubsetTrait.php | 26 +++++++++++++++++++ .../Test/Constraint/MatchesJsonSchema.php | 20 ++++++++++++++ src/Symfony/Bundle/Test/Response.php | 20 ++++++++++++++ src/Symfony/composer.json | 2 ++ 9 files changed, 185 insertions(+) create mode 100644 src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php create mode 100644 src/Symfony/Bundle/Test/ApiTestCase.php create mode 100644 src/Symfony/Bundle/Test/Client.php create mode 100644 src/Symfony/Bundle/Test/ClientTrait.php create mode 100644 src/Symfony/Bundle/Test/Constraint/ArraySubset.php create mode 100644 src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php create mode 100644 src/Symfony/Bundle/Test/Constraint/MatchesJsonSchema.php create mode 100644 src/Symfony/Bundle/Test/Response.php diff --git a/src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php b/src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php new file mode 100644 index 00000000000..9dc357ccc18 --- /dev/null +++ b/src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Symfony\Bundle\Test; + +use ApiPlatform\Test\ApiTestAssertionsTrait as BaseApiTestAssertionsTrait; + +trigger_deprecation('api-platform/core', '5.0', 'The "%s" trait is deprecated, use "%s" instead.', ApiTestAssertionsTrait::class, BaseApiTestAssertionsTrait::class); + +/** + * @deprecated since API Platform 5.0, use {@see \ApiPlatform\Test\ApiTestAssertionsTrait} instead + */ +trait ApiTestAssertionsTrait +{ + use BaseApiTestAssertionsTrait; +} diff --git a/src/Symfony/Bundle/Test/ApiTestCase.php b/src/Symfony/Bundle/Test/ApiTestCase.php new file mode 100644 index 00000000000..1862e348c99 --- /dev/null +++ b/src/Symfony/Bundle/Test/ApiTestCase.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Symfony\Bundle\Test; + +use ApiPlatform\Test\ApiTestCase as BaseApiTestCase; + +trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', ApiTestCase::class, BaseApiTestCase::class); + +/** + * @deprecated since API Platform 5.0, use {@see \ApiPlatform\Test\ApiTestCase} instead + */ +abstract class ApiTestCase extends BaseApiTestCase +{ +} diff --git a/src/Symfony/Bundle/Test/Client.php b/src/Symfony/Bundle/Test/Client.php new file mode 100644 index 00000000000..334e608037c --- /dev/null +++ b/src/Symfony/Bundle/Test/Client.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Symfony\Bundle\Test; + +use ApiPlatform\Test\Client; + +trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', 'ApiPlatform\Symfony\Bundle\Test\Client', Client::class); + +class_alias(Client::class, 'ApiPlatform\Symfony\Bundle\Test\Client'); diff --git a/src/Symfony/Bundle/Test/ClientTrait.php b/src/Symfony/Bundle/Test/ClientTrait.php new file mode 100644 index 00000000000..ff2101667cf --- /dev/null +++ b/src/Symfony/Bundle/Test/ClientTrait.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Symfony\Bundle\Test; + +use ApiPlatform\Test\ClientTrait as BaseClientTrait; + +trigger_deprecation('api-platform/core', '5.0', 'The "%s" trait is deprecated, use "%s" instead.', ClientTrait::class, BaseClientTrait::class); + +/** + * @deprecated since API Platform 5.0, use {@see \ApiPlatform\Test\ClientTrait} instead + */ +trait ClientTrait +{ + use BaseClientTrait; +} diff --git a/src/Symfony/Bundle/Test/Constraint/ArraySubset.php b/src/Symfony/Bundle/Test/Constraint/ArraySubset.php new file mode 100644 index 00000000000..bef08de6f98 --- /dev/null +++ b/src/Symfony/Bundle/Test/Constraint/ArraySubset.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Symfony\Bundle\Test\Constraint; + +use ApiPlatform\Test\Constraint\ArraySubset; + +trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', 'ApiPlatform\Symfony\Bundle\Test\Constraint\ArraySubset', ArraySubset::class); + +class_alias(ArraySubset::class, 'ApiPlatform\Symfony\Bundle\Test\Constraint\ArraySubset'); diff --git a/src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php b/src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php new file mode 100644 index 00000000000..6e07691eb67 --- /dev/null +++ b/src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Symfony\Bundle\Test\Constraint; + +use ApiPlatform\Test\Constraint\ArraySubsetTrait as BaseArraySubsetTrait; + +trigger_deprecation('api-platform/core', '5.0', 'The "%s" trait is deprecated, use "%s" instead.', ArraySubsetTrait::class, BaseArraySubsetTrait::class); + +/** + * @deprecated since API Platform 5.0, use {@see \ApiPlatform\Test\Constraint\ArraySubsetTrait} instead + */ +trait ArraySubsetTrait +{ + use BaseArraySubsetTrait; +} diff --git a/src/Symfony/Bundle/Test/Constraint/MatchesJsonSchema.php b/src/Symfony/Bundle/Test/Constraint/MatchesJsonSchema.php new file mode 100644 index 00000000000..7f78fc6b4b3 --- /dev/null +++ b/src/Symfony/Bundle/Test/Constraint/MatchesJsonSchema.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Symfony\Bundle\Test\Constraint; + +use ApiPlatform\Test\Constraint\MatchesJsonSchema; + +trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', 'ApiPlatform\Symfony\Bundle\Test\Constraint\MatchesJsonSchema', MatchesJsonSchema::class); + +class_alias(MatchesJsonSchema::class, 'ApiPlatform\Symfony\Bundle\Test\Constraint\MatchesJsonSchema'); diff --git a/src/Symfony/Bundle/Test/Response.php b/src/Symfony/Bundle/Test/Response.php new file mode 100644 index 00000000000..ed846c3f043 --- /dev/null +++ b/src/Symfony/Bundle/Test/Response.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Symfony\Bundle\Test; + +use ApiPlatform\Test\Response; + +trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', 'ApiPlatform\Symfony\Bundle\Test\Response', Response::class); + +class_alias(Response::class, 'ApiPlatform\Symfony\Bundle\Test\Response'); diff --git a/src/Symfony/composer.json b/src/Symfony/composer.json index b920fa082bb..05b3e9633b0 100644 --- a/src/Symfony/composer.json +++ b/src/Symfony/composer.json @@ -37,9 +37,11 @@ "api-platform/metadata": "^5.0@alpha", "api-platform/serializer": "^5.0@alpha", "api-platform/state": "^5.0@alpha", + "api-platform/test": "^5.0@alpha", "api-platform/validator": "^5.0@alpha", "api-platform/openapi": "^5.0@alpha", "symfony/asset": "^7.4 || ^8.0", + "symfony/deprecation-contracts": "^3.1", "symfony/finder": "^7.4 || ^8.0", "symfony/http-kernel": "^7.4 || ^8.0", "symfony/property-info": "^7.4 || ^8.0", From d5d2d51ebf0f38d433a7d32973cb47605483d2b0 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 11 Sep 2026 16:01:58 +0200 Subject: [PATCH 3/4] fix(symfony): satisfy cs-fixer and phpstan on the shims CS Fixer's fully_qualified_strict_types applies to docblocks, so the {@see} tags must use the imported alias. PHPStan reports trait.unused for the three trait shims, which exist only for BC and are legitimately used nowhere in the monorepo. --- phpstan.neon.dist | 4 ++++ src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php | 2 +- src/Symfony/Bundle/Test/ApiTestCase.php | 2 +- src/Symfony/Bundle/Test/ClientTrait.php | 2 +- src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 79b03ebe424..8b9e771abd1 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -40,6 +40,10 @@ parameters: ApiPlatform\Metadata\Resource\ResourceMetadataCollection: - handleNotFound ignoreErrors: + # BC shims for the test helpers moved to api-platform/test in 5.0 + - + identifier: trait.unused + path: src/Symfony/Bundle/Test/* # ignore type todo remove in 5.0 - message: '#Symfony\\Component\\PropertyInfo\\Type#' diff --git a/src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php b/src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php index 9dc357ccc18..7fc0744806c 100644 --- a/src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php +++ b/src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php @@ -18,7 +18,7 @@ trigger_deprecation('api-platform/core', '5.0', 'The "%s" trait is deprecated, use "%s" instead.', ApiTestAssertionsTrait::class, BaseApiTestAssertionsTrait::class); /** - * @deprecated since API Platform 5.0, use {@see \ApiPlatform\Test\ApiTestAssertionsTrait} instead + * @deprecated since API Platform 5.0, use {@see BaseApiTestAssertionsTrait} instead */ trait ApiTestAssertionsTrait { diff --git a/src/Symfony/Bundle/Test/ApiTestCase.php b/src/Symfony/Bundle/Test/ApiTestCase.php index 1862e348c99..12a707d5caf 100644 --- a/src/Symfony/Bundle/Test/ApiTestCase.php +++ b/src/Symfony/Bundle/Test/ApiTestCase.php @@ -18,7 +18,7 @@ trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', ApiTestCase::class, BaseApiTestCase::class); /** - * @deprecated since API Platform 5.0, use {@see \ApiPlatform\Test\ApiTestCase} instead + * @deprecated since API Platform 5.0, use {@see BaseApiTestCase} instead */ abstract class ApiTestCase extends BaseApiTestCase { diff --git a/src/Symfony/Bundle/Test/ClientTrait.php b/src/Symfony/Bundle/Test/ClientTrait.php index ff2101667cf..fad941cea83 100644 --- a/src/Symfony/Bundle/Test/ClientTrait.php +++ b/src/Symfony/Bundle/Test/ClientTrait.php @@ -18,7 +18,7 @@ trigger_deprecation('api-platform/core', '5.0', 'The "%s" trait is deprecated, use "%s" instead.', ClientTrait::class, BaseClientTrait::class); /** - * @deprecated since API Platform 5.0, use {@see \ApiPlatform\Test\ClientTrait} instead + * @deprecated since API Platform 5.0, use {@see BaseClientTrait} instead */ trait ClientTrait { diff --git a/src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php b/src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php index 6e07691eb67..9bed55ef616 100644 --- a/src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php +++ b/src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php @@ -18,7 +18,7 @@ trigger_deprecation('api-platform/core', '5.0', 'The "%s" trait is deprecated, use "%s" instead.', ArraySubsetTrait::class, BaseArraySubsetTrait::class); /** - * @deprecated since API Platform 5.0, use {@see \ApiPlatform\Test\Constraint\ArraySubsetTrait} instead + * @deprecated since API Platform 5.0, use {@see BaseArraySubsetTrait} instead */ trait ArraySubsetTrait { From 3e661541fa2655302986347c6cd42be440433b26 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 11 Sep 2026 17:21:55 +0200 Subject: [PATCH 4/4] fix: drop phpstan ignores left dead by #8517 #8517 removed the Request::getContentType() fallbacks and the method_exists() guards around getContentTypeFormat(), but kept the ignore patterns targeting them, so phpstan reports them as unmatched. Neither has a call site left. --- phpstan.neon.dist | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 8b9e771abd1..7edf193643e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -88,8 +88,6 @@ parameters: # Expected, due to backward compatibility - '#Access to an undefined property GraphQL\\Type\\Definition\\NamedType&GraphQL\\Type\\Definition\\Type::\$name\.#' - "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\PropertyInfo\\\\\\\\PropertyInfoExtractor' and 'getType' will always evaluate to true\\.#" - - "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\HttpFoundation\\\\\\\\Request' and 'getContentTypeFormat' will always evaluate to true\\.#" - - '#Call to an undefined method Symfony\\Component\\HttpFoundation\\Request::getContentType\(\)\.#' - "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\Serializer\\\\\\\\Serializer' and 'getSupportedTypes' will always evaluate to true\\.#" - "#Call to function method_exists\\(\\) with Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\|Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata and 'isChangeTrackingDef…' will always evaluate to true\\.#" - "#Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Serializer\\\\Exception\\\\PartialDenormalizationException and 'getNotNormalizableV…' will always evaluate to true\\.#"