Hoa central
RegularExpression.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Iterator\Recursive;
38 
39 use Hoa\Iterator;
40 
55  implements Recursive
56 {
73  public function __construct(
74  \RecursiveIterator $iterator,
75  $regex,
76  $mode = self::MATCH,
77  $flags = 0,
78  $pregFlags = 0
79  ) {
80  parent::__construct($iterator, $regex, $mode, $flags, $pregFlags);
81 
82  return;
83  }
84 
90  public function accept()
91  {
92  return
93  true === $this->hasChildren() ||
94  true === parent::accept();
95  }
96 
102  public function getChildren()
103  {
104  return new static(
105  true === $this->hasChildren()
106  ? $this->getInnerIterator()->getChildren()
107  : null,
108  $this->getRegex(),
109  $this->getMode(),
110  $this->getFlags(),
111  $this->getPregFlags()
112  );
113  }
114 
120  public function hasChildren()
121  {
122  return $this->getInnerIterator()->hasChildren();
123  }
124 }
__construct(\RecursiveIterator $iterator, $regex, $mode=self::MATCH, $flags=0, $pregFlags=0)