diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2014-04-01 14:49:02 +0200 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2014-04-01 14:49:02 +0200 |
commit | 65ad33fd7da0c3e1d7afdcd6bc30acc1d5dbb52b (patch) | |
tree | ae3254986aa8071a1af1f45ae142f3b20c008562 | |
parent | 78d81ac4a1077cfc455ccacff1c5e9b9aa345459 (diff) | |
download | Praspel-65ad33fd7da0c3e1d7afdcd6bc30acc1d5dbb52b.zip Praspel-65ad33fd7da0c3e1d7afdcd6bc30acc1d5dbb52b.tar.gz Praspel-65ad33fd7da0c3e1d7afdcd6bc30acc1d5dbb52b.tar.bz2 |
Allow missing @requires.
-rw-r--r-- | Iterator/Coverage/Structural.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Iterator/Coverage/Structural.php b/Iterator/Coverage/Structural.php index 77c496b..c55d8d7 100644 --- a/Iterator/Coverage/Structural.php +++ b/Iterator/Coverage/Structural.php @@ -243,8 +243,17 @@ class Structural implements \Hoa\Iterator\Recursive { case static::STATE_REQUIRES: ++$this->_key; - $this->_current = $behavior->getClause('requires'); - $this->_path->push($this->_current); + + if(true === $behavior->clauseExists('requires')) { + + $this->_current = $behavior->getClause('requires'); + $this->_path->push($this->_current); + } + else { + + $this->_current = true; + $this->_path->push(null); + } if(true === $behavior->clauseExists('behavior')) { @@ -355,7 +364,7 @@ class Structural implements \Hoa\Iterator\Recursive { $this->_key = -1; unset($this->_path); - $this->_path = new \SplQueue(); + $this->_path = new \Hoa\Praspel\Iterator\WeakStack(); unset($this->_stack); $this->_stack = new \SplStack(); |