aboutsummaryrefslogtreecommitdiffstats
path: root/Model/Declaration.php
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-02-20 11:30:13 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-02-20 11:30:13 +0100
commitee13ce70bc01025e873351486d90bd69ba7ece47 (patch)
tree755a3c92864bbc18dc83276c595360e745c9b500 /Model/Declaration.php
parent43f4ab7d0e7e17fb35ef9b64172fda1d73ef457e (diff)
downloadPraspel-ee13ce70bc01025e873351486d90bd69ba7ece47.zip
Praspel-ee13ce70bc01025e873351486d90bd69ba7ece47.tar.gz
Praspel-ee13ce70bc01025e873351486d90bd69ba7ece47.tar.bz2
Add the getVariable() method.
It helps fluid calls, such as: $specification->getClause('requires') ->getVariable('i') ->…; in addition of: $specification->getClause('requires')['i']->…; which is possible since PHP5.4.
Diffstat (limited to 'Model/Declaration.php')
-rw-r--r--Model/Declaration.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/Model/Declaration.php b/Model/Declaration.php
index f8e121a..11c9e4e 100644
--- a/Model/Declaration.php
+++ b/Model/Declaration.php
@@ -143,6 +143,18 @@ abstract class Declaration
}
/**
+ * Alias of $this->offsetGet().
+ *
+ * @access public
+ * @param string $variable Variable name.
+ * @return \Hoa\Prasel\Model\Variable
+ */
+ public function getVariable ( $variable ) {
+
+ return $this->offsetGet($variable);
+ }
+
+ /**
* Iterator over local variables.
*
* @access public