DragonBe\Vies\Validator\ValidatorDK::validate PHP Méthode

validate() public méthode

public validate ( string $vatNumber ) : boolean
$vatNumber string
Résultat boolean
    public function validate($vatNumber)
    {
        if (strlen($vatNumber) != 8) {
            return false;
        }
        $weights = array(2, 7, 6, 5, 4, 3, 2, 1);
        $checksum = $this->sumWeights($weights, $vatNumber);
        if ($checksum % 11 > 0) {
            return false;
        }
        return true;
    }
ValidatorDK