From 928dc80b5e21570a3c32b9ce209d702950c8bf11 Mon Sep 17 00:00:00 2001 From: Christian Kerl Date: Fri, 7 Jan 2011 23:00:17 +0100 Subject: [PATCH] added return type to Method class --- ServiceDefinition/Loader/XmlFileLoader.php | 2 ++ ServiceDefinition/Method.php | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ServiceDefinition/Loader/XmlFileLoader.php b/ServiceDefinition/Loader/XmlFileLoader.php index 0c9d354..1fab1aa 100644 --- a/ServiceDefinition/Loader/XmlFileLoader.php +++ b/ServiceDefinition/Loader/XmlFileLoader.php @@ -64,6 +64,8 @@ class XmlFileLoader extends FileLoader $method->getArguments()->add($this->parseArgument($argument)); } + $method->setReturn($this->parseType($node->return->type)); + return $method; } diff --git a/ServiceDefinition/Method.php b/ServiceDefinition/Method.php index 9f2fb9a..136f9a4 100644 --- a/ServiceDefinition/Method.php +++ b/ServiceDefinition/Method.php @@ -17,12 +17,14 @@ class Method private $name; private $controller; 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->setController($controller); $this->setArguments($arguments); + $this->setReturn($return); } public function getName() @@ -55,4 +57,14 @@ class Method $this->arguments = new Collection('getName'); $this->arguments->addAll($arguments); } + + public function getReturn() + { + return $this->return; + } + + public function setReturn($return) + { + $this->return = $return; + } } \ No newline at end of file