Skip to content

Commit

Permalink
Merge pull request #3010 from acrobat/node-iterator-typehints
Browse files Browse the repository at this point in the history
[NodeBundle] Add docblock return types for node iterator class
  • Loading branch information
acrobat committed Oct 25, 2021
2 parents 120e234 + d896acf commit e0d68ec
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/Kunstmaan/NodeBundle/Entity/NodeIterator.php
Expand Up @@ -23,34 +23,49 @@ public function hasChildren()
}

/**
* @return \?RecursiveIterator
* @return \RecursiveIterator
*/
#[\ReturnTypeWillChange]
public function getChildren()
{
return new NodeIterator($this->_data->current()->getChildren());
}

/**
* @return Node
*/
public function current()
{
return $this->_data->current();
}

/**
* @return void
*/
public function next()
{
$this->_data->next();
}

/**
* @return int
*/
public function key()
{
return $this->_data->key();
}

/**
* @return bool
*/
public function valid()
{
return $this->_data->current() instanceof Node;
}

/**
* @return void
*/
public function rewind()
{
$this->_data->first();
Expand Down

0 comments on commit e0d68ec

Please sign in to comment.