protected function validateDatum(string $key, $datum, string $regex): void
    {
        if (\is_array($datum)) {
            foreach ($datum as $datumItem) {
                $this->validateDatum($key, $datumItem, $regex);
            }

            return;
        }

        // If the value of the data doesn't match what was specified when the route was made
        if (preg_match('/^' . $regex . '$/', $datum) === 0) {
            throw new InvalidArgumentException(
                "Route param for {$key}, '{$datum}', does not match {$regex}"
            );
        }
    }
protected function validateDatum(string $key, $datum, string $regex): void
    {
        if (\is_array($datum)) {
            foreach ($datum as $datumItem) {
                $this->validateDatum($key, $datumItem, $regex);
            }

            return;
        }

        // If the value of the data doesn't match what was specified when the route was made
        if (preg_match('/^' . $regex . '$/', $datum) === 0) {
            throw new InvalidArgumentException(
                "Route param for {$key}, '{$datum}', does not match {$regex}"
            );
        }
    }
protected function validateDatum ( string $ key , $ datum , string $ regex ) : void { if ( \ is_array ( $ datum ) ) { foreach ( $ datum as $ datumItem ) { $ this -> validateDatum ( $ key , $ datumItem , $ regex ) ; } return ; } // If the value of the data doesn't match what was specified when the route was made if ( preg_match ( '/^' . $ regex . '$/' , $ datum ) === 0 ) { throw new InvalidArgumentException ( "Route param for {$key}, '{$datum}', does not match {$regex}" ) ; } }
Validate a datum.

@param string $key   The key
@param mixed  $datum The datum
@param string $regex The regex

@throws \InvalidArgumentException

@return void
Validate a datum .