public function getCountry($countryCode)
    {
        // accept lowercase country codes
        $countryCode = strtoupper($countryCode);

        $result = current(array_filter($this->countries, function ($country) use ($countryCode) {
            /** @var VATCountry $country */
            return ($country->getCode() == $countryCode || $country->getCountryCode() == $countryCode);
        }));

        return $result != false ? $result : null;
    }
public function getCountry($countryCode)
    {
        // accept lowercase country codes
        $countryCode = strtoupper($countryCode);

        $result = current(array_filter($this->countries, function ($country) use ($countryCode) {
            /** @var VATCountry $country */
            return ($country->getCode() == $countryCode || $country->getCountryCode() == $countryCode);
        }));

        return $result != false ? $result : null;
    }
public function getCountry ( $ countryCode ) { // accept lowercase country codes $ countryCode = strtoupper ( $ countryCode ) ; $ result = current ( array_filter ( $ this -> countries , function ( $ country ) use ( $ countryCode ) { /** @var VATCountry $country */ return ( $ country -> getCode ( ) == $ countryCode || $ country -> getCountryCode ( ) == $ countryCode ) ; } ) ) ; return $ result != false ? $ result : null ; }
Find a country that used VAT at the current date.

@param string $countryCode

@return VATCountry|null
Find a country that used VAT at the current date .