function PcreException::fromFunction
Parameters
string $function:
string|string[] $pattern:
Return value
self
10 calls to PcreException::fromFunction()
- Preg::grep in vendor/
composer/ pcre/ src/ Preg.php - @template T of string|\Stringable
- Preg::match in vendor/
composer/ pcre/ src/ Preg.php - @param-out array<int|string, string|null> $matches
- Preg::matchAll in vendor/
composer/ pcre/ src/ Preg.php - @param-out array<int|string, list<string|null>> $matches
- Preg::matchAllWithOffsets in vendor/
composer/ pcre/ src/ Preg.php - Runs preg_match_all with PREG_OFFSET_CAPTURE
- Preg::matchWithOffsets in vendor/
composer/ pcre/ src/ Preg.php - Runs preg_match with PREG_OFFSET_CAPTURE
1 method overrides PcreException::fromFunction()
- UnexpectedNullMatchException::fromFunction in vendor/
composer/ pcre/ src/ UnexpectedNullMatchException.php
File
-
vendor/
composer/ pcre/ src/ PcreException.php, line 21
Class
Namespace
Composer\PcreCode
public static function fromFunction($function, $pattern) {
$code = preg_last_error();
if (is_array($pattern)) {
$pattern = implode(', ', $pattern);
}
return new PcreException($function . '(): failed executing "' . $pattern . '": ' . self::pcreLastErrorMessage($code), $code);
}