This commit is contained in:
William DURAND 2014-06-25 08:46:01 +02:00
parent 87b690d5e1
commit b48650a9e0
6 changed files with 16 additions and 14 deletions

View File

@ -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'];

View File

@ -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;
}
}

View File

@ -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);
}

View File

@ -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

View File

@ -86,7 +86,7 @@ class FosRestHandlerTest extends WebTestCase
$this->assertArrayNotHasKey('default', $filter);
}
public function testGetWithConstraintAsRequirements()
{
$container = $this->getContainer();

View File

@ -130,7 +130,7 @@ class TestController
public function zActionWithQueryParamNoDefaultAction()
{
}
/**
* @ApiDoc()
* @QueryParam(name="mail", requirements=@Email, description="Email of someone.")