TYPO3  7.6
MultiplePcreFilterIterator.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace Symfony\Component\Finder\Iterator;
13 
15 
22 {
23  protected $matchRegexps = array();
24  protected $noMatchRegexps = array();
25 
33  public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns)
34  {
35  foreach ($matchPatterns as $pattern) {
36  $this->matchRegexps[] = $this->toRegex($pattern);
37  }
38 
39  foreach ($noMatchPatterns as $pattern) {
40  $this->noMatchRegexps[] = $this->toRegex($pattern);
41  }
42 
43  parent::__construct($iterator);
44  }
45 
53  protected function isRegex($str)
54  {
55  return Expression::create($str)->isRegex();
56  }
57 
65  abstract protected function toRegex($str);
66 }