src/RequestApplication.php
public function createRoute($routePath = null, $method = null, $params = null, $onlyReturn = false)
    {
        $withInternalCtrl = $routePath !== null;
        $routePath = isset($routePath) ? $routePath : $this->reqHelper->getPathInfo();
        $method = isset($method) ? $method : $this->reqHelper->getMethod();
        $data = Reaction::$app->router->searchRoute($this, $routePath, $method, $withInternalCtrl);
        //Parameters overwrite
        if (is_array($params) && count($data) >= 3) {
            $data[3] = $params;
        }
        $route = Reaction::create([
            'class' => RouteInterface::class,
            'app' => $this,
            'dispatchedData' => $data,
        ]);
        if (!$onlyReturn) {
            $this->_route = $route;
        }
        return $route;
    }
public function createRoute($routePath = null, $method = null, $params = null, $onlyReturn = false)
    {
        $withInternalCtrl = $routePath !== null;
        $routePath = isset($routePath) ? $routePath : $this->reqHelper->getPathInfo();
        $method = isset($method) ? $method : $this->reqHelper->getMethod();
        $data = Reaction::$app->router->searchRoute($this, $routePath, $method, $withInternalCtrl);
        //Parameters overwrite
        if (is_array($params) && count($data) >= 3) {
            $data[3] = $params;
        }
        $route = Reaction::create([
            'class' => RouteInterface::class,
            'app' => $this,
            'dispatchedData' => $data,
        ]);
        if (!$onlyReturn) {
            $this->_route = $route;
        }
        return $route;
    }
Create Route with given params
@param string|null $routePath
@param string|null $method
@param array|null  $params
@param bool        $onlyReturn
@return RouteInterface