public function dispatchUri(string $path = null, string $method = null)
    {
        $path = (string)($path ?: $_SERVER['REQUEST_URI']);

        if (\strpos($path, '?')) {
            $path = \parse_url($path, \PHP_URL_PATH);
        }

        // if 'filterFavicon' setting is TRUE
        if ($path === self::FAV_ICON && $this->options['filterFavicon']) {
            return null;
        }

        $method = (string)($method ?: $_SERVER['REQUEST_METHOD']);
        $method = \strtoupper($method);

        /** @var Route $route */
        [$status, $path, $route] = $this->router->match($path, $method);

        return $this->dispatch($status, $path, $method, $route);
    }
public function dispatchUri(string $path = null, string $method = null)
    {
        $path = (string)($path ?: $_SERVER['REQUEST_URI']);

        if (\strpos($path, '?')) {
            $path = \parse_url($path, \PHP_URL_PATH);
        }

        // if 'filterFavicon' setting is TRUE
        if ($path === self::FAV_ICON && $this->options['filterFavicon']) {
            return null;
        }

        $method = (string)($method ?: $_SERVER['REQUEST_METHOD']);
        $method = \strtoupper($method);

        /** @var Route $route */
        [$status, $path, $route] = $this->router->match($path, $method);

        return $this->dispatch($status, $path, $method, $route);
    }
public function dispatchUri ( string $ path = null , string $ method = null ) { $ path = ( string ) ( $ path ? : $ _SERVER [ 'REQUEST_URI' ] ) ; if ( \ strpos ( $ path , '?' ) ) { $ path = \ parse_url ( $ path , \ PHP_URL_PATH ) ; } // if 'filterFavicon' setting is TRUE if ( $ path === self :: FAV_ICON && $ this -> options [ 'filterFavicon' ] ) { return null ; } $ method = ( string ) ( $ method ? : $ _SERVER [ 'REQUEST_METHOD' ] ) ; $ method = \ strtoupper ( $ method ) ; /** @var Route $route */ [ $ status , $ path , $ route ] = $ this -> router -> match ( $ path , $ method ) ; return $ this -> dispatch ( $ status , $ path , $ method , $ route ) ; }
Runs the callback for the given path and method.
@param string $path
@param null|string $method
@return mixed
@throws \Throwable
@throws \RuntimeException
@throws \InvalidArgumentException
Runs the callback for the given path and method .