Hoa central
Public Member Functions | List of all members
Hoa\Praspel\Iterator\WeakStack Class Reference
Inheritance diagram for Hoa\Praspel\Iterator\WeakStack:

Public Member Functions

 valid ()
 
 isEmpty ()
 

Detailed Description

Class .

A weak stack is a SplStack with null elements that are not iterated.

Definition at line 47 of file WeakStack.php.

Member Function Documentation

Hoa\Praspel\Iterator\WeakStack::isEmpty ( )

Check whether the stack is empty or not. An element is present if different of null.

Returns
bool

Definition at line 71 of file WeakStack.php.

72  {
73  foreach ($this as $element) {
74  if (null !== $element) {
75  return false;
76  }
77  }
78 
79  return true;
80  }
Hoa\Praspel\Iterator\WeakStack::valid ( )

Skip null elements while validated the current one.

Returns
bool

Definition at line 54 of file WeakStack.php.

55  {
56  while (
57  true === parent::valid() &&
58  null === $this->current() &&
59  null === parent::next()
60  );
61 
62  return parent::valid();
63  }

The documentation for this class was generated from the following file: