added return type to Method class

This commit is contained in:
Christian Kerl 2011-01-07 23:00:17 +01:00
parent 1f8773a433
commit 928dc80b5e
2 changed files with 15 additions and 1 deletions

View File

@ -64,6 +64,8 @@ class XmlFileLoader extends FileLoader
$method->getArguments()->add($this->parseArgument($argument)); $method->getArguments()->add($this->parseArgument($argument));
} }
$method->setReturn($this->parseType($node->return->type));
return $method; return $method;
} }

View File

@ -17,12 +17,14 @@ class Method
private $name; private $name;
private $controller; private $controller;
private $arguments; private $arguments;
private $return;
public function __construct($name = null, $controller = null, array $arguments = array()) public function __construct($name = null, $controller = null, array $arguments = array(), $return = null)
{ {
$this->setName($name); $this->setName($name);
$this->setController($controller); $this->setController($controller);
$this->setArguments($arguments); $this->setArguments($arguments);
$this->setReturn($return);
} }
public function getName() public function getName()
@ -55,4 +57,14 @@ class Method
$this->arguments = new Collection('getName'); $this->arguments = new Collection('getName');
$this->arguments->addAll($arguments); $this->arguments->addAll($arguments);
} }
public function getReturn()
{
return $this->return;
}
public function setReturn($return)
{
$this->return = $return;
}
} }