libphonenumber\ShortNumberInfo::regionDialingFromMatchesNumber PHP Method

regionDialingFromMatchesNumber() protected method

Helper method to check that the country calling code of the number matches the region it's being dialed from.
protected regionDialingFromMatchesNumber ( PhoneNumber $number, string $regionDialingFrom ) : boolean
$number PhoneNumber
$regionDialingFrom string
return boolean
    protected function regionDialingFromMatchesNumber(PhoneNumber $number, $regionDialingFrom)
    {
        $regionCodes = $this->getRegionCodesForCountryCode($number->getCountryCode());
        return in_array($regionDialingFrom, $regionCodes);
    }