[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 declare(strict_types=1); 4 5 namespace Doctrine\Inflector\Rules; 6 7 use function array_map; 8 use function implode; 9 use function preg_match; 10 11 class Patterns 12 { 13 /** @var Pattern[] */ 14 private $patterns; 15 16 /** @var string */ 17 private $regex; 18 19 public function __construct(Pattern ...$patterns) 20 { 21 $this->patterns = $patterns; 22 23 $patterns = array_map(static function (Pattern $pattern): string { 24 return $pattern->getPattern(); 25 }, $this->patterns); 26 27 $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; 28 } 29 30 public function matches(string $word): bool 31 { 32 return preg_match($this->regex, $word, $regs) === 1; 33 } 34 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |