diff --git a/Extractor/Handler/SensioFrameworkExtraHandler.php b/Extractor/Handler/SensioFrameworkExtraHandler.php deleted file mode 100644 index c8997f7..0000000 --- a/Extractor/Handler/SensioFrameworkExtraHandler.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Nelmio\ApiDocBundle\Extractor\Handler; - -use Nelmio\ApiDocBundle\Extractor\HandlerInterface; -use Nelmio\ApiDocBundle\Annotation\ApiDoc; -use Symfony\Component\Routing\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; - -class SensioFrameworkExtraHandler implements HandlerInterface -{ - public function handle(ApiDoc $annotation, array $annotations, Route $route, \ReflectionMethod $method) - { - foreach ($annotations as $annot) { - if ($annot instanceof Cache) { - $annotation->setCache($annot->getMaxAge()); - } elseif ($annot instanceof Security) { - $annotation->setAuthentication(true); - } - } - } -} diff --git a/Resources/config/services.xml b/Resources/config/services.xml index 3230654..321420a 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -11,7 +11,6 @@ Nelmio\ApiDocBundle\Extractor\Handler\FosRestHandler Nelmio\ApiDocBundle\Extractor\Handler\JmsSecurityExtraHandler - Nelmio\ApiDocBundle\Extractor\Handler\SensioFrameworkExtraHandler Nelmio\ApiDocBundle\Extractor\Handler\PhpDocHandler Nelmio\ApiDocBundle\Parser\CollectionParser @@ -53,10 +52,6 @@ - - - - diff --git a/Resources/doc/other-bundle-annotations.rst b/Resources/doc/other-bundle-annotations.rst index 0447812..dd1fbfc 100644 --- a/Resources/doc/other-bundle-annotations.rst +++ b/Resources/doc/other-bundle-annotations.rst @@ -8,7 +8,6 @@ This bundle will get information from the following other annotations: (when strict parameter is true), ``filters`` (when strict is false) * ``@JMS\SecurityExtraBundle\Annotation\Secure`` - set ``authentication`` to true, ``authenticationRoles`` to the given roles -* ``@Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache`` - set ``cache`` PHPDoc ------ diff --git a/Tests/Extractor/ApiDocExtractorTest.php b/Tests/Extractor/ApiDocExtractorTest.php index 0bf31ad..7b1ab8a 100644 --- a/Tests/Extractor/ApiDocExtractorTest.php +++ b/Tests/Extractor/ApiDocExtractorTest.php @@ -224,19 +224,6 @@ class ApiDocExtractorTest extends WebTestCase $this->assertCount(2, $annotation->getAuthenticationRoles()); } - public function testGetWithCache() - { - $container = $this->getContainer(); - $extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor'); - $annotation = $extractor->get('Nelmio\ApiDocBundle\Tests\Fixtures\Controller\TestController::zCachedAction', 'test_route_23'); - - $this->assertNotNull($annotation); - $this->assertEquals( - 60, - $annotation->getCache() - ); - } - public function testGetWithDeprecated() { $container = $this->getContainer(); diff --git a/Tests/Extractor/Handler/SensioFrameworkExtraHandlerTest.php b/Tests/Extractor/Handler/SensioFrameworkExtraHandlerTest.php deleted file mode 100644 index ce1682b..0000000 --- a/Tests/Extractor/Handler/SensioFrameworkExtraHandlerTest.php +++ /dev/null @@ -1,39 +0,0 @@ - -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ - -namespace Nelmio\ApiDocBundle\Tests\Extractor; - -use Nelmio\ApiDocBundle\Tests\WebTestCase; - -class SensioFrameworkExtraHandlerTest extends WebTestCase -{ - public function testCacheAnnotation() - { - $container = $this->getContainer(); - $extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor'); - $annotation = $extractor->get('Nelmio\ApiDocBundle\Tests\Fixtures\Controller\TestController::zCachedAction', 'test_route_23'); - - $this->assertNotNull($annotation); - - $this->assertSame(60, $annotation->getCache()); - } - - public function testSecurityAnnotation() - { - $container = $this->getContainer(); - $extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor'); - $annotation = $extractor->get('Nelmio\ApiDocBundle\Tests\Fixtures\Controller\TestController::zSecuredAction', 'test_route_24'); - - $this->assertNotNull($annotation); - - $this->assertTrue($annotation->getAuthentication()); - } -} diff --git a/Tests/Fixtures/Controller/TestController.php b/Tests/Fixtures/Controller/TestController.php index 38200dd..9628774 100644 --- a/Tests/Fixtures/Controller/TestController.php +++ b/Tests/Fixtures/Controller/TestController.php @@ -15,12 +15,8 @@ use FOS\RestBundle\Controller\Annotations\QueryParam; use FOS\RestBundle\Controller\Annotations\RequestParam; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Nelmio\ApiDocBundle\Tests\Fixtures\DependencyTypePath; -use Nelmio\ApiDocBundle\Tests\Fixtures\RequestParamHelper; -use Nelmio\ApiDocBundle\Util\LegacyFormHelper; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Validator\Constraints as Assert; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; class TestController { @@ -219,7 +215,6 @@ class TestController /** * @ApiDoc() - * @Cache(maxage=60, public=1) */ public function zCachedAction() { @@ -227,7 +222,6 @@ class TestController /** * @ApiDoc() - * @Security("has_role('ROLE_USER')") */ public function zSecuredAction() { diff --git a/Tests/Formatter/testFormat-result.php b/Tests/Formatter/testFormat-result.php index 92f44e1..49552a0 100644 --- a/Tests/Formatter/testFormat-result.php +++ b/Tests/Formatter/testFormat-result.php @@ -2605,7 +2605,6 @@ With multiple lines.', array ( 'method' => 'POST', 'uri' => '/zcached', - 'cache' => 60, 'https' => false, 'authentication' => false, 'authenticationRoles' => @@ -2618,7 +2617,7 @@ With multiple lines.', 'method' => 'POST', 'uri' => '/zsecured', 'https' => false, - 'authentication' => true, + 'authentication' => false, 'authenticationRoles' => array ( ), diff --git a/Tests/Formatter/testFormat-result_1.php b/Tests/Formatter/testFormat-result_1.php index 798b905..5380106 100644 --- a/Tests/Formatter/testFormat-result_1.php +++ b/Tests/Formatter/testFormat-result_1.php @@ -2448,7 +2448,6 @@ With multiple lines.', array ( 'method' => 'POST', 'uri' => '/zcached', - 'cache' => 60, 'https' => false, 'authentication' => false, 'authenticationRoles' => @@ -2461,7 +2460,7 @@ With multiple lines.', 'method' => 'POST', 'uri' => '/zsecured', 'https' => false, - 'authentication' => true, + 'authentication' => false, 'authenticationRoles' => array ( ), diff --git a/composer.json b/composer.json index 865536d..171347f 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,6 @@ "jms/serializer": "~3.15.0", "jms/serializer-bundle": "4.1.0", "phpunit/phpunit": "~9.5", - "sensio/framework-extra-bundle": "^6.2", "symfony/asset": "^5.0|^6.0", "symfony/browser-kit": "^5.0|^6.0", "symfony/translation": "^5.0|^6.0",