(non-PHPdoc)
@see \Bricks\ClassLoader\InstantiatorInterface::instantiate()
429053
public function instantiate($class,array $params=array()){
		if(!class_exists($class,true)){
			throw new \RuntimeException('given class '.$class.' not exists');
		}		
		$params = array_values($params);
		switch(count($params)){
			case 0: return new $class(); break;
			case 1: return new $class($params[0]); break;
			case 2: return new $class($params[0],$params[1]); break;
			case 3: return new $class($params[0],$params[1],$params[2]); break;
			case 4: return new $class($params[0],$params[1],$params[2],$params[3]); break;
			case 5: return new $class($params[0],$params[1],$params[2],$params[3],$params[4]); break;
			case 6: return new $class($params[0],$params[1],$params[2],$params[3],$params[4],$params[5]); break;
			case 7: return new $class($params[0],$params[1],$params[2],$params[3],$params[4],$params[5],$params[6]); break;
			case 8: return new $class($params[0],$params[1],$params[2],$params[3],$params[4],$params[5],$params[6],$params[7]); break;
			default:
				$relection = new \ReflectionObject($class);
				return $reflection->newInstanceArgs($params);
		}
	}
519686
static function instantiate( $userID, $title, $parentGroupID = 0, $isOpen = true )
    {
        $depth = 0;
        $pathString = '';
        if ( $parentGroupID > 0 )
        {
            $parentGroup = eZCollaborationGroup::fetch( $parentGroupID, $userID );
            $depth = $parentGroup->attribute( 'depth' ) + 1;
            $pathString = $parentGroup->attribute( 'path_string' );
        }
        $group = eZCollaborationGroup::create( $userID, $title, '', $depth, $parentGroupID, $isOpen );

        $db = eZDB::instance();
        $db->begin();

        $group->store();
        if ( $pathString == '' )
            $pathString = $group->attribute( 'id' );
        else
            $pathString .= '/' . $group->attribute( 'id' );
        $group->setAttribute( 'path_string', $pathString );
        $group->sync();

        $db->commit();
        return $group;
    }
1182985
public function create()
    {
      $data = Ensure::Input(func_get_args());
      $url = URIResource::Make($this->path);
      $id = Locator::Find($this->client->post($url, $data->get()));
      $data->add("id", $id);

      return Constructor::Make($this, $data->get(), TRUE);
    }
195643
protected function instantiate($id)
    {
        $this->instances[$id] = call_user_func($this->callbacks[$id], $this);
    }
1169253
public static function newInstance($class, ...$args)
    {
        if(!isset(static::$classNameMap[$class]))
        {
            $ref = new \ReflectionClass($class);
            $className = static::getNewClassName($ref->getShortName());
            $tpl = static::getTpl($ref, $className);
            eval($tpl);
            static::$classNameMap[$class] = $className;
        }
        return new static::$classNameMap[$class](...$args);
    }
703792
public function instantiate()
    {
        $router = new Wildcard($this->entryPoint);
        $router->setLogger($this->app->getLogger());
        return $router;
    }
111392
public function newInstance(string $class, array $args, BindInterface $bind)
    {
        $compiledClass = $this->compile($class, $bind);
        $instance = (new ReflectionClass($compiledClass))->newInstanceArgs($args);
        $instance->bindings = $bind->getBindings();

        return $instance;
    }
1256869
public function new()
    {
        if (isset($this->constructor)) {
            $constructor = $this->constructor;
            $arguments = func_get_args();
            $callback = array_pop($arguments);

            $input_count = isset($constructor['inputs']) ? count($constructor['inputs']) : 0;
            if (count($arguments) < $input_count) {
                throw new InvalidArgumentException('Please make sure you have put all constructor params and callback.');
            }
            if (is_callable($callback) !== true) {
                throw new \InvalidArgumentException('The last param must be callback function.');
            }
            if (!isset($this->bytecode)) {
                throw new \InvalidArgumentException('Please call bytecode($bytecode) before new().');
            }
            $params = array_splice($arguments, 0, $input_count);
            $data = $this->ethabi->encodeParameters($constructor, $params);
            $transaction = [];

            if (count($arguments) > 0) {
                $transaction = $arguments[0];
            }
            $transaction['data'] = '0x' . $this->bytecode . Utils::stripZero($data);

            $this->eth->sendTransaction($transaction, function ($err, $transaction) use ($callback){
                if ($err !== null) {
                    return call_user_func($callback, $err, null);
                }
                return call_user_func($callback, null, $transaction);
            });
        }
    }
