Checks/fixes so reservation number is a valid input.

@param string &$rno Reservation number.

@throws KlarnaException
@return void
196675
private function _checkRNO(&$rno)
    {
        if (!is_string($rno)) {
            $rno = strval($rno);
        }
        if (strlen($rno) == 0) {
            throw new Klarna_ArgumentNotSetException("RNO");
        }
    }
1142320
private function _checkCountry(&$country)
    {
        if (!isset($country)) {
            throw new Klarna_ArgumentNotSetException("Country");
        }
        if (is_numeric($country) && !is_int($country)) {
            $country = intval($country);
        }
        if (!is_numeric($country) || !is_int($country)) {
            throw new Klarna_InvalidTypeException("Country", "integer");
        }
    }
1121398
private function _checkInt(&$int, $field)
    {
        if (!isset($int)) {
            throw new Klarna_ArgumentNotSetException($field);
        }
        if (is_numeric($int) && !is_int($int)) {
            $int = intval($int);
        }
        if (!is_numeric($int) || !is_int($int)) {
            throw new Klarna_InvalidTypeException($field, "integer");
        }
    }
656687
public function handleSignal($signo)
    {
        switch ($signo) {
            case \SIGINT:
            case \SIGTERM:
                if (!is_null($this->lastSignal) && $this->lastSignal <= (time() - 5)) {
                    $this->workshop->stopNow();
                } else {
                    $this->lastSignal = time();
                    $this->workshop->stop();
                }
                break;
        }
    }
164871
private function _checkLanguage(&$language)
    {
        if (!isset($language)) {
            throw new Klarna_ArgumentNotSetException("Language");
        }
        if (is_numeric($language) && !is_int($language)) {
            $language = intval($language);
        }
        if (!is_numeric($language) || !is_int($language)) {
            throw new Klarna_InvalidTypeException("Language", "integer");
        }
    }
1326785
public function setEmail(string $email): void
	{
		if (!Validators::isEmail($email)) {
			throw new InvalidArgumentException('Value is not valid email');
		}

		/* @var $repository UsersRepository */
		$repository = $this->getRepository();
		$user = $repository->getByEmail($email);
		if ($user !== null && $user !== $this) {
			throw new UniqueConstraintViolationException("Email '$email' exists");
		}
		$this->email = $email;
	}
72415
protected function checkValue(): void
    {
        if (!ctype_digit($this->value) && !is_numeric($this->value) && !empty($this->value)) {
            throw new InvalidArgumentException('NumericParser: Value must be of type numeric');
        }
    }
1001465
private function validateDeterministic(Grammar $grammar): void
    {
        /** @var Item[] */
        $finite = [];
        $terminals = [];
        $non_terminals = [];
        foreach ($this->items as $item) {
            $next_symbol = $item->getExpected();
            if (!$next_symbol) {
                $finite[] = $item;
            } elseif ($next_symbol->isTerminal()) {
                $terminals[] = $item;
            } else {
                $non_terminals[] = $item;
            }
        }

        $this->validateDeterministicShiftReduce(
            $finite,
            $terminals,
            $non_terminals,
            $grammar
        );
        $this->validateDeterministicReduceReduce($finite);
    }
855347
public static function checkLanguage($country, $language)
    {
        switch($country) {
        case KlarnaCountry::AT:
        case KlarnaCountry::DE:
            return ($language === KlarnaLanguage::DE);
        case KlarnaCountry::NL:
            return ($language === KlarnaLanguage::NL);
        case KlarnaCountry::FI:
            return ($language === KlarnaLanguage::FI);
        case KlarnaCountry::DK:
            return ($language === KlarnaLanguage::DA);
        case KlarnaCountry::NO:
            return ($language === KlarnaLanguage::NB);
        case KlarnaCountry::SE:
            return ($language === KlarnaLanguage::SV);
        default:
            //Country not yet supported by Klarna.
            return false;
        }
    }
12684
public function php_error_handler($errno, $errstr, $errfile, $errline)
    {
        $e = new \Exception($errstr, $errno);
        call_user_func($this->error50x, $e);
    }
976249
protected function checkSaltPositionArgument($position): void
    {
        if (!in_array($position, [self::SALT_BEFORE, self::SALT_AFTER])) {
            throw new InvalidArgumentException(sprintf(
                '`%s` is an invalud argument, it has to be `` or ``',
                $position,
                self::SALT_BEFORE,
                self::SALT_AFTER
            ));
        }
    }
1363733
public function execute($lineNr = null, $forRoundOrder = null, $usesRoundRound = null, $roundField = null)
    {
        $batch  = $this->getBatch();
        $import = $batch->getVariable('import');

        if (! (isset($import['trackId']) && $import['trackId'])) {
            // Do nothing
            return;
        }

        if (isset($import['roundOrders'][$usesRoundRound]) &&
                $import['roundOrders'][$usesRoundRound]) {

            $this->db->update(
                    'gems__rounds',
                    array($roundField => $import['roundOrders'][$usesRoundRound]),
                    $this->db->quoteInto("gro_id_order = ? AND ", $forRoundOrder) .
                        $this->db->quoteInto("gro_id_track = ?", $import['trackId'])
                    );
        }
    }
104477
public function setRrn($value)
    {
        if ($value === null || $value === '') {
            $this->_rrn = $value;
        } elseif (TypeCast::canCastToEnumString($value)) {
            $this->_rrn = (string)$value;
        } else {
            throw new InvalidPropertyValueTypeException('Invalid rrn value type', 0,
                'authorization_details.rrn', $value);
        }
    }
1146524
public function validate($order, Constraint $constraint): void
    {
        /** @var OrderInterface $order */
        Assert::isInstanceOf($order, OrderInterface::class);

        /** @var OrderShippingMethodEligibility $constraint */
        Assert::isInstanceOf($constraint, OrderShippingMethodEligibility::class);

        $shipments = $order->getShipments();
        if ($shipments->isEmpty()) {
            return;
        }

        foreach ($shipments as $shipment) {
            if (!$this->methodEligibilityChecker->isEligible($shipment, $shipment->getMethod())) {
                $this->context->addViolation(
                    $constraint->message,
                    ['%shippingMethodName%' => $shipment->getMethod()->getName()]
                );
            }
        }
    }
777144
public function scheduleForUpdate($entity) : void
    {
        $oid = spl_object_id($entity);

        if (! isset($this->entityIdentifiers[$oid])) {
            throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update');
        }

        if (isset($this->entityDeletions[$oid])) {
            throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update');
        }

        if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
            $this->entityUpdates[$oid] = $entity;
        }
    }
379896
private function _checkCurrency(&$currency)
    {
        if (!isset($currency)) {
            throw new Klarna_ArgumentNotSetException("Currency");
        }
        if (is_numeric($currency) && !is_int($currency)) {
            $currency = intval($currency);
        }
        if (!is_numeric($currency) || !is_int($currency)) {
            throw new Klarna_InvalidTypeException("Currency", "integer");
        }
    }
1063760
public function setCountry($country)
    {
        if ($country === null) {
            throw new Klarna_ArgumentNotSetException('Country');
        }
        if (is_numeric($country)) {
            if (!is_int($country)) {
                $country = intval($country);
            }
            $this->country = $country;
            return;
        }
        if (strlen($country) == 2 || strlen($country) == 3) {
            $this->setCountry(KlarnaCountry::fromCode($country));
            return;
        }
        throw new KlarnaException("Failed to set country! ($country)");
    }