function Preg::enforceNonNullMatchAll
Parameters
array<int|string, list<string|null>> $matches:
Return value
array<int|string, list<string>>
Throws
1 call to Preg::enforceNonNullMatchAll()
- Preg::matchAllStrictGroups in vendor/
composer/ pcre/ src/ Preg.php - Variant of `match()` which outputs non-null matches (or throws)
File
-
vendor/
composer/ pcre/ src/ Preg.php, line 417
Class
Namespace
Composer\PcreCode
private static function enforceNonNullMatchAll(string $pattern, array $matches, string $variantMethod) {
foreach ($matches as $group => $groupMatches) {
foreach ($groupMatches as $match) {
if (null === $match) {
throw new UnexpectedNullMatchException('Pattern "' . $pattern . '" had an unexpected unmatched group "' . $group . '", make sure the pattern always matches or use ' . $variantMethod . '() instead.');
}
}
}
/** @var array<int|string, list<string>> */
return $matches;
}