Create the service.

@param array $config

@return bool
198968
public function createService($config)
    {
        $this->fileService->mkdir($config['_path_service_'], 0777, true);

        $service = $this->fileService->get($config['template_source'].'/Service.txt');

        if ($config['options-withBaseService'] ?? false) {
            $baseService = $this->fileService->get($config['template_source'].'/BaseService.txt');
            $service = $this->fileService->get($config['template_source'].'/ExtendedService.txt');
        }

        foreach ($config as $key => $value) {
            $service = str_replace($key, $value, $service);
            if ($config['options-withBaseService'] ?? false) {
                $baseService = str_replace($key, $value, $baseService);
            }
        }

        $service = $this->putIfNotExists($config['_path_service_'].'/'.$config['_camel_case_'].'Service.php', $service);

        if ($config['options-withBaseService'] ?? false) {
            $this->putIfNotExists($config['_path_service_'].'/BaseService.php', $baseService);
        }

        return $service;
    }
768815
public static function configure(array $config)
    {
        if (!is_null(static::$instance)) {
            return static::$instance;
        }

        static::$config = $config;

        static::$session = Session::getInstance();

        return static::$instance = new Auth($config[$config['default']]);
    }
37118
public function newInstance(array $config)
    {
        $new_config = array_merge($this->default_config, $config);

        return new static($this->config_handler, $this->url, $new_config);
    }
1284167
public function addConfig(array $config)
    {
        foreach ($config as $id => $entry) {
            $args = [];

            if (is_array($entry) && ! empty($entry)) {
                $values = array_values($entry);
                $entry = $values[0];

                if (isset($values[1])) {
                    $args = $values[1];
                }
            }

            $this->container[$id] = new Service($entry, $args);
        }

        return $this;
    }
331163
public function createFactory($config)
    {
        $this->fileService->mkdir(dirname($config['_path_factory_']), 0777, true);

        if (!file_exists($config['_path_factory_'])) {
            $this->putIfNotExists($config['_path_factory_'], '<?php');
        }

        $factory = $this->fileService->get($config['template_source'].'/Factory.txt');

        $factory = $this->tableService->getTableSchema($config, $factory);

        foreach ($config as $key => $value) {
            $factory = str_replace($key, $value, $factory);
        }

        return $this->filesystem->append($config['_path_factory_'], $factory);
    }
1199090
public function setupService($service, array $config)
    {
        $app = $this->getApp();

        $app->container->set(
            '@' . $service,
            new ServiceDefinition($this, $service, $config)
        );
    }
627025
public static function createWithConfig(array $config = []) {
        $plates = new self();

        $plates->register(new PlatesExtension());
        $plates->register(new Extension\Data\DataExtension());
        $plates->register(new Extension\Path\PathExtension());
        $plates->register(new Extension\RenderContext\RenderContextExtension());
        $plates->register(new Extension\LayoutSections\LayoutSectionsExtension());
        $plates->register(new Extension\Folders\FoldersExtension());

        $plates->addConfig($config);

        return $plates;
    }
958420
public function make(array $config)
    {
        Arr::requires($config, ['token']);

        $client = new Client();

        return new PagerdutyGateway($client, $config);
    }
803405
public function factory($type, array $config)
    {
        $this->setFactoryCreationOptions($type, $config);

        return $this->get($type, $config, false);
    }
627358
protected function callCustomCreator(array $config)
    {
        $driver = $config['driver'];

        return call_user_func($this->customCreators[$driver], $this->app, $config);
    }
433796
public function make(array $config)
    {
        if (!isset($config['driver'])) {
            throw new InvalidArgumentException('A driver must be specified.');
        }

        return $this->factory($config['driver'])->make($config);
    }
849472
protected function createSingleConnection(array $config)
    {
        $connector = $this->createConnector($config)->connect($config);

        return $this->createConnection($connector, $config);
    }
260762
public static function factory($config = array())
    {
        $defaults = array(
            'session' => '',
        );

        $required = array(
            'base_url',
            'api_user',
            'api_key',
            'session',
        );

        // Instantiate the Acquia Search plugin.
        $config = Collection::fromConfig($config, $defaults, $required);
        return new static($config->get('base_url'), $config);
    }
870154
public static function factory(array $config)
    {
        if ( ! array_key_exists('apiKey', $config)) {
            throw new \Exception('Api factory requires $apiKey parameter.');
        }

        $client = new Client([
            'defaults' => [
                'headers' => [
                    'X-ApiKey' => $config['apiKey'],
                ],
            ],
        ], [], $config);

        $description = self::getDescriptionFromConfig($config);

        $apiVersion = isset($config['apiVersion']) ? $config['apiVersion'] : 1;

        return new self($client, $description, ['defaults' => ['api_version' => $apiVersion]]);
    }
428828
public static function factory($config = array())
    {
        $defaults = array();

        $required = array(
            'base_url',
            'login',
            'password'
        );

        $config = Collection::fromConfig($config, $defaults, $required);

        $client = new self($config['base_url'], $config);

        return $client;
    }
182567
private function createEncoderFactory(array $config)
    {
        if (true === array_key_exists('encoders', $config)) {
            $this->_encoderfactory = new EncoderFactory($config['encoders']);
        }

        return $this;
    }
680510
protected function createSingleConnection(array $config)
    {
        $pdo = $this->createPdoResolver($config);

        return $this->createConnection(
            $config['driver'], $pdo, $config['database'], $config['prefix'], $config
        );
    }