From ff72df2bc0b0cb38ba299f835d2fb7544321ccb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 11 Sep 2017 21:57:12 +0200 Subject: [PATCH] Deprecate NelmioApiDoc 2 support Deprecate in the constructor --- .../Extractor/AnnotationsProvider/ApiPlatformProvider.php | 2 ++ src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php | 2 ++ .../Extractor/AnnotationsProvider/ApiPlatformProviderTest.php | 3 +++ tests/Bridge/NelmioApiDoc/Parser/ApiPlatformParserTest.php | 3 +++ 4 files changed, 10 insertions(+) diff --git a/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php b/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php index 08e4e07779d..2df621ce45e 100644 --- a/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php +++ b/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php @@ -53,6 +53,8 @@ public function __construct(ResourceNameCollectionFactoryInterface $resourceName $this->documentationNormalizer = $documentationNormalizer; $this->resourceMetadataFactory = $resourceMetadataFactory; $this->operationMethodResolver = $operationMethodResolver; + + @trigger_error('The '.__NAMESPACE__.'\ApiPlatformProvider class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform.', E_USER_DEPRECATED); } /** diff --git a/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php b/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php index 628c8c0b960..e6b748ea013 100644 --- a/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php +++ b/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php @@ -53,6 +53,8 @@ public function __construct(ResourceMetadataFactoryInterface $resourceMetadataFa $this->propertyNameCollectionFactory = $propertyNameCollectionFactory; $this->propertyMetadataFactory = $propertyMetadataFactory; $this->nameConverter = $nameConverter; + + @trigger_error('The '.__NAMESPACE__.'\ApiPlatformParser class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 2 has native support for API Platform.', E_USER_DEPRECATED); } /** diff --git a/tests/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProviderTest.php b/tests/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProviderTest.php index c7c168576c3..70c80a9104a 100644 --- a/tests/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProviderTest.php +++ b/tests/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProviderTest.php @@ -32,6 +32,9 @@ /** * @author Teoh Han Hui + * + * @group legacy + * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Extractor\AnnotationsProvider\ApiPlatformProvider class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ class ApiPlatformProviderTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/Bridge/NelmioApiDoc/Parser/ApiPlatformParserTest.php b/tests/Bridge/NelmioApiDoc/Parser/ApiPlatformParserTest.php index 6f3ef587d24..fda2781503c 100644 --- a/tests/Bridge/NelmioApiDoc/Parser/ApiPlatformParserTest.php +++ b/tests/Bridge/NelmioApiDoc/Parser/ApiPlatformParserTest.php @@ -32,6 +32,9 @@ /** * @author Teoh Han Hui + * + * @group legacy + * @expectedDeprecation The ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformProvider class is deprecated since version 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform. */ class ApiPlatformParserTest extends \PHPUnit_Framework_TestCase {