DragonBe\Vies\Validator\ValidatorPL::validate PHP Method

validate() public method

public validate ( string $vatNumber ) : boolean
$vatNumber string
return boolean
    public function validate($vatNumber)
    {
        if (strlen($vatNumber) != 10) {
            return false;
        }
        $weights = array(6, 5, 7, 2, 3, 4, 5, 6, 7);
        $checksum = (int) $vatNumber[9];
        $checkval = $this->sumWeights($weights, $vatNumber);
        if ($checkval % 11 != $checksum) {
            return false;
        }
        return true;
    }
ValidatorPL