src/main/php/routing/Route.php
private function arrayFrom($requestMethod): array
    {
        if (is_string($requestMethod)) {
            return [$requestMethod];
        }

        if (null === $requestMethod) {
            return [Http::GET, Http::HEAD, Http::POST, Http::PUT, Http::DELETE];
        }

        if (is_array($requestMethod)) {
            return $requestMethod;
        }

        throw new \InvalidArgumentException(
                'Given request method must be null, a string or an array, but received '
                . typeOf($requestMethod)
        );
    }
private function arrayFrom($requestMethod): array
    {
        if (is_string($requestMethod)) {
            return [$requestMethod];
        }

        if (null === $requestMethod) {
            return [Http::GET, Http::HEAD, Http::POST, Http::PUT, Http::DELETE];
        }

        if (is_array($requestMethod)) {
            return $requestMethod;
        }

        throw new \InvalidArgumentException(
                'Given request method must be null, a string or an array, but received '
                . typeOf($requestMethod)
        );
    }
private function arrayFrom ( $ requestMethod ) : array { if ( is_string ( $ requestMethod ) ) { return [ $ requestMethod ] ; } if ( null === $ requestMethod ) { return [ Http :: GET , Http :: HEAD , Http :: POST , Http :: PUT , Http :: DELETE ] ; } if ( is_array ( $ requestMethod ) ) { return $ requestMethod ; } throw new \ InvalidArgumentException ( 'Given request method must be null, a string or an array, but received ' . typeOf ( $ requestMethod ) ) ; }
turns given value into a list

@param   string|string[]  $requestMethod
@return  string[]
@throws  \InvalidArgumentException
turns given value into a list