public static function validate($vat)
{
if (empty($vat) || null === $vat || '' === $vat) {
return false;
}
$countryCode = substr($vat, 0, 2);
if (false === self::isValidCountryCode($countryCode)) {
return false;
}
$vat = substr($vat, 2);
if (0 === preg_match('/^' . self::$patterns[$countryCode] . '$/', $vat)) {
return false;
}
return true;
}