aboutsummaryrefslogtreecommitdiffstats
path: root/Model
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-09-16 12:12:19 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-09-16 12:12:19 +0200
commit22efd46b04b4e551d3c8fbab812225e7433367f4 (patch)
tree6116f77c28491036a0dc83c188a3873a731d028f /Model
parentb391d741d3ebbed3557aa38de81b0671d85580b2 (diff)
downloadPraspel-22efd46b04b4e551d3c8fbab812225e7433367f4.zip
Praspel-22efd46b04b4e551d3c8fbab812225e7433367f4.tar.gz
Praspel-22efd46b04b4e551d3c8fbab812225e7433367f4.tar.bz2
Declaration's iterator does not return local vars.
Diffstat (limited to 'Model')
-rw-r--r--Model/Declaration.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/Model/Declaration.php b/Model/Declaration.php
index a11d426..7d36937 100644
--- a/Model/Declaration.php
+++ b/Model/Declaration.php
@@ -54,6 +54,11 @@ from('Hoa')
-> import('Iterator.Aggregate')
/**
+ * \Hoa\Iterator\CallbackFilter
+ */
+-> import('Iterator.CallbackFilter')
+
+/**
* \Hoa\Iterator\Map
*/
-> import('Iterator.Map');
@@ -198,11 +203,17 @@ abstract class Declaration
* Iterator over local variables.
*
* @access public
- * @return \Hoa\Iterator\Map
+ * @return \Hoa\Iterator\CallbackFilter
*/
public function getIterator ( ) {
- return new \Hoa\Iterator\Map($this->getLocalVariables());
+ return new \Hoa\Iterator\CallbackFilter(
+ new \Hoa\Iterator\Map($this->getLocalVariables()),
+ function ( Variable $variable ) {
+
+ return false === $variable->isLocal();
+ }
+ );
}
/**