Get callback class instance
@return Controller
@throws NotFoundException
17155
private function getCallbackClass()
    {
        // define callback class namespace/name full path
        $cName = (self::$Request->getCallbackAlias() ?? '\Apps\Controller\\' . env_name . '\\' . self::$Request->getController());
        if (!class_exists($cName)) {
            throw new NotFoundException('Callback class not found: ' . App::$Security->strip_tags($cName));
        }

        return new $cName;
    }
953826
public function getController()
    {
        if ($this->controller) {
            return $this->controller;
        }
        foreach (array_reverse(ClassInfo::ancestry($this->class)) as $blockClass) {
            $controllerClass = "{$blockClass}Controller";
            if (class_exists($controllerClass)) {
                break;
            }
        }
        if (!class_exists($controllerClass)) {
            throw new ValidationException("Could not find controller class for $this->classname");
        }

        $this->controller = Injector::inst()->create($controllerClass, $this);
        $this->controller->init();

        return $this->controller;
    }
342773
public function instanceController(): Controller
    {
        $this->sawContainer->setEnvironment(SawEnv::controller());

        return new Controller(
            $this->container->get('WorkCycle'),
            $this->container->get(ControllerCore::class),
            $this->container->get('ControllerServer'),
            $this->container->get(CommandDispatcher::class),
            $this->daemonConfig->getControllerPid() // todo
        );
    }
888925
protected function getRequest()
    {
        // Check if current request handler has a request object
        $controller = $this->getController();
        if ($controller && !($controller->getRequest() instanceof NullHTTPRequest)) {
            return $controller->getRequest();
        }
        // Fall back to current controller
        if (Controller::has_curr() && !(Controller::curr()->getRequest() instanceof NullHTTPRequest)) {
            return Controller::curr()->getRequest();
        }
        return null;
    }
1291387
public function getRequestControllerClass()
    {
        $controllerId = $this->getRequestControllerId();
        $controllerClass = Registry::getControllerClassNameResolver()->getClassNameById($controllerId);

        return $controllerClass;
    }
253031
public function getRequestHandler()
    {
        if (isset($this->requestHandler))
            return $this->requestHandler;

        // now instantiating handler from config
        $handlerClass = "\\" . ltrim($this->handlerClass, "\\");
        if (!class_exists($handlerClass))
            throw new RuntimeException("Unable to create HTTP Handler instance with class: " . var_export($handlerClass, true));

        $this->requestHandler = new $handlerClass();
        return $this->requestHandler;
    }
442664
public function getController()
    {
        if (! ($this->_controller instanceof LibBaseControllerAbstract)) {

            //Make sure we have a controller identifier
            if (! ($this->_controller instanceof AnServiceIdentifier)) {
                $this->setController($this->_controller);
            }

            $config = array(
                'response' => $this->getResponse(),
                'request' => $this->_request,
                'dispatched' => true,
            );

            $this->_controller = $this->getService($this->_controller, $config);
        }

        return $this->_controller;
    }
172010
function getCallback()
	{
		if (!$this->callbackUrl)
			$this->callbackUrl = $this->config->get('gateway.pasargad.callback-url');

		return $this->callbackUrl;
	}
415876
public function getControllerMiddlewareNext($controller, $method, MiddleWares $middleWares, $decorators)
    {
        return $this->nextClosure($middleWares, function() use ($controller, $method, $decorators) {
            return $this->injectionClass($controller, $method, [], $decorators);
        });
    }
124581
protected function getController()
    {
        list($class) = explode('@', $this->action['uses']);
        if (!$this->controller) {
            $this->controller = $this->container->make($class);
        }

        return $this->controller;
    }
880756
public function runController()
    {
        return (new ControllerDispatcher($this->container))->dispatch(
            $this, $this->getController(), $this->getControllerMethod()
        );
    }
66744
public function setController(){

		//check if the $urlComponentsArray has more than one value
		if(count($this->urlComponentsArray) > 0){

			//set the value of the controller
			$this->controller = $this->urlComponentsArray[0];

			//return this class instance
			return $this;

		}

		//there are no url params, set controller to null
		else{

			//there are no components in the url string set null for infered controller
			$this->controller = null;

			//return this class instance
			return $this;

		}


	}
1307665
public function prepareCallback($callback)
    {
        $result       = $callback;
        if (is_string($callback) && ($callbackInfo = $this->parseHandlerStr($callback))
            && class_exists($callbackInfo['class']) && method_exists(($controller
                = new $callbackInfo['class']), $callbackInfo['method'])) {
            $result = [$controller, $callbackInfo['method']];
        } elseif (!is_callable($callback)) {
            throw new \pwf\exception\HttpNotFoundException();
        }
        return $result;
    }
362739
public function get_callback_reflection() {
		if ( is_array( $this->callback ) ) {
			return new \ReflectionMethod( $this->callback[0], $this->callback[1] );
		} else {
			return new \ReflectionFunction( $this->callback );
		}
	}
258020
private function getReflectionMethod($controller)
    {
        if (preg_match('#(.+)::([\w]+)#', $controller, $matches)) {
            $class = $matches[1];
            $method = $matches[2];
        } elseif (preg_match('#(.+):([\w]+)#', $controller, $matches)) {
            $controller = $matches[1];
            $method = $matches[2];
            if ($this->container->has($controller)) {
                $this->container->enterScope('request');
                $this->container->set('request', new Request);
                $class = get_class($this->container->get($controller));
                $this->container->leaveScope('request');
            }
        }

        if (isset($class) && isset($method)) {
            try {
                return new \ReflectionMethod($class, $method);
            } catch (\ReflectionException $e) {
            }
        }

        return null;
    }
344517
public static function getRequestController()
    {
        $r = explode('/', ltrim(self::getRequestRoute(), '/'));
        if (isset($r[0]) && !empty($r[0]))
            return $r[0];
        else
            throw new NotFoundHttpException(\Yii::t('yii', 'Page not found.'));
    }
998860
public static function get($controllerClass) {
        if (!isset(self::$controllers[$controllerClass])) {
            if (class_exists($controllerClass)) {
                $reflectionClass = new ReflectionClass($controllerClass);
                self::$controllers[$controllerClass] = $reflectionClass->isAbstract()? $controllerClass : (new $controllerClass);
            }
            else {
                self::$controllers[$controllerClass] = null;
            }
        }
        return self::$controllers[$controllerClass];
    }