@param string $className

@return DependentStruct
778129
public function newClass($className)
    {
        if ($this->container->has($className)) {
            return $this->container[$className];
        }

        $dependentStruct = new DependentStruct($this->container, $className);
        $this->container[$className] = $dependentStruct;
        return $dependentStruct;
    }
673247
protected function getRequiredModule(string $className) {
		if (\array_key_exists($className, $this->modules)) {
			return $this->modules[$className];
		} else {
			throw new ConfigurationException(__CLASS__ . ' tried to request module ' . $className .
				', but it was not listed as a dependency or has not yet added.');
		}
	}
245915
public static function getInstance($dependencyName)
    {
        if (!isset(self::$_instances[$dependencyName])) {
            self::$_instances[$dependencyName] = new self($dependencyName);
        }
        return self::$_instances[$dependencyName];
    }
60898
public function addExtension($className)
    {
        $object = is_object($className) ? $className : null;
        $className = is_object($className) ? get_class($object) : $className;

        $this->checkExtension($className);

        self::$extensions[$className] = $object;
        return $this;
    }
73370
protected function loadExtension($ClassName)
    {

        try {
            $reflectionClass = new  \ReflectionClass($ClassName);
            if(!$reflectionClass->isInstantiable())
                throw new \OWeb\manage\exceptions\Extension("The Extension is still abstract");

            $extension = new $ClassName();

            if ($extension instanceof \OWeb\types\Extension) {
                $this->registerExtension($extension, $ClassName);

                return $extension;
            } else
                throw new \OWeb\manage\exceptions\Extension("The Extension isn't an instance of : \OWeb\\types\Extension");

        } catch (\Exception $ex) {
            throw new \OWeb\manage\exceptions\Extension("The extension couldn't be loaded.", 0, $ex);
        }
    }
79132
public static function get(string $classname)
    {
        return new class($classname)
        {
            private static $rc;

            public function __construct(string $classname)
            {
                self::$rc = new \ReflectionClass($classname);
            }

            /**
             * Call static method of your class.
             * @param  string $name
             * @param  array  $args
             * @return mixed
             */
            public static function __callStatic(string $name, array $args)
            {
                $rc = self::$rc;
                if (method_exists($rc->name, $name)) {
                    $rm = $rc->getMethod($name);
                    if (!$rm->isStatic()) {
                        throw new ProxyException(
                            "Non-static method called statically: " .
                            "$rc->name::$name()");
                    }
                    $rm->setAccessible(true);
                    return $rm->invokeArgs(null, $args);
                }
                if (method_exists($rc->name, '__callStatic')) {
                    return $rc->name::$name(...$args);
                }
                throw new ProxyException(
                    "Call to undefined method: $rc->name::$name()");
            }

            private static function getStaticReflectionProperty(string $name) : \ReflectionProperty
            {
                $rc = self::$rc;
                if (property_exists($rc->name, $name)) {
                    $rp = $rc->getProperty($name);
                    if (!$rp->isStatic()) {
                        throw new ProxyException(
                            "Access to undeclared static property: " .
                            "$rc->name::\$$name");
                    }
                    $rp->setAccessible(true);
                    return $rp;
                }
                throw new ProxyException(
                    "Access to undeclared static property: " .
                    "$rc->name::\$$name");
            }

            /**
             * Get static property of your class.
             * If you want to call your own "static function getStatic()":
             *   $proxy->__callStatic('getStatic', $args)
             * @param  string $name
             * @return mixed
             */
            public static function getStatic(string $name)
            {
                return self::getStaticReflectionProperty($name)->getValue();
            }

            /**
             * Set static property of your class.
             * If you want to call your own "static function setStatic()":
             *   $proxy->__callStatic('setStatic', $args)
             * @param string $name
             * @param mixed  $value
             */
            public static function setStatic(string $name, $value)
            {
                self::getStaticReflectionProperty($name)->setValue($name, $value);
            }

            /**
             * Create anonymous proxy object of your class.
             * If you want to call your own "static function new()":
             *   $proxy->__callStatic('new', $args)
             * @param  mixed ...$args
             * @return class@anonymous
             */
            public static function new(...$args)
            {
                return self::newInstance($args);
            }

            /**
             * Create anonymous proxy object of your class without constructor.
             * If you want to call your own "static function newWithoutConstructor()":
             *   $proxy->__callStatic('newWithoutConstructor', $args)
             * @return class@anonymous
             */
            public static function newWithoutConstructor()
            {
                return self::newInstance();
            }

            private static function newInstance(array $args = null)
            {
                return new class(self::$rc, $args)
                {
                    private $ro;
                    private $ins;

                    public function __construct(\ReflectionClass $rc, array $args = null)
                    {
                        $this->ins = $rc->newInstanceWithoutConstructor();
                        if ($args !== null && $con = $rc->getConstructor()) {
                            $con->setAccessible(true);
                            $con->invokeArgs($this->ins, $args);
                        }
                        $this->ro = new \ReflectionObject($this->ins);
                    }

                    /**
                     * Call instance method of your class.
                     * @param  string $name
                     * @param  array  $args
                     * @return mixed
                     */
                    public function __call(string $name, array $args)
                    {
                        if (method_exists($this->ro->name, $name)) {
                            $rm = $this->ro->getMethod($name);
                            $rm->setAccessible(true);
                            return $rm->invokeArgs($this->ins, $args);
                        }
                        if (method_exists($this->ro->name, '__call')) {
                            return $this->ins->$name(...$args);
                        }
                        throw new ProxyException(
                            "Call to undefined method: " .
                            "{$this->ro->name}::$name()");
                    }

                    private function getReflectionProperty(string $name)
                    {
                        if (property_exists($this->ins, $name)) {
                            $rp = $this->ro->getProperty($name);
                            $rp->setAccessible(true);
                            return $rp;
                        }
                        throw new ProxyException(
                            "Undefined property: {$this->ro->name}::\$$name");
                    }

                    /**
                     * Get property of your object.
                     * @param  string $name
                     * @return mixed
                     */
                    public function __get(string $name)
                    {
                        try {
                            return $this->getReflectionProperty($name)
                                        ->getValue($this->ins);
                        } catch (ProxyException $e) {
                            try {
                                return $this->__call('__get', [$name]);
                            } catch (ProxyException $_) {
                                throw $e;
                            }
                        }
                    }

                    /**
                     * Set property of your object.
                     * @param  string $name
                     * @param  mixed  $value
                     */
                    public function __set(string $name, $value)
                    {
                        try {
                            $property = $this->getReflectionProperty($name);
                            $property->setValue($this->ins, $value);
                        } catch (ProxyException $e) {
                            try {
                                $this->__call('__set', [$name, $value]);
                                return;
                            } catch (ProxyException $_) { } // If __set() is undefined,
                                                            // fallback to the actual property.
                            if (isset($property)) {
                                throw $e; // Static property exists,
                                          // so you cannot create a new field.
                            } else {
                                $this->ins->$name = $value; // Property does not exists
                                                            // so you can create a new field.
                            }
                        }
                    }
                };
            }
        };
    }
