aboutsummaryrefslogtreecommitdiffstats
path: root/Model
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-09-16 09:32:05 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-09-16 09:32:05 +0200
commitf9ce251db0643747727d454d56c5e8e1695a2c88 (patch)
treeb3babe93d593ec6e575cda976ab216b9b9250391 /Model
parent603d5d719a763e070e85cb60cefd04274864de18 (diff)
downloadPraspel-f9ce251db0643747727d454d56c5e8e1695a2c88.zip
Praspel-f9ce251db0643747727d454d56c5e8e1695a2c88.tar.gz
Praspel-f9ce251db0643747727d454d56c5e8e1695a2c88.tar.bz2
Fail early.
Diffstat (limited to 'Model')
-rw-r--r--Model/Variable.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/Model/Variable.php b/Model/Variable.php
index 866c867..0a78f03 100644
--- a/Model/Variable.php
+++ b/Model/Variable.php
@@ -157,18 +157,18 @@ class Variable
*/
public function __construct ( $name, $local, Clause $clause = null ) {
- $this->_name = $name;
- $this->_local = $local;
- $this->_clause = $clause;
- $this->_refDomains = &$this->_domains;
-
if( ('\old' === substr($name, 0, 4)
|| '\result' === $name)
- && !($this->_clause instanceof Ensures))
+ && !($clause instanceof Ensures))
throw new \Hoa\Praspel\Exception\Model(
'\old(…) and \result are only allowed in @ensures, ' .
'given %s in @%s.',
- 0, array($name, $this->getClause()->getName()));
+ 0, array($name, $clause->getName()));
+
+ $this->_name = $name;
+ $this->_local = $local;
+ $this->_clause = $clause;
+ $this->_refDomains = &$this->_domains;
return;
}