public function isNumberMatchingDesc($nationalNumber, PhoneNumberDesc $numberDesc)
{
// Check if any possible number lengths are present; if so, we use them to avoid checking the
// validation pattern if they don't match. If they are absent, this means they match the general
// description, which we have already checked before checking a specific number type.
$actualLength = mb_strlen($nationalNumber);
$possibleLengths = $numberDesc->getPossibleLength();
if (count($possibleLengths) > 0 && !in_array($actualLength, $possibleLengths)) {
return false;
}
$nationalNumberPatternMatcher = new Matcher($numberDesc->getNationalNumberPattern(), $nationalNumber);
return $nationalNumberPatternMatcher->matches();
}