@param array $config

@return \Swift_Mailer
435615
private function getCurrentMailer(array $config)
    {
        if ($this->mailer !== null) {
            return $this->mailer;
        }

        if ($config['mailer'] == 'smtp') {
            $transport = \Swift_SmtpTransport::newInstance(
                $config['smtpHost'],
                $config['smtpPort'],
                $config['smtpSecurity']
            );
            $transport->setUsername($config['smtpUsername']);
            $transport->setPassword($config['smtpPassword']);
        } elseif ($config['mailer'] == 'mail') {
            $transport = \Swift_MailTransport::newInstance();
        } else {
            $transport = \Swift_SendmailTransport::newInstance();
        }

        return \Swift_Mailer::newInstance($transport);
    }
318965
public static function createApplication(array $config)
    {
        if (!isset($config['type'])) $config['type'] = 'unsupported';
        if (isset($config['class'])) {
            $className = $config['class'];
            return new $className($config);
        } else switch ($config['type']) {
            case 'web':
                return new WebApplication($config);
            default:
                throw new InvalidPropertyException([EntityType::APPLICATION, 'type']);
        }
    }
919402
public static function factory($config = array())
    {
        $configuration = static::buildConfig($config);

        $client = new self($configuration->get('base_url'), $configuration);

        $client->addSubscriber(new KeyAuthPlugin($configuration->get('key')));

        static::loadDefinitions($client);
        static::toggleRateLimitingPlugin($client, $config);

        return $client;
    }
1245811
public function config(array $config)
    {
        parent::config($config);

        if (array_key_exists('http_method', $config)) {
            $this->defaults->setHttpMethod($config['http_method']);
        }

        return $this;
    }
1050401
public static function unserialize(array $config)
    {
        $configuration = new static;

        if (false !== ($clientConfiguration = unserialize($config['watched_files']))) {
            $configuration->set($clientConfiguration);
        }

        return $configuration;
    }
1216180
public static function createTransport($transport, array $config)
    {
        $config = new Structure($config);

        switch ($transport) {
            case 'smtp':
                $instance = \Swift_SmtpTransport::newInstance(
                    $config->get('smtp.host'),
                    $config->get('smtp.port', 2525),
                    $config->get('smtp.security', 'tls')
                )->setUsername($config->get('smtp.username'))
                    ->setPassword($config->get('smtp.password'));

                if ($config->get('smtp.local')) {
                    $instance->setLocalDomain($config->get('local'));
                }

                if (!$config->get('smtp.verify', true)) {
                    $instance->setStreamOptions(['ssl' => ['allow_self_signed' => true, 'verify_peer' => false]]);
                }

                break;

            case 'sendmail':
                $instance = \Swift_SendmailTransport::newInstance($config->get('sendmail'));

                break;

            default:
                $instance = \Swift_MailTransport::newInstance();
        }

        return $instance;
    }
241461
private function buildClient(array $config)
    {
        $client = ClientBuilder::create()
            ->setHosts($config['hosts']);

        if (isset($config['retries'])) {
            $client->setRetries($config['retries']);
        }

        if (isset($config['logging']) and $config['logging']['enabled'] == true) {
            $logger = ClientBuilder::defaultLogger($config['logging']['path'], $config['logging']['level']);
            $client->setLogger($logger);
        }

        return $client->build();
    }
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']]);
    }
1072846
public function configure(array $config = [])
    {
        // Check if config has defined a tempDir
        if (isset($config['tempDir']) && is_dir($config['tempDir'])) {
            $this->tempDir = $config['tempDir'];
        }

        return $this;
    }
464831
public function client(array $config)
    {
        $key = $this->getClientKey($config);

        if (isset($this->clients[$key])) {
            return $this->clients[$key];
        }

        return $this->clients[$key] = $this->createClient($config);
    }
935047
public function replaceCallbacks(array $config)
	{
		foreach ($this->callbacks as $path => $params)
		{
			$config = $this->mapArray($config, explode('.', $path), $params);
		}

		return $config;
	}
734991
protected function parseConfig(array $config)
    {
        $config = $this->setHost($config);
        $config = $this->setPort($config);
        $config = $this->setProtocol($config);
        $config = $this->setServiceId($config);
        $config = $this->setTNS($config);
        $config = $this->setCharset($config);

        return $config;
    }
603802
public function load(array $config = [])
    {
        $this->config = array_replace_recursive($this->config, $config);

        $this->enviroment();
        $this->errors();
        $this->templates();
        $this->orm();
        $this->router();

        return $this;
    }
345306
public function make(array $config): Client
    {
        $config = $this->getConfig($config);

        return $this->getClient($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;
    }
388271
private function generateArray(array $config)
    {
        ++$this->indent;

        foreach ($config as $key => $value) {
            if (is_null($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, 'null'));
                } else {
                    $this->writeLine(sprintf('%s,', 'null'));
                }
            } elseif (is_bool($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, $value ? 'true' : 'false'));
                } else {
                    $this->writeLine(sprintf('%s,', $value ? 'true' : 'false'));
                }
            } elseif (is_string($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => '%s',", $key, $value));
                } else {
                    $this->writeLine(sprintf("'%s',", $value));
                }
            } elseif (is_array($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => [", $key));
                } else {
                    $this->writeLine('[');
                }

                $this->generateArray($value);

                $this->writeLine('],');
            } elseif ($value instanceof ClassName) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, (string) $value));
                } else {
                    $this->writeLine(sprintf('%s,', (string) $value));
                }
            } else {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, $value));
                } else {
                    $this->writeLine($value.',');
                }
            }
        }

        --$this->indent;
    }
1259940
public function make(array $config)
    {
        Arr::requires($config, ['token']);

        $client = new Client();

        return new SlackGateway($client, $config);
    }