Hoa central
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Hoa\Praspel\Iterator\Coverage\Domain Class Reference
Inheritance diagram for Hoa\Praspel\Iterator\Coverage\Domain:

Public Member Functions

 __construct ($variables)
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 

Protected Member Functions

 _current ()
 

Protected Attributes

 $_variables = []
 
 $_max = 0
 
 $_key = 0
 
 $_current = null
 
 $_break = true
 

Detailed Description

Class .

Domain coverage.

Definition at line 49 of file Domain.php.

Constructor & Destructor Documentation

Hoa\Praspel\Iterator\Coverage\Domain::__construct (   $variables)

Constructor.

Parameters
mixed$variablesVariables.
Returns
void

Definition at line 94 of file Domain.php.

95  {
96  foreach ($variables as $variable) {
97  $this->_variables[] = $variable->getDomains()->getIterator();
98  }
99 
100  $this->_max = count($this->_variables) - 1;
101  $this->_break = empty($this->_variables);
102 
103  return;
104  }

Member Function Documentation

Hoa\Praspel\Iterator\Coverage\Domain::_current ( )
protected

Prepare the current value.

Returns
void

Definition at line 121 of file Domain.php.

122  {
123  $this->_current = [];
124 
125  foreach ($this->_variables as $variable) {
126  $current = $variable->current();
127  $this->_current[$current->getHolder()->getName()] = $current;
128  }
129 
130  return;
131  }

Here is the caller graph for this function:

Hoa\Praspel\Iterator\Coverage\Domain::current ( )

Get the current value.

Returns
array

Definition at line 111 of file Domain.php.

112  {
113  return $this->_current;
114  }

Here is the caller graph for this function:

Hoa\Praspel\Iterator\Coverage\Domain::key ( )

Get the current key.

Returns
int

Definition at line 138 of file Domain.php.

139  {
140  return $this->_key;
141  }
Hoa\Praspel\Iterator\Coverage\Domain::next ( )

Advance the internal collection pointer, and return the current value.

Returns
array

Definition at line 148 of file Domain.php.

149  {
150  for ($i = 0; $i <= $this->_max; ++$i) {
151  $this->_variables[$i]->next();
152 
153  if (false !== $this->_variables[$i]->valid()) {
154  break;
155  }
156 
157  $this->_variables[$i]->rewind();
158 
159  if ($i === $this->_max) {
160  $this->_break = true;
161 
162  break;
163  }
164  }
165 
166  ++$this->_key;
167  $this->_current();
168 
169  return $this->current();
170  }

Here is the call graph for this function:

Hoa\Praspel\Iterator\Coverage\Domain::rewind ( )

Rewind the internal collection pointer, and return the first collection.

Returns
array

Definition at line 177 of file Domain.php.

178  {
179  $this->_break = empty($this->_variables);
180  $this->_key = 0;
181 
182  foreach ($this->_variables as $variable) {
183  $variable->rewind();
184  }
185 
186  $this->_current();
187 
188  return $this->current();
189  }

Here is the call graph for this function:

Hoa\Praspel\Iterator\Coverage\Domain::valid ( )

Check if there is a current element after calls to the rewind() or the next() methods.

Returns
bool

Definition at line 197 of file Domain.php.

198  {
199  return false === $this->_break;
200  }

Here is the caller graph for this function:

Member Data Documentation

Hoa\Praspel\Iterator\Coverage\Domain::$_break = true
protected

Definition at line 84 of file Domain.php.

Hoa\Praspel\Iterator\Coverage\Domain::$_current = null
protected

Definition at line 77 of file Domain.php.

Hoa\Praspel\Iterator\Coverage\Domain::$_key = 0
protected

Definition at line 70 of file Domain.php.

Hoa\Praspel\Iterator\Coverage\Domain::$_max = 0
protected

Definition at line 63 of file Domain.php.

Hoa\Praspel\Iterator\Coverage\Domain::$_variables = []
protected

Definition at line 56 of file Domain.php.


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