From 5f0d36f3d82d6db260dc5b47e7bfc3f0b8ad758e Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 24 Aug 2012 18:42:54 +0200 Subject: [PATCH] Fixed the ApiDocExtractor for a change in Symfony 2.1 Side note: the new code would also work for the Symfony 2.0 Routing component, and in a more efficient way by avoiding to compile each route 3 times. --- Extractor/ApiDocExtractor.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Extractor/ApiDocExtractor.php b/Extractor/ApiDocExtractor.php index d392a55..6eb028f 100644 --- a/Extractor/ApiDocExtractor.php +++ b/Extractor/ApiDocExtractor.php @@ -246,7 +246,7 @@ class ApiDocExtractor // requirements $requirements = array(); - foreach ($route->compile()->getRequirements() as $name => $value) { + foreach ($route->getRequirements() as $name => $value) { if ('_method' !== $name) { $requirements[$name] = array( 'requirement' => $value, @@ -289,13 +289,13 @@ class ApiDocExtractor // method/uri $annotation->setMethod($route->getRequirement('_method') ?: 'ANY'); - $annotation->setUri($route->compile()->getPattern()); + $annotation->setUri($route->getPattern()); return $annotation; } /** - * @param Reflector $reflected + * @param \Reflector $reflected * @return string */ protected function getDocComment(\Reflector $reflected) @@ -315,7 +315,7 @@ class ApiDocExtractor } /** - * @param Reflector $reflected + * @param \Reflector $reflected * @return string */ protected function getDocCommentText(\Reflector $reflected)