diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2015-05-28 12:10:30 +0200 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2015-05-28 12:10:30 +0200 |
commit | 0fce3078006928700d7e65660d49f693dc4293d2 (patch) | |
tree | 03636cd45b0422fc7558ef9d8c380c30e13b9069 /Model/Variable | |
parent | f7801604c0631304547eee00b68ce3174d40ccdc (diff) | |
download | Praspel-0fce3078006928700d7e65660d49f693dc4293d2.zip Praspel-0fce3078006928700d7e65660d49f693dc4293d2.tar.gz Praspel-0fce3078006928700d7e65660d49f693dc4293d2.tar.bz2 |
Move to PSR-1-2 & drop PHP5.3 & `from`/`import`.
Diffstat (limited to 'Model/Variable')
-rw-r--r-- | Model/Variable/Borrowing.php | 221 | ||||
-rw-r--r-- | Model/Variable/Implicit.php | 63 | ||||
-rw-r--r-- | Model/Variable/Variable.php | 257 |
3 files changed, 250 insertions, 291 deletions
diff --git a/Model/Variable/Borrowing.php b/Model/Variable/Borrowing.php index e90b291..a0351fe 100644 --- a/Model/Variable/Borrowing.php +++ b/Model/Variable/Borrowing.php @@ -8,7 +8,7 @@ * * New BSD License * - * Copyright © 2007-2015, Ivan Enderlin. All rights reserved. + * Copyright © 2007-2015, Hoa community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -34,36 +34,21 @@ * POSSIBILITY OF SUCH DAMAGE. */ -namespace { +namespace Hoa\Praspel\Model\Variable; -from('Hoa') - -/** - * \Hoa\Praspel\Exception\Model - */ --> import('Praspel.Exception.Model') - -/** - * \Hoa\Praspel\Model\Variable - */ --> import('Praspel.Model.Variable.~'); - -} - -namespace Hoa\Praspel\Model\Variable { +use Hoa\Math; +use Hoa\Praspel; /** * Class \Hoa\Praspel\Model\Variable\Borrowing. * * Represent a borrowing variable. * - * @author Ivan Enderlin <ivan.enderlin@hoa-project.net> - * @copyright Copyright © 2007-2015 Ivan Enderlin. + * @copyright Copyright © 2007-2015 Hoa community * @license New BSD License */ - -class Borrowing extends Variable { - +class Borrowing extends Variable +{ /** * Type: \old(e). * @@ -97,16 +82,17 @@ class Borrowing extends Variable { /** * Build a variable. * - * @access public * @param string $name Name. * @param bool $local Local. * @param \Hoa\Praspel\Model\Clause $clause Clause. * @return void - * @throw \Hoa\Praspel\Exception\Model + * @throws \Hoa\Praspel\Exception\Model */ - public function __construct ( $name, $local, - \Hoa\Praspel\Model\Clause $clause = null ) { - + public function __construct( + $name, + $local, + Praspel\Model\Clause $clause = null + ) { parent::__construct($name, $local, $clause); $this->determineType(); @@ -116,22 +102,25 @@ class Borrowing extends Variable { /** * Determine type of the variable. * - * @access protected * @return void - * @throw \Hoa\Praspel\Exception\Model + * @throws \Hoa\Praspel\Exception\Model */ - protected function determineType ( ) { - + protected function determineType() + { $name = $this->getName(); - if('\old(' === substr($name, 0, 5)) + if ('\old(' === substr($name, 0, 5)) { $this->computeOld(substr($name, 5, -1)); - elseif(false !== strpos($name, '>', 2)) + } elseif (false !== strpos($name, '>', 2)) { $this->computeDynamicResolution($name); - else - throw new \Hoa\Praspel\Exception\Model( + } else { + throw new Praspel\Exception\Model( 'Variable %s would be a borrowing one, but its type cannot ' . - 'be determined.', 0, $name); + 'be determined.', + 0, + $name + ); + } return; } @@ -139,33 +128,37 @@ class Borrowing extends Variable { /** * Compute \old(…). * - * @access protected * @param string $name Name. * @return void - * @throw \Hoa\Praspel\Exception\Model + * @throws \Hoa\Praspel\Exception\Model */ - protected function computeOld ( $name ) { - + protected function computeOld($name) + { $clause = $this->getClause(); $this->_type = static::TYPE_OLD; $parent = $clause->getParent(); - while( false === $parent->clauseExists('requires') - && null !== $parent = $parent->getParent()); + while ( + false === $parent->clauseExists('requires') && + null !== $parent = $parent->getParent() + ); - if( null === $parent - || false === $parent->clauseExists('requires')) - throw new \Hoa\Praspel\Exception\Model( - 'No parent or no requires.', 1); + if (null === $parent || + false === $parent->clauseExists('requires')) { + throw new Praspel\Exception\Model('No parent or no requires.', 1); + } $requires = $parent->getClause('requires'); $inScopeVariables = $requires->getInScopeVariables(); - if(!isset($inScopeVariables[$name])) - throw new \Hoa\Praspel\Exception\Model( + if (!isset($inScopeVariables[$name])) { + throw new Praspel\Exception\Model( 'Variable %s does not exist, cannot get its old value ' . '(in @%s).', - 2, array($name, $clause->getName())); + 2, + [$name, $clause->getName()] + ); + } $this->_variable = &$inScopeVariables[$name]; @@ -175,54 +168,65 @@ class Borrowing extends Variable { /** * Compute dynamic resolution. * - * @access protected * @param string $name Name. * @return void - * @throw \Hoa\Praspel\Exception\Model + * @throws \Hoa\Praspel\Exception\Model */ - protected function computeDynamicResolution ( $name ) { - + protected function computeDynamicResolution($name) + { $this->_type = static::TYPE_EXTERNAL; $clause = $this->getClause(); $parts = explode('->', $name); $head = array_shift($parts); - if('this' !== $head) - //$head = $clause->getVariable($parts[0]); - throw new \Hoa\Praspel\Exception\Model('Not yet implemented!'); + if ('this' !== $head) { + throw new Praspel\Exception\Model('Not yet implemented!'); + } - $registry = \Hoa\Praspel::getRegistry(); + $registry = Praspel::getRegistry(); $root = $clause->getRoot(); $bindedClass = $root->getBindedClass(); - if(null === $bindedClass) - throw new \Hoa\Praspel\Exception\Model( + if (null === $bindedClass) { + throw new Praspel\Exception\Model( 'Cannot resolve the dynamic identifier %s; ' . '%s::getBindedClass returned null.', - 3, array($name, get_class($root))); + 3, + [$name, get_class($root)] + ); + } $attribute = array_shift($parts); $id = $bindedClass . '::$' . $attribute; - if(!isset($registry[$id])) - throw new \Hoa\Praspel\Exception\Model( + if (!isset($registry[$id])) { + throw new Praspel\Exception\Model( 'The contract identifier %s does not exist in the registry.', - 4, $name); + 4, + $name + ); + } $entry = $registry[$id]; - if(false === $entry->clauseExists('invariant')) - throw new \Hoa\Praspel\Exception\Model( + if (false === $entry->clauseExists('invariant')) { + throw new Praspel\Exception\Model( '%s is not declared with an @invariant clause.', - 5, $id); + 5, + $id + ); + } $targetedClause = $entry->getClause('invariant'); - if(!isset($targetedClause[$attribute])) - throw new \Hoa\Praspel\Exception\Model( + if (!isset($targetedClause[$attribute])) { + throw new Praspel\Exception\Model( 'The identifier %s does not exist.', - 6, $attribute); + 6, + $attribute + ); + } $variable = $targetedClause[$attribute]; $this->_variable = $variable; @@ -233,22 +237,20 @@ class Borrowing extends Variable { /** * Get type. * - * @access public * @return int */ - public function getType ( ) { - + public function getType() + { return $this->_type; } /** * Get the borrowed variable. * - * @access public * @return \Hoa\Praspel\Model\Variable */ - public function getBorrowedVariable ( ) { - + public function getBorrowedVariable() + { return $this->_variable; } @@ -256,14 +258,13 @@ class Borrowing extends Variable { * Allow to write $variable->in = … to define domains (if $name is not equal * to "in", then it is a normal behavior). * - * @access public * @param string $name Name. * @param mixed $value Value. * @return void - * @throw \Hoa\Praspel\Exception\Model + * @throws \Hoa\Praspel\Exception\Model */ - public function __set ( $name, $value ) { - + public function __set($name, $value) + { return $this->getBorrowedVariable()->__set($name, $value); } @@ -274,127 +275,115 @@ class Borrowing extends Variable { * @param mixed $q Sampled value. * @return boolean */ - public function predicate ( $q = null ) { - + public function predicate($q = null) + { return $this->getBorrowedVariable()->predicate($q); } /** * Call the sample() method on realistic domains. * - * @access public * @param \Hoa\Math\Sampler $sampler Sampler. * @return mixed - * @throw \Hoa\Realdom\Exception + * @throws \Hoa\Realdom\Exception */ - public function sample ( \Hoa\Math\Sampler $sampler = null ) { - + public function sample(Math\Sampler $sampler = null) + { return $this->getBorrowedVariable()->sample($sampler); } /** * Call the reset() method on realistic domains. * - * @access public * @return void */ - public function reset ( ) { - + public function reset() + { return $this->getBorrowedVariable()->reset(); } /** * Define a “key” constraint. Use $variable->key(…)->in = …; * - * @access public * @param mixed $scalar Value. * @return \Hoa\Praspel\Model\Variable */ - public function key ( $scalar ) { - + public function key($scalar) + { return $this->getBorrowedVariable()->key($scalar); } /** * Define a “contains” constraint. * - * @access public * @param mixed $scalar Value. * @return \Hoa\Praspel\Model\Variable */ - public function contains ( $scalar ) { - + public function contains($scalar) + { return $this->getBorrowedVariable()->contains($scalar); } /** * Add an “is” constraint. * - * @access public * @param string ... Keywords. * @return \Hoa\Praspel\Model\Variable */ - public function is ( ) { - - throw new \Hoa\Praspel\Exception\Model('TODO'); + public function is() + { + throw new Praspel\Exception\Model('TODO'); } /** * Declare a “domainof” (alias). * - * @access public * @param \Hoa\Praspel\Model\Variable $variable Variable. * @return \Hoa\Praspel\Model\Variable - * @throw \Hoa\Realdom\Exception + * @throws \Hoa\Realdom\Exception */ - public function domainof ( $variable ) { - + public function domainof($variable) + { return $this->getBorrowedVariable()->domainof($variable); } /** * Get domains. * - * @access public * @return \Hoa\Realdom\Disjunction */ - public function &getDomains ( ) { - + public function &getDomains() + { return $this->getBorrowedVariable()->getDomains(); } /** * Get held realdoms. * - * @access public * @return \Hoa\Realdom\Disjunction */ - public function &getHeld ( ) { - + public function &getHeld() + { return $this->getBorrowedVariable()->getHeld(); } /** * Check if the variable is local (let) or not. * - * @access public * @return bool */ - public function isLocal ( ) { - + public function isLocal() + { return $this->getBorrowedVariable()->isLocal(); } /** * Get constraints. * - * @access public * @return array */ - public function getConstraints ( ) { - + public function getConstraints() + { return $this->getBorrowedVariable()->getConstraints(); } } - -} diff --git a/Model/Variable/Implicit.php b/Model/Variable/Implicit.php index d28e8a9..3877480 100644 --- a/Model/Variable/Implicit.php +++ b/Model/Variable/Implicit.php @@ -8,7 +8,7 @@ * * New BSD License * - * Copyright © 2007-2015, Ivan Enderlin. All rights reserved. + * Copyright © 2007-2015, Hoa community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -34,57 +34,49 @@ * POSSIBILITY OF SUCH DAMAGE. */ -namespace { +namespace Hoa\Praspel\Model\Variable; -from('Hoa') - -/** - * \Hoa\Praspel\Exception\Model - */ --> import('Praspel.Exception.Model') +use Hoa\Praspel; +use Hoa\Realdom; -/** - * \Hoa\Praspel\Model\Variable - */ --> import('Praspel.Model.Variable.~') +from('Hoa') /** * \Hoa\Realdom\Disjunction */ -> import('Realdom.Disjunction', true); -} - -namespace Hoa\Praspel\Model\Variable { - /** * Class \Hoa\Praspel\Model\Variable\Implicit. * * Represent an implicit variable. * - * @author Ivan Enderlin <ivan.enderlin@hoa-project.net> - * @copyright Copyright © 2007-2015 Ivan Enderlin. + * @copyright Copyright © 2007-2015 Hoa community * @license New BSD License */ - -class Implicit extends Variable { - +class Implicit extends Variable +{ /** * Build a variable. * - * @access public * @param string $name Name. * @param bool $local Local. * @param \Hoa\Praspel\Model\Clause $clause Clause. * @return void - * @throw \Hoa\Praspel\Exception\Model + * @throws \Hoa\Praspel\Exception\Model */ - public function __construct ( $name, $local, - \Hoa\Praspel\Model\Clause $clause = null ) { - - if('this' !== $name) - throw new \Hoa\Praspel\Exception\Model( - 'Variable %s is not an implicit one.', 0, $name); + public function __construct( + $name, + $local, + Praspel\Model\Clause $clause = null + ) { + if ('this' !== $name) { + throw new Praspel\Exception\Model( + 'Variable %s is not an implicit one.', + 0, + $name + ); + } parent::__construct($name, $local, $clause); @@ -96,18 +88,17 @@ class Implicit extends Variable { /** * Bind the variable to a specific value. * - * @access public * @param mixed $value Value. * @return void */ - public function bindTo ( $value ) { - - foreach($this->getDomains() as $domain) - if($domain instanceof \Hoa\Realdom\Object) + public function bindTo($value) + { + foreach ($this->getDomains() as $domain) { + if ($domain instanceof Realdom\Object) { $domain->setObject($value); + } + } return; } } - -} diff --git a/Model/Variable/Variable.php b/Model/Variable/Variable.php index d50ff77..8c16410 100644 --- a/Model/Variable/Variable.php +++ b/Model/Variable/Variable.php @@ -8,7 +8,7 @@ * * New BSD License * - * Copyright © 2007-2015, Ivan Enderlin. All rights reserved. + * Copyright © 2007-2015, Hoa community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -34,104 +34,87 @@ * POSSIBILITY OF SUCH DAMAGE. */ -namespace { +namespace Hoa\Praspel\Model\Variable; -from('Hoa') - -/** - * \Hoa\Praspel\Exception\Model - */ --> import('Praspel.Exception.Model') - -/** - * \Hoa\Visitor\Element - */ --> import('Visitor.Element') - -/** - * \Hoa\Realdom\IRealdom\Holder - */ --> import('Realdom.I~.Holder'); - -} - -namespace Hoa\Praspel\Model\Variable { +use Hoa\Core; +use Hoa\Math; +use Hoa\Praspel; +use Hoa\Realdom; +use Hoa\Visitor; /** * Class \Hoa\Praspel\Model\Variable. * * Represent a variable. * - * @author Ivan Enderlin <ivan.enderlin@hoa-project.net> - * @copyright Copyright © 2007-2015 Ivan Enderlin. + * @copyright Copyright © 2007-2015 Hoa community * @license New BSD License */ - class Variable - implements \Hoa\Visitor\Element, - \Hoa\Realdom\IRealdom\Holder { - + implements Visitor\Element, + Realdom\IRealdom\Holder +{ /** * Variable name. * - * @var \Hoa\Praspel\Model\Variable string + * @var string */ protected $_name = null; /** * Local (let) or not. * - * @var \Hoa\Praspel\Model\Variable bool + * @var bool */ protected $_local = false; /** * Clause that contains this variable. * - * @var \Hoa\Praspel\Model\Clause object + * @var \Hoa\Praspel\Model\Clause */ protected $_clause = null; /** * Variable value. * - * @var \Hoa\Praspel\Model\Variable mixed + * @var mixed */ protected $_value = null; /** * Domains that describe the variable. * - * @var \Hoa\Realdom\Disjunction object + * @var \Hoa\Realdom\Disjunction */ protected $_domains = null; /** * References domains. * - * @var \Hoa\Realdom\Disjunction object + * @var \Hoa\Realdom\Disjunction */ protected $_refDomains = null; /** * Alias variable (please, see “domainof”). * - * @var \Hoa\Praspel\Model\Variable object + * @var \Hoa\Praspel\Model\Variable */ protected $_alias = null; /** * Constraints. * - * @var \Hoa\Praspel\Model\Variable array + * @var array */ - protected $_constraints = array(); + protected $_constraints = []; /** * Temporary constraints type. * Useful when propagate new constraints. * - * @var \Hoa\Praspel\Model\Variable string + * @var string */ protected $_tmpConstraintsType = null; @@ -139,7 +122,7 @@ class Variable * Temporary constraints index. * Useful when propagate new constraints. * - * @var \Hoa\Praspel\Model\Variable string + * @var string */ protected $_tmpConstraintsIndex = null; @@ -148,23 +131,27 @@ class Variable /** * Build a variable. * - * @access public * @param string $name Name. * @param bool $local Local. * @param \Hoa\Praspel\Model\Clause $clause Clause. * @return void - * @throw \Hoa\Praspel\Exception\Model + * @throws \Hoa\Praspel\Exception\Model */ - public function __construct ( $name, $local, - \Hoa\Praspel\Model\Clause $clause = null ) { - - if( ('\old' === substr($name, 0, 4) - || '\result' === $name) - && !($clause instanceof \Hoa\Praspel\Model\Ensures)) - throw new \Hoa\Praspel\Exception\Model( + public function __construct( + $name, + $local, + Praspel\Model\Clause $clause = null + ) { + if (('\old' === substr($name, 0, 4) || + '\result' === $name) && + !($clause instanceof Praspel\Model\Ensures)) { + throw new Praspel\Exception\Model( '\old(…) and \result are only allowed in @ensures, ' . 'given %s in @%s.', - 0, array($name, $clause->getName())); + 0, + [$name, $clause->getName()] + ); + } $this->_name = $name; $this->_local = $local; @@ -177,12 +164,11 @@ class Variable /** * Set a value to the variable. * - * @access public * @param mixed $value Value. * @return mixed */ - public function setValue ( $value ) { - + public function setValue($value) + { $old = $this->_value; $this->_value = $value; @@ -192,11 +178,10 @@ class Variable /** * Get value of the variable. * - * @access public * @return mixed */ - public function &getValue ( ) { - + public function &getValue() + { return $this->_value; } @@ -204,16 +189,14 @@ class Variable * Allow to write $variable->in = … to define domains (if $name is not equal * to "in", then it is a normal behavior). * - * @access public * @param string $name Name. * @param mixed $value Value. * @return void - * @throw \Hoa\Praspel\Exception\Model + * @throws \Hoa\Praspel\Exception\Model */ - public function __set ( $name, $value ) { - - if('in' !== $name) { - + public function __set($name, $value) + { + if ('in' !== $name) { $this->$name = $value; return; @@ -221,19 +204,22 @@ class Variable $onDomains = $this->_domains === $this->_refDomains; - if( true === $onDomains - && !empty($this->_domains)) - throw new \Hoa\Praspel\Exception\Model( + if (true === $onDomains && + !empty($this->_domains)) { + throw new Praspel\Exception\Model( 'Variable $%s has already declared domains.', - 1, $this->getName()); + 1, + $this->getName() + ); + } - if(!($value instanceof \Hoa\Realdom\Disjunction)) + if (!($value instanceof Realdom\Disjunction)) { $value = realdom()->const($value); + } $this->_refDomains = $value; - if(false === $onDomains) { - + if (false === $onDomains) { $this->_domains->propagateConstraints( $this->_tmpConstraintsType, $this->_tmpConstraintsIndex @@ -248,8 +234,9 @@ class Variable $this->_domains->setHolder($this); - foreach($this->_domains as $domain) + foreach ($this->_domains as $domain) { $domain->setConstraints($this->_constraints); + } return; } @@ -261,10 +248,11 @@ class Variable * @param mixed $q Sampled value. * @return boolean */ - public function predicate ( $q = null ) { - - if(null === $q) + public function predicate($q = null) + { + if (null === $q) { $q = $this->getValue(); + } return $this->getDomains()->predicate($q); } @@ -272,43 +260,41 @@ class Variable /** * Call the sample() method on realistic domains. * - * @access public * @param \Hoa\Math\Sampler $sampler Sampler. * @return mixed - * @throw \Hoa\Realdom\Exception + * @throws \Hoa\Realdom\Exception */ - public function sample ( \Hoa\Math\Sampler $sampler = null ) { - + public function sample(Math\Sampler $sampler = null) + { return $this->getDomains()->sample($sampler); } /** * Call the reset() method on realistic domains. * - * @access public * @return void */ - public function reset ( ) { - + public function reset() + { return $this->getDomains()->reset(); } /** * Define a “key” constraint. Use $variable->key(…)->in = …; * - * @access public * @param mixed $scalar Value. * @return \Hoa\Praspel\Model\Variable */ - public function key ( $scalar ) { - - if(!isset($this->_constraints['key'])) - $this->_constraints['key'] = array(); + public function key($scalar) + { + if (!isset($this->_constraints['key'])) { + $this->_constraints['key'] = []; + } unset($this->_refDomains); - $handle = &$this->_constraints['key'][]; - $handle[0] = realdom()->const($scalar); - $this->_refDomains = &$handle[1]; + $handle = &$this->_constraints['key'][]; + $handle[0] = realdom()->const($scalar); + $this->_refDomains = &$handle[1]; end($this->_constraints['key']); $this->_tmpConstraintsType = 'key'; @@ -320,14 +306,14 @@ class Variable /** * Define a “contains” constraint. * - * @access public * @param mixed $scalar Value. * @return \Hoa\Praspel\Model\Variable */ - public function contains ( $scalar ) { - - if(!isset($this->_constraints['contains'])) - $this->_constraints['contains'] = array(); + public function contains($scalar) + { + if (!isset($this->_constraints['contains'])) { + $this->_constraints['contains'] = []; + } $this->_constraints['contains'][] = realdom()->const($scalar); @@ -337,14 +323,14 @@ class Variable /** * Add an “is” constraint. * - * @access public * @param string ... Keywords. * @return \Hoa\Praspel\Model\Variable */ - public function is ( ) { - - if(!isset($this->_constraints['is'])) - $this->_constraints['is'] = array(); + public function is() + { + if (!isset($this->_constraints['is'])) { + $this->_constraints['is'] = []; + } $this->_constraints['is'] = array_merge( $this->_constraints['is'], @@ -357,25 +343,30 @@ class Variable /** * Declare a “domainof” (alias). * - * @access public * @param \Hoa\Praspel\Model\Variable $variable Variable. * @return \Hoa\Praspel\Model\Variable - * @throw \Hoa\Realdom\Exception + * @throws \Hoa\Realdom\Exception */ - public function domainof ( $variable ) { - + public function domainof($variable) + { $variables = $this->getClause()->getLocalVariables(); - if(!isset($variables[$variable])) - throw new \Hoa\Praspel\Exception\Model( + if (!isset($variables[$variable])) { + throw new Praspel\Exception\Model( 'Variable $%s does not exist, cannot alias domains to $%s.', - 2, array($variable, $this->getName())); + 2, + [$variable, $this->getName()] + ); + } - if(!empty($this->_domains)) - throw new \Hoa\Praspel\Exception\Model( + if (!empty($this->_domains)) { + throw new Praspel\Exception\Model( 'Variable $%s already has domains, cannot alias new domains ' . 'from $%s.', - 3, array($this->getName(), $variable)); + 3, + [$this->getName(), $variable] + ); + } $this->_alias = $variable; $this->_domains = &$variables[$variable]->getDomains(); @@ -386,103 +377,91 @@ class Variable /** * Get domains. * - * @access public * @return \Hoa\Realdom\Disjunction */ - public function &getDomains ( ) { - + public function &getDomains() + { return $this->_domains; } /** * Get held realdoms. * - * @access public * @return \Hoa\Realdom\Disjunction */ - public function &getHeld ( ) { - + public function &getHeld() + { return $this->getDomains(); } /** * Get variable name. * - * @access public * @return string */ - public function getName ( ) { - + public function getName() + { return $this->_name; } /** * Check if the variable is local (let) or not. * - * @access public * @return bool */ - public function isLocal ( ) { - + public function isLocal() + { return $this->_local; } /** * Get constraints. * - * @access public * @return array */ - public function getConstraints ( ) { - + public function getConstraints() + { return $this->_constraints; } /** * Get alias. * - * @access public * @return \Hoa\Praspel\Model\Variable */ - public function getAlias ( ) { - + public function getAlias() + { return $this->_alias; } /** * Get parent clause. * - * @access public * @return \Hoa\Praspel\Model\Clause */ - public function getClause ( ) { - + public function getClause() + { return $this->_clause; } /** * Accept a visitor. * - * @access public * @param \Hoa\Visitor\Visit $visitor Visitor. * @param mixed &$handle Handle (reference). * @param mixed $eldnah Handle (no reference). * @return mixed */ - public function accept ( \Hoa\Visitor\Visit $visitor, - &$handle = null, $eldnah = null ) { - + public function accept( + Visitor\Visit $visitor, + &$handle = null, + $eldnah = null + ) { return $visitor->visit($this, $handle, $eldnah); } } -} - -namespace { - /** * Flex entity. */ -Hoa\Core\Consistency::flexEntity('Hoa\Praspel\Model\Variable\Variable'); - -} +Core\Consistency::flexEntity('Hoa\Praspel\Model\Variable\Variable'); |