Created a instance of a desired class.

@param $className
@return mixed
@throws SimplesRunTimeError
763639
public function makeInstance($className)
    {
        // class reflection
        $reflection = new ReflectionClass($className);
        // get the class constructor
        $constructor = $reflection->getConstructor();

        // if there is no constructor, just create and
        // return a new instance
        if (!$constructor) {
            return $reflection->newInstance();
        }

        // created and returns the new instance passing the
        // resolved parameters
        return $reflection->newInstanceArgs($this->resolveParameters($constructor->getParameters(), []));
    }
1187599
public static function instance($className = __CLASS__)
    {
        if (!isset(self::$instances[$className])) {
            self::$instances[$className] = new $className;
        }

        return self::$instances[$className];
    }
342802
public function createRestorer($className)
    {
        if (!class_exists($className)) {
            $className = __NAMESPACE__ . '\\' . $className;
        }

        $restorer = class_exists($className) ? new $className : new DatabaseRestorer();

        if (!($restorer instanceof DatabaseRestorerInterface)) {
            throw new Exception("Database restorer class should implement DatabaseRestorerInterface interface!");
        }

        return $restorer;
    }
889375
public function loadClass($className) {
        $classFound = $this->composerClassLoader->loadClass($className);
        if (!$classFound && !$this->caseSensitiveClassLoading) {
            $classFound = $this->composerClassLoader->loadClass(strtolower($className));
        }
        return $classFound;
    }
1078853
public function instance($classname)
    {
        // Find the class instance, and register the class if the instance is not found.
        if(!($instance = jaxon()->getPluginManager()->getRegisteredObject($classname)))
        {
            $instance = jaxon()->registerClass($classname, [], true);
        }
        if(($instance))
        {
            $this->initInstance($instance);
        }
        return $instance;
    }
384108
public function createInstance()
    {
        $classname = $this->getPlatformClassname();

        if (!class_exists($classname)) {
            throw new \Exception(
                sprintf('Unable to locate class %s', $classname)
            );
        }

        return new $classname();
    }
1049367
public function generator($className)
    {
        foreach ($this->generators as $generator) {
            if ($generator->supports($className)) {
                return $generator->createGenerator($className);
            }
        }

        return false;
    }
631334
final public static function create(string $classname, array $options = array())
    {
        $re =  new FrameworkReflection();
        return ($re->__simpleReturned($classname, $options));
    }
520006
public static function createNewObject($className, $args = null)
    {
        $mock = self::getMock(self::$injectedObjects, 'object', $className);
        if ($mock !== null)
        {
            return $mock;
        }

        if ($args === null)
        {
            return new $className();
        }

        // we need to pass arguments which requires reflection
        $reflection = new ReflectionClass($className);
        return $reflection->newInstanceArgs($args);
    }
934098
public function createClassConstantReference(string $className): ClassConstFetch
    {
        $nameNode = new FullyQualified($className);

        return $this->builderFactory->classConstFetch($nameNode, 'class');
    }
968797
public function setClassName(string $className): ClassPaser
    {
        $this->className = $className;
        $this->reflect_object = (new \ReflectionClass($this->className));

        return $this;
    }
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;
    }
99453
public function addClass($classname)
    {
        $classArr = $this->getClassArray();
        $classArr[] = $classname;
        return $this->setClassArray($classArr);
    }
900696
private static function createInstance($classname, array $arguments = array())
    {
        $reflection_obj = new ReflectionClass($classname);
        if ($reflection_obj->getMethod('__construct')->isPublic()) {
            self::$_instances[ $classname ] = call_user_func_array(array($reflection_obj, 'newInstance'), $arguments);
            if (
                method_exists(self::$_instances[ $classname ], 'init') &&
                is_callable(array(self::$_instances[ $classname ], 'init'))
            ) {
                self::$_instances[ $classname ]->init();
            }
        } else {
            self::$_instances[ $classname ] = new $classname;
            if (
                method_exists(self::$_instances[ $classname ], 'init') &&
                is_callable(array(self::$_instances[ $classname ], 'init'))
            ) {
                call_user_func_array(array(self::$_instances[ $classname ], 'init'), $arguments);
            }
        }
    }
444855
protected function createProjectClass($className)
    {
        $arguments = func_get_args();
        array_shift($arguments);

        return $this->_projectLoader->createClass($className, $arguments);
    }
79005
public function loadClass ($className)
    {
        // Run the parser only for the first time
        if (!$this->nsDataPopulated) {
            $this->nsDataPopulated = true;
            $this->parseComposerJsonFiles();
        }

        // Check all namespaces
        foreach ($this->nsData as $ns => $nsData) {

            // Skip non-matching namespaces
            $nsRegex = "@^". str_replace("\\", "[\\\\\\\\]", $ns) ."(.+)$@";
            if (!preg_match($nsRegex, $className, $m)) {
                continue;
            }
            $classNameWithoutNs = $m[1];

            $filePathWithoutNs  = str_replace("\\", "/", $classNameWithoutNs);
            $filePathFull       = $nsData['absPath'] .'/'. $filePathWithoutNs .'.php';

            if (file_exists($filePathFull)) {
                require_once $filePathFull;
                if (!class_exists($className, false) && !interface_exists($className, false) && !trait_exists($className, false)) {
                    throw new \Exception("Class '$className' not found in file '$filePathFull', this is probably a bug.");
                    return false;
                }
                return true;
            }
        }

        // File not encountered
        return false;
    }
625726
public static function create( $className = null )
    {
        if ( is_null( $className ) )
        {
            $ini = eZINI::instance( 'ezcomments.ini' );
            $className = $ini->variable( 'NotificationSettings', 'NotificationManagerClass' );
        }
        return  new $className();
    }