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

Public Member Functions

 __construct (\RecursiveIterator $iterator, $regex, $mode=self::MATCH, $flags=0, $pregFlags=0)
 
 accept ()
 
 getChildren ()
 
 hasChildren ()
 
- Public Member Functions inherited from Hoa\Iterator\RegularExpression
 __construct (\Iterator $iterator, $regex, $mode=self::MATCH, $flags=0, $pregFlags=0)
 
 accept ()
 
 key ()
 
 current ()
 
 setMode ($mode)
 
 setFlags ($flags)
 
 setPregFlags ($pregFlags)
 
 getRegex ()
 
 getMode ()
 
 getFlags ()
 
 getPregFlags ()
 

Additional Inherited Members

- Public Attributes inherited from Hoa\Iterator\RegularExpression
const USE_KEY = 1
 
const INVERT_MATCH = 2
 
const MATCH = 0
 
const GET_MATCH = 1
 
const ALL_MATCHES = 2
 
const SPLIT = 3
 
const REPLACE = 4
 
 $replacement = null
 
- Protected Attributes inherited from Hoa\Iterator\RegularExpression
 $_regex = null
 
 $_mode = 0
 
 $_flags = 0
 
 $_pregFlags = 0
 
 $_key = 0
 
 $_current = null
 

Detailed Description

Class .

Re-implement the SPL RecursiveRegexIterator class. There are too many bugs in php-src and HHVM, so we re-implement it from scratch without extending the existing class.

Inspired by hhvm://hphp/system/php/spl/iterators/RecursiveRegexIterator.php

Definition at line 53 of file RegularExpression.php.

Constructor & Destructor Documentation

Hoa\Iterator\Recursive\RegularExpression::__construct ( \RecursiveIterator  $iterator,
  $regex,
  $mode = self::MATCH,
  $flags = 0,
  $pregFlags = 0 
)

Constructor.

Parameters
\RecursiveIterator$iteratorThe recursive iterator to apply this regex filter to.
string$regexThe regular expression to match.
int$modeOperation mode, please see the ::setMode method.
int$flagsSpecial flags, please see the ::setFlags method.
int$pregFlagsRegular expression flags, please see constants.
Returns
void

Definition at line 73 of file RegularExpression.php.

79  {
80  parent::__construct($iterator, $regex, $mode, $flags, $pregFlags);
81 
82  return;
83  }

Member Function Documentation

Hoa\Iterator\Recursive\RegularExpression::accept ( )

Get accept status.

Returns
bool

Definition at line 90 of file RegularExpression.php.

91  {
92  return
93  true === $this->hasChildren() ||
94  true === parent::accept();
95  }

Here is the call graph for this function:

Hoa\Iterator\Recursive\RegularExpression::getChildren ( )

Get an iterator for the current entry.

Returns

Definition at line 102 of file RegularExpression.php.

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  }

Here is the call graph for this function:

Hoa\Iterator\Recursive\RegularExpression::hasChildren ( )

Check whether an iterator can be obtained for the current entry.

Returns
bool

Definition at line 120 of file RegularExpression.php.

121  {
122  return $this->getInnerIterator()->hasChildren();
123  }

Here is the caller graph for this function:


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