private function validateNumber(): bool
    {
        $value = $this->value;
        $length = \strlen($value);
        $sum = 0;
        $weight = 2;

        if ($length < 2) {
            $this->setError(self::VALIDATOR_ERROR_CREDIT_CARD_NUMBER_NOT_VALID);
            return false;
        }

        for ($i = $length - 2; $i >= 0; $i--) {
            $digit = $weight * $value[$i];
            $sum += \floor($digit / 10) + $digit % 10;
            $weight = $weight % 2 + 1;
        }

        if ((10 - $sum % 10) % 10 != $value[$length - 1]) {
            $this->setError(self::VALIDATOR_ERROR_CREDIT_CARD_NUMBER_NOT_VALID);
            return false;
        }
        return true;
    }