libphonenumber\PhoneNumberToTimeZonesMapper::getTimeZonesForNumber PHP Method

getTimeZonesForNumber() public method

As per {@link #getTimeZonesForGeographicalNumber(PhoneNumber)} but explicitly checks the validity of the number passed in.
public getTimeZonesForNumber ( PhoneNumber $number ) : array
$number PhoneNumber PhoneNumber the phone number for which we want to get the time zones to which it belongs
return array a list of the corresponding time zones or a single element list with the default unknown time zone if no other time zone was found or if the number was invalid
    public function getTimeZonesForNumber(PhoneNumber $number)
    {
        $numberType = $this->phoneUtil->getNumberType($number);
        if ($numberType === PhoneNumberType::UNKNOWN) {
            return $this->unknownTimeZoneList;
        } elseif (!!PhoneNumberUtil::getInstance()->isNumberGeographical($numberType, $number->getCountryCode())) {
            return $this->getCountryLevelTimeZonesforNumber($number);
        }
        return $this->getTimeZonesForGeographicalNumber($number);
    }