DragonBe\Vies\Validator\ValidatorAbstract::sumWeights PHP Method

sumWeights() protected method

protected sumWeights ( array $weights, string $vatNumber, integer $start ) : integer
$weights array
$vatNumber string
$start integer
return integer
    protected function sumWeights(array $weights, $vatNumber, $start = 0)
    {
        $checkval = 0;
        $count = count($weights);
        for ($i = $start; $i < $count; $i++) {
            $checkval += (int) $vatNumber[$i] * $weights[$i];
        }
        return $checkval;
    }