658874
public function getConstructor($sClassName)
    {
        $constructorClassName = $this->formConstructorClass($sClassName);
        if (!class_exists($constructorClassName)) {
            $constructorClassName = $this->formConstructorClass('Object');
        }

        return new $constructorClassName($sClassName);
    }
246958
public function create($className)
    {
        $builder = new Builder($className, $this);
        $this->getGuesser()->fill($builder);
        return $builder;
    }
576231
public function create(string $className, string $typeName): Type
    {
        $type = clone $this->types->getInput($className);
        $fieldsGetter = $type->config['fields'];

        $optionalFieldsGetter = function () use ($fieldsGetter): array {
            $optionalFields = [];
            foreach ($fieldsGetter() as $field) {
                if ($field['type'] instanceof NonNull) {
                    $field['type'] = $field['type']->getWrappedType();
                }

                unset($field['defaultValue']);

                $optionalFields[] = $field;
            }

            return $optionalFields;
        };
        $type->config['fields'] = $optionalFieldsGetter;
        $type->name = $typeName;

        return $type;
    }
614219
private function buildAndCacheFromFactory(string $className)
    {
        $factory  = self::$cachedInstantiators[$className] = $this->buildFactory($className);
        $instance = $factory();

        if ($this->isSafeToClone(new ReflectionClass($instance))) {
            self::$cachedCloneables[$className] = clone $instance;
        }

        return $instance;
    }
1315609
private function loadFixtureClass($className)
    {
        $fixture = new $className();

        if ($this->loader->hasFixture($fixture)) {
            unset($fixture);

            return;
        }

        $this->loader->addFixture(new $className());

        if ($fixture instanceof DependentFixtureInterface) {
            foreach ($fixture->getDependencies() as $dependency) {
                $this->loadFixtureClass($dependency);
            }
        }
    }
