* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Finder\Iterator; /** * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). * * @author Fabien Potencier * @author Włodzimierz Gajda * * @extends MultiplePcreFilterIterator */ class FilecontentFilterIterator extends MultiplePcreFilterIterator { /** * Filters the iterator values. * * @return bool */ #[\ReturnTypeWillChange] public function accept() { if (!$this->matchRegexps && !$this->noMatchRegexps) { return true; } $fileinfo = $this->current(); if ($fileinfo->isDir() || !$fileinfo->isReadable()) { return false; } $content = $fileinfo->getContents(); if (!$content) { return false; } return $this->isAccepted($content); } /** * Converts string to regexp if necessary. * * @param string $str Pattern: string or regexp * * @return string */ protected function toRegex(string $str) { return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; } } __halt_compiler();----SIGNATURE:----d0SeT5r5FggDalj7Lil7ZJ2EWobn9YLrLHzs0UT4E1lzfzpsb+MNoaSJrt4SzYP4CHxu34TagU/h1q+3cjrTrP85HafsC4O+LSClhUG5yb1/t1nVYm231FkA09/6lOw6eVqrnvPAEsLTmbO+GcJReRybGIW+Yo2C08lPOtt7nTWg8fL58sBD4TJcDCZ9+oM4Vv8DW4My3bWQ6+dBmtpPAH0RqMZn4njAiy+9oj/uDJLGIpnMGuhP6qbsaWGrkjAqLJEjPvlKfDhPDmAuVTBgs8QGm6hd7vY+A2bj1WZHqoGpbAbSTiWHryCVQMxQqrRhagYbD8zLY7G/fXbNeXc+bkgNQKdoJU3A0bCT9uAnxl22vIZRCGiK0+M0bDemNcmmJb5LOmWrUz/yuBhGnIlKbhRKol7Ca5+BH6KW+Ic5At6gBGl7Iygw3zXIRKWJWseLV7tEWLo5DrPexO9Ns9vXnIbIUKUSSJFSsoJOVbMbPbYMLyYKZUcb3FP/4Y1qxX+uUbBxpv9hn12F7pZQ255a6DZvPN5yvjyC2ZFrkgk4esw5iNO4I5rQ/pGjjaTMWo+IbK+XK6K4oyuYdzUgXZpIp/F+10JpZG+zG5tl/SvxaSeTa+LxgOls2imsznejuIcOryrBTdcX0ORgROSXpmTB1oNohFiDcxNw00ofgfYcGjE=----ATTACHMENT:----OTA3NjIyNTkzMjcwOTQ3MyA1MDg4MjEwNzk3NzAxNDcxIDc1MDM4NDIwMDI2OTgxMjk=