diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2014-03-31 18:42:46 +0200 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2014-03-31 18:42:46 +0200 |
commit | ec1aa6d84abd7667754620e96e3392367975f82b (patch) | |
tree | 2b07363f3b702e8e7fa1f10b41991f456445b1e2 | |
parent | 62afa42d07ed15dad04a753c2c51a81108693fc1 (diff) | |
download | Praspel-ec1aa6d84abd7667754620e96e3392367975f82b.zip Praspel-ec1aa6d84abd7667754620e96e3392367975f82b.tar.gz Praspel-ec1aa6d84abd7667754620e96e3392367975f82b.tar.bz2 |
Override the isEmpty() method.
-rw-r--r-- | Iterator/WeakStack.php | 16 |
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; + } } } |