@param string $controllerClass

@return ConfiguratorFactory
554689
private function fetchFromCache($controllerClass)
    {
        $reflectionController = new \ReflectionClass($controllerClass);
        if (!$this->cacheHandler->hasCache($reflectionController)) {
            //It's impossible but we need to prevent and make sure it is not throwing an exception
            return $this->configuratorFactory;
        }

        return $this->bind(require $this->cacheHandler->loadCache($reflectionController));
    }
504138
protected function encapsulate($class, $serviceConfig)
    {
        $encapsulators = $this->encapsulatorFactory->getEncapsulators();

        foreach ($encapsulators as $encapsulator) {
            $class = $encapsulator->encapsulate($this, $class, $serviceConfig);
        }

        return $class;
    }
109605
public function routable($class, $prefix = null)
    {
        $class = $this->resolveRoutableClassValue($class);

        $router = (new RoutableInspector($class))->generateRoutables(null, $prefix);

        $this->mergeRouter($router);

        return $this;
    }
655360
public function getController()
    {
        if ($this->controller) {
            return $this->controller;
        }

        $controllerClass = self::config()->controller_class;

        if (!class_exists($controllerClass)) {
            throw new Exception(
                'Could not find controller class ' . $controllerClass . ' as defined in ' . static::class
            );
        }

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

        return $this->controller;
    }
500407
public static function getDatabaseConfigurationHelper($databaseClass)
    {
        $adapters = static::get_adapters();
        if (empty($adapters[$databaseClass]) || empty($adapters[$databaseClass]['helperClass'])) {
            return null;
        }

        // Load if path given
        if (isset($adapters[$databaseClass]['helperPath'])) {
            include_once $adapters[$databaseClass]['helperPath'];
        }

        // Construct
        $class = $adapters[$databaseClass]['helperClass'];
        return (class_exists($class)) ? new $class() : null;
    }
240807
protected function getMethodArguments($controllerClass, $methodName)
    {
        $actionArguments = array();

        $reflectionAction = new \ReflectionMethod($controllerClass, $methodName);
        $actionParametersReflections = $reflectionAction->getParameters();
        foreach ($actionParametersReflections as $actionParameterReflection) {
            $parameterName = $actionParameterReflection->getName();
            if (
                !empty($this->bindings[$controllerClass][$methodName])
                && array_key_exists($parameterName, $this->bindings[$controllerClass][$methodName])
            ) {
                $parameterValue = $this->serviceContainer->getService($this->bindings[$controllerClass][$methodName][$parameterName]);
                $actionArguments[$parameterName] = $parameterValue;
            } elseif (
                !empty($this->argumentBindings[$controllerClass][$methodName])
                && array_key_exists($parameterName, $this->argumentBindings[$controllerClass][$methodName])
            ) {
                $actionArguments[$parameterName] = $this->argumentBindings[$controllerClass][$methodName][$parameterName];
            } elseif ($actionParameterReflection->isOptional()) {
                $actionArguments[$parameterName] = $actionParameterReflection->getDefaultValue();
            } else {
                throw new Exception("No value provided for parameter '{$parameterName}' of '{$controllerClass}::{$methodName}'");
            }
        }
        return $actionArguments;
    }
678938
protected function setSerializer(string $serializerClass): self
    {
        assert(in_array(FormRulesSerializerInterface::class, class_implements($serializerClass)));

        $this->serializerClass = $serializerClass;

        return $this;
    }
541386
public function create(string $class) : BootstrapperInterface
    {
        if (!isset($this->instances[$class])) {
            $this->instances[$class] = new $class($this->container, $this->bootstrappers->getPaths());
        }

        return $this->instances[$class];
    }
475330
public static function createFactory(callable $configureMockProvider = null) {
        $factory = new Factory();

        $provider = new MockProvider($factory);

        if ($configureMockProvider) {
            $configureMockProvider($provider);
        }

        $factory->setProvider('StdClass', $provider);
        return $factory;
    }
261464
public <C extends Controller> AbstractModule controller(Class<C> klass) {
        String name = klass.getName();
        JSClosure constructor = JSClosure.create(new DefaultControllerConstructor<C>(name, klass));
        ControllerDependencyInspector inspector = GWT.create(ControllerDependencyInspector.class);
        JSArray<String> dependencies = JSArray.create(inspector.inspect(klass));
        dependencies.unshift("$scope");
        ngo.controller(name, dependencies, constructor);
        return this;
    }
841474
protected function getControllerInstance($class)
    {
        if (!isset($this->controllerInstances[$class])) {
            $this->controllerInstances[$class] = new $class(array(
                'wei' => $this->wei,
                'app' => $this,
            ));
        }

        return $this->controllerInstances[$class];
    }
1241315
protected function InstanciateController($controllerClass, Route $route) {
        try {
            return new $controllerClass($this, $route->module(), $route->action());
        } catch (\Exception $exc) {
            $this->error->LogError($exc);
            throw new \Exception("Controller not loaded", Enums\ErrorCodes\FrameworkControllerConstants::ControllerNotLoadedValue, $exc);
        }
    }
372608
public function setConfiguration(DriverInterface $driver)
    {
        $this->_configuration = $driver;
        $this->_namespace = null;
        $this->_action = null;
        $this->_controller = null;
        return $this;
    }
218746
private function createDataMapper($entityClass)
    {
        /** @var DataMapperInterface $dataMapper */
        $dataMapperClass = isset($this->config['dataMapper']) ? $this->config['dataMapper'] : DoctrineDataMapper::class;

        $meta = $this->builder->getMeta($entityClass);

        if ($meta->storage['type'] == 'api') {
            $dataMapperClass = $meta->storage['handler'];
        }

        switch ($dataMapperClass) {
            case CsvDataMapper::class:
                $connectionClass = CsvDataGateway::class;

                break;

            default:
                $connectionClass = Connection::class;

                break;
        }

        $dataMapper = new $dataMapperClass(
            $this->getConnection($connectionClass),
            $entityClass,
            $meta->storage['table'],
            $this->entityRegistry
        );

        if ($dataMapper instanceof DispatcherAwareInterface) {
            $dataMapper->setDispatcher($this->getDispatcher());
        }

        return $dataMapper;
    }
1241921
private function getPluginController($class)
    {
        if ($this->pluginControllers === null) {
            /** @noinspection PhpIncludeInspection */
            $this->pluginControllers = file_exists($this->pluginManifestOfControllers) ? include $this->pluginManifestOfControllers : [];
        }

        return isset($this->pluginControllers[$class]) && count($this->pluginControllers[$class]) == 1 ? $this->pluginControllers[$class][0] : null;
    }
399900
protected function getControllerFactory()
    {
        if (!$this->controllerFactory) {
            $config = isset($this->options[self::OPTION_CONTROLLERS]) ? $this->options[self::OPTION_CONTROLLERS] : [];
            $config = $this->configToArray($config, true);

            $controllerFactory = $this->createMvcControllerFactory($config);

            if ($controllerFactory instanceof IModelAware) {
                $controllerFactory->setModelFactory($this->getModelsFactory());
            }

            return $this->controllerFactory = $controllerFactory;
        }

        return $this->controllerFactory;
    }
400732
public function createService(ServiceLocatorInterface $controllerManager)
    {
        /* @var ControllerManager $controllerManager*/
        $serviceManager = $controllerManager->getServiceLocator();

        return $this->__invoke($serviceManager, null);
    }