From fdc814e264a2fee543f455798e76c3bf641cc073 Mon Sep 17 00:00:00 2001 From: fvilpoix Date: Thu, 27 Dec 2012 10:18:15 +0100 Subject: [PATCH] Set automaticly the Authentication params when JMS Secure annotation is set --- Extractor/ApiDocExtractor.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Extractor/ApiDocExtractor.php b/Extractor/ApiDocExtractor.php index c0a325c..9286e25 100644 --- a/Extractor/ApiDocExtractor.php +++ b/Extractor/ApiDocExtractor.php @@ -28,6 +28,8 @@ class ApiDocExtractor const FOS_REST_REQUEST_PARAM_CLASS = 'FOS\\RestBundle\\Controller\\Annotations\\RequestParam'; + const JMS_SECURITY_EXTRA_SECURE_CLASS = 'JMS\\SecurityExtraBundle\\Annotation\\Secure'; + /** * @var ContainerInterface */ @@ -360,6 +362,8 @@ class ApiDocExtractor 'description' => $annot->description, 'readonly' => false )); + } elseif (is_a($annot, self::JMS_SECURITY_EXTRA_SECURE_CLASS)) { + $annotation->setAuthentication(true); } } }