diff --git a/Annotation/ApiDoc.php b/Annotation/ApiDoc.php index 08dc2e8..5692171 100644 --- a/Annotation/ApiDoc.php +++ b/Annotation/ApiDoc.php @@ -228,15 +228,15 @@ class ApiDoc $this->deprecated = $data['deprecated']; } - if (isset($data['tags'])) { - $tags = $data['tags']; + if (isset($data['tags'])) { + $tags = $data['tags']; - if (!is_array($tags)) { - $tags = array($tags); - } + if (!is_array($tags)) { + $tags = array($tags); + } - $this->tags = $tags; - } + $this->tags = $tags; + } if (isset($data['https'])) { $this->https = $data['https']; diff --git a/Extractor/Handler/FosRestHandler.php b/Extractor/Handler/FosRestHandler.php index b866df0..3165e20 100644 --- a/Extractor/Handler/FosRestHandler.php +++ b/Extractor/Handler/FosRestHandler.php @@ -56,11 +56,11 @@ class FosRestHandler implements HandlerInterface } } } - + /** * Handle FOSRestBundle requirements in order to return a string. * - * @param mixed $requirements + * @param mixed $requirements * @return string */ private function handleRequirements($requirements) @@ -70,8 +70,10 @@ class FosRestHandler implements HandlerInterface return $requirements->getHtmlPattern(); } $class = get_class($requirements); + return substr($class, strrpos($class, '\\')+1); } - return (string)$requirements; + + return (string) $requirements; } } diff --git a/Formatter/FormatterInterface.php b/Formatter/FormatterInterface.php index 95147c2..ccfced5 100644 --- a/Formatter/FormatterInterface.php +++ b/Formatter/FormatterInterface.php @@ -27,7 +27,7 @@ interface FormatterInterface * Format documentation data for one route. * * @param ApiDoc $annotation - * return string|array + * return string|array */ public function formatOne(ApiDoc $annotation); } diff --git a/Parser/ValidationParser.php b/Parser/ValidationParser.php index a7281e2..1d9e4b8 100644 --- a/Parser/ValidationParser.php +++ b/Parser/ValidationParser.php @@ -233,7 +233,7 @@ class ValidationParser implements ParserInterface, PostParserInterface /** * Return Choice constraint choices. * - * @param Constraint $constraint + * @param Constraint $constraint * @param $className * @return array * @throws \Symfony\Component\Validator\Exception\ConstraintDefinitionException diff --git a/Tests/Extractor/Handler/FosRestHandlerTest.php b/Tests/Extractor/Handler/FosRestHandlerTest.php index bcb0de9..1470819 100644 --- a/Tests/Extractor/Handler/FosRestHandlerTest.php +++ b/Tests/Extractor/Handler/FosRestHandlerTest.php @@ -86,7 +86,7 @@ class FosRestHandlerTest extends WebTestCase $this->assertArrayNotHasKey('default', $filter); } - + public function testGetWithConstraintAsRequirements() { $container = $this->getContainer(); diff --git a/Tests/Fixtures/Controller/TestController.php b/Tests/Fixtures/Controller/TestController.php index dea3568..a299db0 100644 --- a/Tests/Fixtures/Controller/TestController.php +++ b/Tests/Fixtures/Controller/TestController.php @@ -130,7 +130,7 @@ class TestController public function zActionWithQueryParamNoDefaultAction() { } - + /** * @ApiDoc() * @QueryParam(name="mail", requirements=@Email, description="Email of someone.")