400300
private function getProxyDefinition($className)
    {
        $classMetadata = $this->metadataFactory->getMetadataFor($className);
        $className     = $classMetadata->getName(); // aliases and case sensitivity

        $this->definitions[$className] = $this->createProxyDefinition($className);
        $proxyClassName                = $this->definitions[$className]->proxyClassName;

        if ( ! class_exists($proxyClassName, false)) {
            $fileName = $this->proxyGenerator->getProxyFileName($className);

            switch ($this->autoGenerate) {
                case self::AUTOGENERATE_NEVER:
                    require $fileName;
                    break;

                case self::AUTOGENERATE_FILE_NOT_EXISTS:
                    if ( ! file_exists($fileName)) {
                        $this->proxyGenerator->generateProxyClass($classMetadata, $fileName);
                    }
                    require $fileName;
                    break;

                case self::AUTOGENERATE_ALWAYS:
                    $this->proxyGenerator->generateProxyClass($classMetadata, $fileName);
                    require $fileName;
                    break;

                case self::AUTOGENERATE_EVAL:
                    $this->proxyGenerator->generateProxyClass($classMetadata, false);
                    break;
            }
        }

        return $this->definitions[$className];
    }
8678
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\Web\\General\\Manager\\AssetManager':
                if ($this->assetManager === null) {
                    $this->assetManager = new $className(
                        $this->getDataObjectBackend('assets.data'),
                        $this->framework->getRootDirectory()
                    );
                    $this->assetManager->initializeAssetManager();
                }
                
                return $this->assetManager;
            break;
            
            case '\\Zepi\\Web\\General\\Manager\\AssetCacheManager':
                if ($this->assetCacheManager === null) {
                    // Get the cache backends
                    $path = $this->framework->getRootDirectory() . '/cache/';
                    $fileObjectBackend = new \Zepi\Turbo\Backend\FileObjectBackend($path . 'cachedFiles.data');
                    $fileBackend = new \Zepi\Turbo\Backend\FileBackend($path);
            
                    // CSS helper
                    $cssHelper = new \Zepi\Web\General\Helper\CssHelper($fileBackend);
            
                    // Load the configuration
                    $configurationManager = $this->framework->getInstance('\\Zepi\\Core\\Utils\\Manager\\ConfigurationManager');
                    $minifyAssets = $configurationManager->getSetting('assets.minifyAssets');
                    $combineAssetGroups = $configurationManager->getSetting('assets.combineAssetGroups');
            
                    $this->assetCacheManager = new $className(
                        $this->framework,
                        $this->getInstance('\\Zepi\\Web\\General\\Manager\\AssetManager'),
                        $fileObjectBackend,
                        $fileBackend,
                        $cssHelper,
                        $minifyAssets,
                        $combineAssetGroups
                    );
                    $this->assetCacheManager->initializeAssetCacheManager();
                }
            
                return $this->assetCacheManager;
            break;
            
            case '\\Zepi\\Web\\General\\Manager\\TemplatesManager':
                if ($this->templatesManager === null) {
                    $this->templatesManager = new $className(
                        $this->framework, 
                        $this->getDataObjectBackend('templates.data')
                    );
                    $this->templatesManager->initializeTemplatesManager();
                    
                    // Execute the register renderer event
                    $runtimeManager = $this->framework->getRuntimeManager();
                    $runtimeManager->executeEvent('\\Zepi\\Web\\General\\Event\\RegisterRenderers');
                }
                
                return $this->templatesManager;
            break;
            
            case '\\Zepi\\Web\\General\\Manager\\MenuManager':
            case '\\Zepi\\Web\\General\\Manager\\MetaInformationManager':
                return $this->framework->initiateObject($className, array(), true);
            break;
            
            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }
1371822
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\Api\\AccessControl\\Manager\\TokenManager':
                if ($this->tokenManager === null) {
                    $this->tokenManager = $this->framework->initiateObject($className);
                }
                
                return $this->tokenManager;
            break;
            
            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }
17262
public function buildBundleBaseDirectoryFromClassname($classname)
    {
        if (false === array_key_exists($classname, $this->reflectionClasses)) {
            $this->reflectionClasses[$classname] = new \ReflectionClass($classname);
        }

        $baseDir = dirname($this->reflectionClasses[$classname]->getFileName());

        if (!is_dir($baseDir)) {
            throw new \RuntimeException("Invalid bundle `$bundle` base directory, expected `$baseDir` to exist.");
        }

        return $baseDir;
    }
75797
public function resolve($classname)
    {
        // Resolve from container if possible
        if ($this->container->has($classname)) {
            return $this->container->get($classname);
        }

        // Add namespace prefix
        $class = '\\' . $classname;

        // Create class
        $object = new $class();

        // If class needs container inject it
        if ($object instanceof ContainerAwareInterface) {
            $object->setContainer($this->container);
        }
        return $object;
    }
71835
public function forClass($className) {
        $parents = $this->getParents($className);
        $finalConfig = array();
        foreach ($parents as $parent) { // child will overwrite parent config for selected options;
            if (isset($this->options[$parent]) && count($this->options[$parent])) {
                foreach ($this->options[$parent] as $name => $option)
                    $finalConfig[$name] = $option;
            }
        }
        return $finalConfig;
    }