Cleaned files

This commit is contained in:
Francis Besset
2011-07-14 17:45:03 +02:00
parent 7ddf05cec1
commit 51d1d28830
31 changed files with 428 additions and 499 deletions

View File

@ -22,19 +22,18 @@ class AnnotationReader extends BaseAnnotationReader
public function getMethodAnnotation(\ReflectionMethod $method, $type)
{
$annotation = parent::getMethodAnnotation($method, $type);
if($annotation !== null && count($annotation) > 1)
{
if($annotation !== null && count($annotation) > 1) {
throw new \LogicException(sprintf("There is more than one annotation of type '%s'!", $type));
}
return $annotation !== null ? $annotation[0] : null;
}
public function getMethodAnnotations(\ReflectionMethod $method, $type = null)
{
$annotations = parent::getMethodAnnotations($method);
return $type !== null && isset($annotations[$type]) ? $annotations[$type] : $annotations;
}
}