aboutsummaryrefslogtreecommitdiffstats
path: root/Iterator
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2014-03-31 18:42:46 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2014-03-31 18:42:46 +0200
commitec1aa6d84abd7667754620e96e3392367975f82b (patch)
tree2b07363f3b702e8e7fa1f10b41991f456445b1e2 /Iterator
parent62afa42d07ed15dad04a753c2c51a81108693fc1 (diff)
downloadPraspel-ec1aa6d84abd7667754620e96e3392367975f82b.zip
Praspel-ec1aa6d84abd7667754620e96e3392367975f82b.tar.gz
Praspel-ec1aa6d84abd7667754620e96e3392367975f82b.tar.bz2
Override the isEmpty() method.
Diffstat (limited to 'Iterator')
-rw-r--r--Iterator/WeakStack.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/Iterator/WeakStack.php b/Iterator/WeakStack.php
index 9c361ad..fa989ad 100644
--- a/Iterator/WeakStack.php
+++ b/Iterator/WeakStack.php
@@ -62,6 +62,22 @@ class WeakStack extends \SplStack {
return parent::valid();
}
+
+ /**
+ * Check whether the stack is empty or not.
+ * An element is present if different of null.
+ *
+ * @access public
+ * @return bool
+ */
+ public function isEmpty ( ) {
+
+ foreach($this as $element)
+ if(null !== $element)
+ return false;
+
+ return true;
+ }
}
}