1329908
public function create($class) {
        $reflectionClass = new ReflectionClass($class);
        $reflectionMethod = $reflectionClass->getConstructor();
        if (!$reflectionMethod) {
            return new $class;
        }
        $params = &$this->fetchDepsFromSignature($reflectionMethod);
        return $reflectionClass->newInstanceArgs($params);
    }
167948
private static function createObject($className, array $args = null)
    {
        try {
            if (!$args) {
                return new $className;
            } else {
                $c = new \ReflectionClass($className);
                return $c->newInstanceArgs($args);
            }
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        }
    }
396306
protected function instantiateObject(
        array &$data,
        $class,
        array &$context,
        \ReflectionClass $reflectionClass,
        $allowedAttributes,
        string $format = null
    ): object {
        return $reflectionClass->newInstanceWithoutConstructor();
    }
376678
def instantiate(params)
      instance = Instance.new( *interpolate(params), @parent )
      instance.apply_resource_type
      instance
    end
232834
protected function initializeClassBuilder()
    {
        // build the mock class
        $builder = new ClassBuilder();
        if (class_exists($this->className)) {
            $builder->setExtends($this->className);
        } elseif (interface_exists($this->className)) {
            $builder->addInterface($this->className);
        } else {
            throw new \InvalidArgumentException("Class or interface " . $this->className . " does not exist");
        }

        // every mocked method goes through this invocation, which delegates
        // the retrieval of the correct Spec to this Instance's Ordering constraint.
        $resolveCall = function (Invocation $inv) {
            $spec = $this->ordering->nextSpec($inv->getMethodName());
            return $spec->doInvocation($inv);
        };

        return $this->addMethodsToBuilder($builder, $resolveCall);
    }
1160818
private function instantiatTag($tag)
    {
        if (!is_object($this->tags[$tag])) {
            $this->tags[$tag] = Yii::createObject($this->tags[$tag]);
            Yii::trace('tag parser object generated for:'. $tag, __CLASS__);
        }
    }
734528
public function instantiate(string $class, ...$args)
    {
        $refl = $this->reflection->reflectClass($class);

        $dependencyIds = $this->determineDependencies($refl, count($args));
        $dependencies = $args + $this->getDependencies($dependencyIds);

        return $refl->newInstanceArgs($dependencies);
    }
216719
abstract public function __construct();

    /**
     * Over-write this method to emulate a public constructor as it will be called
     * by the static construction fetching its arguments.
     *
     * @param   $args
     * @return  void
     */
//    abstract public function init( $args );

    /**
     * This is the static constructor/getter of the singleton instance
     *
     * If the instance does not exist yet, it will create it fetching
     * received arguments to the constructor if it is public, or to
     * an `init()` method if it exists and is callable.
     *
     * If this method receives arguments but can not fetch them to
     * the constructor or an `init` method, a E_USER_WARNING is triggered
     * to inform user about the arguments loss.
     *
     * @return self
     */
    public static function getInstance()
    {
        if (is_null(self::$_instance)) {
            $_class     = get_called_class();
            $reflection = new ReflectionClass($_class);
            if ($reflection->isInstantiable()) {
                self::$_instance = $reflection->newInstanceArgs(func_get_args());
            } else {
                self::$_instance = new $_class();
                if (func_num_args()>0) {
                    if ($reflection->hasMethod('init') && $reflection->getMethod('init')->isPublic()) {
                        call_user_func_array(array(self::$_instance, 'init'), func_get_args());
                    } else {
                        trigger_error(
                            sprintf('The singleton type "%s" has no public constructor or "init()" method, the arguments will not be passed to the instance!', $_class),
                            E_USER_WARNING
                        );
                    }
                }
            }
        }
        return self::$_instance;
    }
565415
public static function newInstance($class) {
		$className = str_replace(':', '\\', $class);
		$reflectedClass = new ReflectionClass($className);

		if ($reflectedClass->isInstantiable()) {
			$constructor = $reflectedClass->getConstructor();

			if ($constructor) {
				$parameters = $constructor->getParameters();
				$constructorParameters = array();

				foreach ($parameters as $parameter) {
					if ($parameter->getClass()) {
						$constructorParameters[] = self::newInstance($parameter->getClass()->getName());
					} else {
						$constructorParameters[] = $parameter->getDefaultValue();
					}
				}

				return $reflectedClass->newInstanceArgs($constructorParameters);
			} else {
				return $reflectedClass->newInstance();
			}

		} else {
			throw new Exception($class." is not instantiable Class");
		}
	}