Create an instance of Config. Override if you need to change how ConfigBags are created.

@return static
421025
protected static function create()
    {
        $config = new static();

        $config->config = (new ConfigFactory())->create($config->getProjectPath(), $config->CONFIG_FILE);

        return $config;
    }
521357
public function create()
    {
        $instance = self::createOptionSet($this);
        $this->setId($instance->getId());
        return $instance;
    }
37118
public function newInstance(array $config)
    {
        $new_config = array_merge($this->default_config, $config);

        return new static($this->config_handler, $this->url, $new_config);
    }
1291944
final public static function getInstance($config = array())
    {
        static $instance;

        if ($instance === NULL)
        {
            if(!$config instanceof KObjectConfig) {
                $config = new KObjectConfig($config);
            }

            $instance = new self($config);
        }

        return $instance;
    }
314563
public static function this()
    {
        if (is_object(static::$node)) {
            return static::$node;
        }
        //else...
        list($config) = array_merge(func_get_args(), [null]);
        return static::$node = new static($config);
    }
701581
private function createConfigurationDriver()
    {
        $reflection = new \ReflectionClass($this->driverClass());

        /** @var ConfigurationInterface $config */
        $config = $reflection->hasMethod('__construct')
            ? $reflection->newInstanceArgs([$this->file])
            : $reflection->newInstance();
        return $config;
    }
55520
private function createInstance()
    {
        if ($this->arguments === null) {
            $this->arguments = [];

            if (null !== ($method = $this->getReflection()->getConstructor())) {
                $this->arguments = $this->getArguments($method);
            }
        }

        return $this->getReflection()->newInstanceArgs($this->arguments);
    }
1151790
public function create()
    {
        // Look for overriden views
        $this->overrideViews();

        // Pass validation through
        Former::withRules($this->getRules());

        // Initialize localization
        with($localize = new Localize)
            ->model($this->model)
            ->title(Str::singular($this->title));

        // Make the sidebar
        $sidebar = new Sidebar;
        if (!$localize->hidden()) {
            $sidebar->addToEnd($localize);
        }

        // Render view
        return $this->populateView($this->show_view, [
            'item' => null,
            'localize' => $localize,
            'sidebar' => $sidebar,
            'parent_id' => $this->parent ? $this->parent->getKey() : null,
        ]);
    }
611877
protected function createConfigDirectory()
    {
        $this->displayMsgInCli(' >> Create config directory for this module ... ');
        
        $alreadyExist = file_exists($this->targetConfigPath);
        
        //If the directory already exist and if it's a reinstall
        if ($alreadyExist && $this->forceReinstall === true) {
            $this->displayMsgInCli('[Force Reinstall: Remove directory] ');
            
            $alreadyExist = false;
            if (!$this->removeRecursiveDirectory($this->targetConfigPath)) {
                $this->displayMsgNLInCli(
                    'Remove the module config directory have fail',
                    'red',
                    'bold'
                );
                
                throw new Exception(
                    'Reinstall fail. Remove module config directory error',
                    $this::ERR_REINSTALL_FAIL_REMOVE_CONFIG_DIR
                );
            }
        }
        
        //If the directory already exist, nothing to do
        if ($alreadyExist) {
            $this->displayMsgNLInCli('Already exist', 'yellow', 'bold');
            return;
        }
        
        //Create the directory
        if (!mkdir($this->targetConfigPath, 0755)) {
            $this->displayMsgNLInCli('Fail', 'red', 'bold');
            
            throw new Exception(
                'Error to create the config directory.',
                $this::ERR_FAIL_CREATE_CONFIG_DIR
            );
        }

        $this->displayMsgNLInCli('Done', 'green', 'bold');
    }
538580
private static function initInstance(): Instance
    {
        $instance = new Instance();
        if ($data = Config::get('registry')) {
            $instance->setFromArray($data);
        }
        return $instance;
    }
342927
protected function initialize()
    {
        $this->configuration = new ValueHolder($this->loadConfiguration());
        $this->defaults = new ValueHolder($this->getDefaults());

        return $this;
    }
990625
static public function create()
    {
        $t = new static();

        $t->registerService(new Service\Youtube());
        $t->registerService(new Service\Dailymotion());
        $t->registerService(new Service\Vimeo());
        $t->registerService(new Service\Spotify());
        $t->registerService(new Service\SoundCloud());

        return $t;
    }
1051090
public static function getInstance(array $config = [])
        {
            if (!is_object(static::$self)) {
                $className = get_called_class();
                static::$self = new $className($config);
            } else {
                // Add new config settings if given
                if (Arrays::is($config) && count($config) > 0) {
                    static::$self->config($config);
                }
            }

            return static::$self;
        }
1317602
public function create()
    {
        $loaders = array();

        if (count($this->xmlMappings) > 1) {
            $loaders[] = new XmlFilesLoader($this->xmlMappings, $this->constraintNamespaces);
        } elseif (1 === count($this->xmlMappings)) {
            $loaders[] = new XmlFileLoader($this->xmlMappings[0], $this->constraintNamespaces);
        }

        if (count($this->yamlMappings) > 1) {
            $loaders[] = new YamlFilesLoader($this->yamlMappings, $this->constraintNamespaces);
        } elseif (1 === count($this->yamlMappings)) {
            $loaders[] = new YamlFileLoader($this->yamlMappings[0], $this->constraintNamespaces);
        }

        foreach ($this->methodMappings as $methodName) {
            $loaders[] = new StaticMethodLoader($methodName);
        }

        if ($this->annotationReader) {
            $loaders[] = new AnnotationLoader($this->annotationReader);
        }

        $loader = null;

        if (count($loaders) > 1) {
            $loader = new LoaderChain($loaders);
        } elseif (1 === count($loaders)) {
            $loader = $loaders[0];
        }

        return new LazyLoadingMetadataFactory($loader, $this->metadataCache);
    }
364440
public function addConfig()
    {
        $params = func_get_args();

        if (!empty($params)) {
            if (is_array($params[0])) {
                forward_static_call_array([Configuration::class, 'setMany'], $params);
            } else {
                forward_static_call_array([Configuration::class, 'set'], $params);
            }
        }

        return $this;
    }
958985
public static function instance()
    {
        if (null === self::$_instance) {
            if (!defined('APP_ROOT')) {
                $path = __DIR__ . '/../../app/config.json';
            } else {
                $path = APP_ROOT . 'config.json';
            }

            if (!file_exists($path)) {
                $config = json_encode(self::$defaults, JSON_PRETTY_PRINT);
                file_put_contents($path, $config);
            }
            self::$_instance = new static($path);
        }
        return self::$_instance;
    }
1314616
public function overload(): self
    {
        $this->loader = new Loader($this->files);
        $this->loader->load();

        return $this;
    }