/**
* Builds and populates Action object based on the provided class name
*
* @param string $className
* @return Action
*/
public function buildAction($className)
{
$classReflection = new ClassReflection($className);
$scanner = new FileScanner($classReflection->getFileName(), $this->annotationManager);
$classScanner = $scanner->getClass($classReflection->getName());
$action = new Action($classScanner->getName());
foreach ($classScanner->getMethods() as $classMethod) {
if ($classMethod->isPublic() && $classMethod->getName() != '__construct') {
$action->addMethod($this->buildMethod($classMethod));
}
}
return $action;
}
/**
* Builds a method object based on the provided method scanner
*
* @param MethodScanner $classMethod
* @return Method
*/
protected function buildMethod(MethodScanner $classMethod)
{
$method = new Method($classMethod->getName());
$method->setNumberOfParameters($classMethod->getNumberOfParameters());
// Loop through annotations
if ($annotations = $classMethod->getAnnotations($this->annotationManager)) {
foreach ($annotations as $annotation) {
// @todo annotations should implement some kind of interface?
if (method_exists($annotation, 'decorateObject')) {
$annotation->decorateObject($method);
}
}
}
return $method;
}
With $params = [1,2], for example, notice disapears.
I'm trying to set array for default value:
And getting notice:
Below is a piece of ApiBuilder.php:
With
$params = [1,2]
, for example, notice disapears.