Returns the compiled path

@param string $action
@param string $method
@param array  $args

@return string
12472
private function getPath($action, $method, $args)
    {
        //first get the key
        $key = $this->getKey($action, $method, '/');

        //add a trailing seperator
        $path = '/' . $key;

        //if there are paths
        if (!empty($this->paths)) {
            //prefix the paths to the path
            $path = '/' . implode('/', $this->paths) . $path;
        }

        //if there are arguments
        if (!empty($args)) {
            //add that too
            $path .= '/' . implode('/', $args);
        }

        return str_replace('//', '/', $path);
    }
472697
private function callFindOrFailBy(string $method, array $arguments)
    {
        $whereByWithUpper = lcfirst(substr($method, 12, mb_strlen($method)));
        $whereBy = Str::convertCamelCaseToSnakeCase($whereByWithUpper);

        return $this->where($whereBy, '=', $arguments[0])->findOrFail();
    }
695458
private function runAction($action, $args)
    {
        $function = $action['function'];
        $argsNumber = $action['arguments'];

        $class = (isset($function[0])) ? $function[0] : false;
        $method = (isset($function[1])) ? $function[1] : false;

        $args = $this->getArguments($argsNumber, $args);

        if (! ($class && $method) && function_exists($function)) {
            return call_user_func($function, $args);
        } elseif ($obj = call_user_func([$class, $this->singleton])) {
            if ($obj !== false) {
                return call_user_func_array([$obj, $method], $args);
            }
        } elseif (class_exists($class)) {
            $instance = new $class;

            return call_user_func_array([$instance, $method], $args);
        }
    }
1275725
public function func($method, ...$args)
    {
        $this->method = $method;
        $this->args   = $args;
        return $this;
    }
1065220
protected function getActionUrl($action) : string
    {
        $context = Context::getInstance();
        return $context->getUrl($context->getParameter('controller_path') . $action);
    }
579774
public function getMethodByAction($action)
    {
        foreach ($this->methods as $method => $actions) {
            if (in_array($action, $actions)) {
                return $method;
            }
        }

        return 'get';
    }
1272560
public function match($path, $method, $action = null)
    {
        $rule = new Rule\HttpMethodRule();
        $rule->setPath($path);
        $rule->setMethod($method);
        $rule->setAction($action);
        $this->rules[] = $rule;
        return $rule;
    }
858293
public function walk($method, $arg = null, $object = null)
    {
        $result = array();
        foreach ($this->items($object) as $item) {
            $itemResult = $item->$method($arg);
            if ($itemResult === $item) {
                continue;
            }
            if (!is_array($itemResult)) {
                $result[] = $itemResult;
            } elseif (isset($itemResult[0])) {
                array_splice($result, count($result), 0, $itemResult);  
            } elseif (count($itemResult)) {
                $result += $itemResult;
            }
        }
        
        return $result;
    }
602953
public function buildUrl($controller, $action, array $args = array(), array $get = array())
    {
        $url = $this->buildDestination($controller, $action, $args);
        if (!$this->cleanUrlsEnabled()) {
            $url = $this->entryPoint.$url;
        }
        if ($get) {
            $url .= '?'.http_build_query($get);
        }

        return $url;
    }
1229471
public String path(M method, T target, Object... params) {
    MethodlessRouter<T> router = (method == null)? anyMethodRouter : routers.get(method);
    if (router == null) router = anyMethodRouter;

    String ret = router.path(target, params);
    if (ret != null) return ret;

    return (router == anyMethodRouter)? null : anyMethodRouter.path(target, params);
  }
304246
protected function invokeRegisterAction($arg) {
        list($class, $action) = explode('@', $arg);
        if (!class_exists($class)) {
            return $this->invokeController('Service\\'.app('app.module').'\\'.$class, $action);
        }
        $reflectionClass = new ReflectionClass( $class );
        $method = $reflectionClass->getMethod($action);

        $parameters = $method->getParameters();
        $arguments = array();
        foreach ($parameters as $param) {
            $arguments[] = app('request')->get($param->getName());
        }
        return call_user_func_array(array(new $class, $action), $arguments);
    }
1352350
public function getCacheKey($method, $args = null)
    {

        $request = app('Illuminate\Http\Request');
        $args = serialize($args);
        $criteria = $this->serializeCriteria();
        $key = sprintf('%s@%s-%s', get_called_class(), $method, md5($args . $criteria . $request->fullUrl()));

        CacheKeys::putKey(get_called_class(), $key);

        return $key;

    }
968843
private function mapArguments(AbstractController $controller, string $method, array $args) : array
    {
        $return = [];

        $reflection = new \ReflectionClass($controller);
        if (!$reflection->hasMethod($method)) {
            throw new \InvalidArgumentException(sprintf(
                "Method '%s' does not exist on '%s' for route '%s'",
                $method,
                get_class($controller),
                $this->currentRoute->getName()
            ));
        }

        $method = $reflection->getMethod($method);

        foreach ($method->getParameters() as $parameter) {
            if (!isset($args[$parameter->getName()]) && $parameter->isOptional() === false) {
                if ($method->getName() === 'init') {
                    continue;
                }

                throw new \InvalidArgumentException(sprintf(
                    "Missing mandatory arguments on controller definition '%s' on '%s'",
                    $parameter->getName(),
                    get_class($controller)
                ));
            }

            $return[$parameter->getName()] = null;

            if (array_key_exists($parameter->getName(), $args) && $args[$parameter->getName()] !== '') {
                $value = $args[$parameter->getName()];

                if ($parameter->getClass() && $parameter->getClass()->getName() == 'Cawa\Date\DateTime') {
                    $value = new DateTime($value);
                }

                $return[$parameter->getName()] = $value;
            } elseif (!array_key_exists($parameter->getName(), $args)) {
                $return[$parameter->getName()] = $parameter->getDefaultValue();
            }
        }

        return $return;
    }
424686
protected function getMappedWhereConstraint($method, ArgumentBag $args)
    {
        return function ($query) use ($method, $args) {
            call_user_func_array([$query, $method], $args->all());
        };
    }
323934
public function delegateMethodCall($method, array $arguments = [])
    {
        $config = $arguments['config'];

        if (isset($config['silent']) && $config['silent'] === true) {
            return $this->callFilesystemMethod($method, $arguments);
        }

        list($continue, $result) = $this->emitBefore($method, $arguments);

        if (! $continue) {
            return $result;
        }

        $result = $this->callFilesystemMethod($method, $result);

        return $this->emitAfter($method, $result, $arguments);
    }
701726
public function buildRequest($resource, $args = [], $method = 'get')
    {
        $query = [];

        if (isset($args[0]) && count($args[0]) == 1 && is_int($args[0])) {
            $resource = $resource.'/'.$args[0];
        }

        if (!empty($this->query)) {
            $query = $this->query;
        }

        return $this->sendRequest($resource, $query, $method);
    }
256594
private function addRoute($method, $pattern, $action)
    {

        if (is_array($method)) {
            foreach ($method as $verb) {
                $this->routes[$verb . $pattern] = ['method' => $verb, 'uri' => self::patternFactory($pattern), 'action' => $action];
            }
        } else {
            $this->routes[$method . $pattern] = ['method' => $method, 'uri' => self::patternFactory($pattern), 'action' => $action];
        }
    }