@param string $controller

@return array
4118
public function getActions($controller)
    {
        $actions = [];
        foreach (get_class_methods($controller) as $method) {
            if (preg_match('#^(.*)Action$#', $method, $match)) {
                $actions[] = $match[1];
            }
        }

        return $actions;
    }
492279
private function getRawAndModuleControllers($controller, $module) {
        if ('/' == $module || '' == $module) {
            $rController = $controller;
            $allController = '*';
        } elseif (null === $module) {
            $rController = \mpf\WebApp::get()->request()->getModule() . '/' . $controller;
            $allController = \mpf\WebApp::get()->request()->getModule() . '/*';
        } else {
            $rController = $module . '/' . $controller;
            $allController = $module . '/*';
        }
        return array($rController, $allController);
    }
416390
private function getControllerActionAnnotations($controller, $action)
    {
        if ($controller instanceof \Closure) {
            return $this->annotation->readFunction($controller);
        }

        return $this->annotation->readMethod($controller, $action . 'Action');
    }
1242960
private function getPartsFromControllerName($controller)
    {
        if (3 != count($parts = explode(':', $controller))) {
            throw new \InvalidArgumentException(sprintf('The "%s" controller is not a valid a:b:c controller string.', $controller));
        }

        list($moduleName, $controller, $action) = $parts;
        $controller = str_replace('/', '\\', $controller);
        $module     = $this->moduleManager->getModule($moduleName);

        if (!is_object($module)) {
            throw new \RuntimeException(sprintf(
                'Unable to locate module: %s, when parsing controller: %s',
                $moduleName, $controller
            ));
        }

        $moduleName = $module->getName();

        return [$module, $moduleName, $controller, $action];
    }
1307532
public function findUriTemplatesByController($controller)
    {
        $result = array();

        foreach ($this->map as $uriTemplate => $options) {
            if (isset($options['controller']) && $options['controller'] == $controller) {
                array_push($result, $uriTemplate);
            }
        }

        return $result;
    }
1304169
protected function _getCommands($controller)
    {
        $commands = [];
        try {
            $controllerClassName = $this->_getControllerClassName($controller);

            if (!class_exists($controllerClassName)) {
                return [];
            }

            foreach ((new \ReflectionClass($controllerClassName))->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
                if (!$method->isStatic() && $method->isPublic() && preg_match('#^(.*)Command$#', $method->getShortName(), $matches) === 1) {
                    $commands[] = Text::underscore($matches[1]);
                }
            }
        } catch (\Exception $e) {

        }

        return $commands;
    }
603792
protected function constants(String & $controller)
    {
        if( ! empty($this->settings['constants']) )
        {
            foreach( $this->settings['constants'] as $key => $val )
            {
                $controller .= HT."const {$key} = {$val};".EOL;
            }

            $controller .= EOL;
        }
    }
690681
public function getMiddleware($controller, $method)
    {
        if (! method_exists($controller, 'getMiddleware')) {
            return [];
        }

        return collect($controller->getMiddleware())->reject(function ($data) use ($method) {
            return static::methodExcludedByOptions($method, $data['options']);
        })->pluck('middleware')->all();
    }
514162
public static function get(CheckoutStepController $controller)
    {
        $list = new ArrayList();
        $steps = self::getSteps();
        foreach ($steps as $step) {
            $data = new ViewableData();
            $data->Link = $controller->Link($step);
            $data->Title = _t("CheckoutSteps.$step", ucfirst($step));
            $data->InPast = self::inPast($step, $controller);
            $data->InFuture = self::inFuture($step, $controller);
            $data->Current = self::current($step, $controller);
            $list->add($data);
        }

        return $list;
    }
1325326
protected function _isSerializeTrue($controller) {
		if (!empty($controller->viewVars['_serialize']) && $controller->viewVars['_serialize'] === true) {
			return true;
		}
		return false;
	}
1322961
public function controller($controller)
    {

        // Instantiate a string controller
        if (is_string($controller)
            && class_exists($controller)
            && is_subclass_of($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = $controller;
            $this->controller = new $controller;

            // Apply the parent if one was set
            if ($this->parent_item && $this->controller) {
                $this->controller->parent($this->parent_item);
            }

        // Or, validate a passed controller instance
        } elseif (is_object($controller)
            && is_a($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = get_class($controller);
            $this->controller = $controller;
        }

        // Chain
        return $this;
    }
758345
protected function getControllerTargetModel($controller)
    {
        switch ($controller) {
            case 'respondent':
                $model = $this->loader->getModels()->getRespondentModel(true);
                $model->applyEditSettings();
                return $model;

            case 'calendar':
                $model = $this->loader->getModels()->createAppointmentModel();
                $this->applySource($model);
                $model->applyEditSettings();
                return $model;

            default:
                return null;
        }
    }
1322558
private function parseCallableController($controller, $container)
    {
        $controller  = rtrim($this->namespace, "\\") . "\\" . $this->parseCallablePlaceholders($controller);

        if ($container === null) {
               return new $controller;
        } else return $container($controller);
    }
1164920
public function getUserAllowed($controller)
    {
        $page = new Page();
        $id = $page->get(array('controller' => $controller))->getModel()->id;
        return $this->get(array('id_page' => $id));
    }
391637
protected function getController($controller)
	{
		$stub = $this->files->get(__DIR__.'/stubs/controller.stub');

		// We will explode out the controller name on the naemspace delimiter so we
		// are able to replace a namespace in this stub file. If no namespace is
		// provided we'll just clear out the namespace place-holder locations.
		$segments = explode('\\', $controller);

		$stub = $this->replaceNamespace($segments, $stub);

		return str_replace('{{class}}', last($segments), $stub);
	}
164786
public function getController($controller)
    {
        if ($controller == null) return null;
        $controllers = $this->pool[$controller] ?? null;
        if ($controllers == null) {
            $controllers = $this->pool[$controller] = new \SplQueue();
        }
        if (!$controllers->isEmpty()) {
            $controller_instance = $controllers->shift();
            $controller_instance->reUse();
            return $controller_instance;
        }
        if (class_exists($controller)) {
            $controller_instance = new $controller;
            if ($controller_instance instanceof Controller) {
                $controller_instance->core_name = $controller;
                $this->addNewCount($controller);
                return $controller_instance;
            }
        }
        $controller_new = str_replace('/', '\\', $controller);
        $class_name = "app\\Controllers\\$controller_new";
        if (class_exists($class_name)) {
            $controller_instance = new $class_name;
            $controller_instance->core_name = $controller;
            $this->addNewCount($controller);
            return $controller_instance;
        } else {
            if (!$this->allow_ServerController) {
                return null;
            }
            $class_name = "Server\\Controllers\\$controller_new";
            if (class_exists($class_name)) {
                $controller_instance = new $class_name;
                $controller_instance->core_name = $controller;
                $this->addNewCount($controller);
                return $controller_instance;
            } else {
                return null;
            }
        }
    }
1221365
protected function getRoute($controller)
    {
        $routes = $this->router->getRouteCollection()->all();
        foreach ($routes as $name => $route) {
            if ($controller === $route->getDefault('_controller')) {
                return [ $name, $route ];
            }
        }

        return null;
    }