diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-11-05 10:02:48 +0100 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-11-05 15:35:27 +0100 |
commit | 750cdea1d3476eaa8b2b5014ed78ec40d22e3a0a (patch) | |
tree | b1dc5b6415c518716dfad6c6e291217968731e0c /Model/Specification.php | |
parent | 88fb5a499ce18d537c275c2abfd79c34ca91f112 (diff) | |
download | Praspel-750cdea1d3476eaa8b2b5014ed78ec40d22e3a0a.zip Praspel-750cdea1d3476eaa8b2b5014ed78ec40d22e3a0a.tar.gz Praspel-750cdea1d3476eaa8b2b5014ed78ec40d22e3a0a.tar.bz2 |
Support $this.
Create the sub-library `Hoa\Praspel\AssertionChecker` and introduce
$this support through “implicit variables”.
Diffstat (limited to 'Model/Specification.php')
-rw-r--r-- | Model/Specification.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Model/Specification.php b/Model/Specification.php index 09b52cf..ad348af 100644 --- a/Model/Specification.php +++ b/Model/Specification.php @@ -87,6 +87,13 @@ class Specification extends Behavior { 'description' ); + /** + * Implicit variables. + * + * @var \Hoa\Praspel\Model\Specification array + */ + protected $_implicitVariables = array(); + /** @@ -101,6 +108,22 @@ class Specification extends Behavior { } /** + * Get an implicit variable. + * + * @access public + * @param string $identifier Identifier. + * @return \Hoa\Praspel\Model\Variable\Implicit + */ + public function getImplicitVariable ( $identifier ) { + + if(isset($this->_implicitVariables[$identifier])) + return $this->_implicitVariables[$identifier]; + + return $this->_implicitVariables[$identifier] + = new Variable\Implicit($identifier, false, $this); + } + + /** * Get identifier (fallback). * * @access protected |