private function validateBusiness(string $vatNumber): bool
    {
        $weights = [1, 2, 3, 4, 5, 6, 7, 8];
        $checkval = $this->sumWeights($weights, $vatNumber);

        if ($checkval % 11 == 10) {
            $weights = [3, 4, 5, 6, 7, 8, 9, 10];
            $checkval = $this->sumWeights($weights, $vatNumber);

            $checkval = ($checkval % 11) == 10 ? 0 : ($checkval % 11);
        } else {
            $checkval = $checkval % 11;
        }

        return $checkval == (int) $vatNumber[8];
    }
private function validateBusiness(string $vatNumber): bool
    {
        $weights = [1, 2, 3, 4, 5, 6, 7, 8];
        $checkval = $this->sumWeights($weights, $vatNumber);

        if ($checkval % 11 == 10) {
            $weights = [3, 4, 5, 6, 7, 8, 9, 10];
            $checkval = $this->sumWeights($weights, $vatNumber);

            $checkval = ($checkval % 11) == 10 ? 0 : ($checkval % 11);
        } else {
            $checkval = $checkval % 11;
        }

        return $checkval == (int) $vatNumber[8];
    }
private function validateBusiness ( string $ vatNumber ) : bool { $ weights = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ; $ checkval = $ this -> sumWeights ( $ weights , $ vatNumber ) ; if ( $ checkval % 11 == 10 ) { $ weights = [ 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ; $ checkval = $ this -> sumWeights ( $ weights , $ vatNumber ) ; $ checkval = ( $ checkval % 11 ) == 10 ? 0 : ( $ checkval % 11 ) ; } else { $ checkval = $ checkval % 11 ; } return $ checkval == ( int ) $ vatNumber [ 8 ] ; }
Validation for business VAT ID's with 9 digits

@param string $vatNumber
@return bool
Validation for business VAT ID s with 9 digits