public function validateVatNumberFormat(string $vatNumber) : bool
    {
        if ($vatNumber === '') {
            return false;
        }

        $vatNumber = strtoupper($vatNumber);
        $country = substr($vatNumber, 0, 2);
        $number = substr($vatNumber, 2);

        if (! isset($this->patterns[$country]) ) {
            return false;
        }

        $matches = preg_match('/^' . $this->patterns[$country] . '$/', $number) > 0;
        return $matches;
    }
public function validateVatNumberFormat(string $vatNumber) : bool
    {
        if ($vatNumber === '') {
            return false;
        }

        $vatNumber = strtoupper($vatNumber);
        $country = substr($vatNumber, 0, 2);
        $number = substr($vatNumber, 2);

        if (! isset($this->patterns[$country]) ) {
            return false;
        }

        $matches = preg_match('/^' . $this->patterns[$country] . '$/', $number) > 0;
        return $matches;
    }
public function validateVatNumberFormat ( string $ vatNumber ) : bool { if ( $ vatNumber === '' ) { return false ; } $ vatNumber = strtoupper ( $ vatNumber ) ; $ country = substr ( $ vatNumber , 0 , 2 ) ; $ number = substr ( $ vatNumber , 2 ) ; if ( ! isset ( $ this -> patterns [ $ country ] ) ) { return false ; } $ matches = preg_match ( '/^' . $ this -> patterns [ $ country ] . '$/' , $ number ) > 0 ; return $ matches ; }
Validate a VAT number format. This does not check whether the VAT number was really issued.

@param string $vatNumber

@return boolean
Validate a VAT number format . This does not check whether the VAT number was really issued .