Create an instance of the Zenvia driver.

@return ZenviaSMS
187616
protected function createZenviaDriver()
     {
         $config = $this->app['config']->get('sms.zenvia', []);

         $provider = new ZenviaSMS(
             new Client(),
             $config['account_key'],
             $config['passcode'],
             $config['callbackOption']
         );

         return $provider;
     }
282546
public function create()
    {
        if (! $this->exists() && $this->canCreate()) {
            $this->adapter->mkdir($this->path, 0755, true);
        }
        return $this;
    }
755865
public function createOktaDriver()
    {
        $config = $this->app['config']['services.okta'];

        $provider = $this->buildProvider(OktaProvider::class, $config);

        $provider->setOktaUrl($config['url']);

        return $provider;
    }
969794
protected function createRedisDriver()
    {
        $serverArray    = $this->config['servers'];
        $persistent     = boolval($this->config['persistent']);
        $prefix         = trim($this->config['prefix']);
        $expireTime     = intval($this->config['lifetime']);

        if ($persistent) {
            foreach ($serverArray as $k => $v) {
                $v['persistent']    = true;
                $serverArray[$k]    = $v;
            }
        }

        $redisServer    = new RedisServer($serverArray);
        $redisStore     = new RedisStore($redisServer, $prefix);
        return new CacheSessionHandler($redisStore, $expireTime);
    }
1078701
public function createFilterDriver()
	{
		$aliases = $this->app['config']->get('basset.aliases.filters', array());

		$node = $this->app['config']->get('basset.node_paths', array());

		$filter = new FilterFactory($aliases, $node, $this->app['env']);

		return $this->factory($filter);
	}
1059606
protected function createFactory()
    {
        if (!class_exists($this->factoryClass)) {
            throw new RuntimeException(sprintf(
                'Failed to create an instance of non-existing factory class "%s".',
                $this->factoryClass
            ));
        }

        $class = $this->factoryClass;

        switch (count($this->args)) {
            case 0:
                $factory = new $class();
                break;

            case 1:
                $factory = new $class($this->args[0]);
                break;

            case 2:
                $factory = new $class($this->args[0], $this->args[1]);
                break;

            case 3:
                $factory = new $class($this->args[0], $this->args[1], $this->args[2]);
                break;

            case 4:
                $factory = new $class($this->args[0], $this->args[1], $this->args[2], $this->args[3]);
                break;

            default:
                $reflection = new ClassReflection($class);
                $factory = $reflection->newInstanceArgs($this->args);
                break;
        }

        if (!$factory instanceof FactoryInterface) {
            throw new LogicException(sprintf(
                'Invalid service factory. Factory is expected to be an instance of %s, %s given.',
                'Zend\ServiceManager\FactoryInterface',
                get_class($factory)
            ));
        }

        return $factory;
    }
253048
private static function createDriver()
    {
        if (self::$factory === null) {
            throw new \Exception("No loop driver factory set; Either pass a driver to Loop::execute or set a factory.");
        }

        $driver = self::$factory->create();

        if (!$driver instanceof Driver) {
            $type = is_object($driver) ? "an instance of " . get_class($driver) : gettype($driver);
            throw new \Exception("Loop driver factory returned {$type}, but must return an instance of Driver.");
        }

        return $driver;
    }
564244
public static function create( $name = null, $driver = 'file' ) 
	{
		if ( is_null( $name ) ) 
		{
			return new static( null, $driver );
		}
		
		if ( !isset( static::$instances[$name] ) ) 
		{
			static::$instances[$name] = new static( $name, $driver );
		}
		
		return static::$instances[$name];
	}
497292
protected static function createImagine()
    {
        foreach ((array) static::$driver as $driver) {
            switch ($driver) {
                case self::DRIVER_GMAGICK:
                    if (class_exists('Gmagick', false)) {
                        return new \Imagine\Gmagick\Imagine();
                    }
                    break;
                case self::DRIVER_IMAGICK:
                    if (class_exists('Imagick', false)) {
                        return new \Imagine\Imagick\Imagine();
                    }
                    break;
                case self::DRIVER_GD2:
                    if (function_exists('gd_info')) {
                        return new \Imagine\Gd\Imagine();
                    }
                    break;
                default:
                    throw new InvalidConfigException("Unknown driver: $driver");
            }
        }
        throw new InvalidConfigException("Your system does not support any of these drivers: " . implode(',', (array) static::$driver));
    }
1241370
public function getDriver()
    {
        if ($this->driver === null) {
            // Get driver configuration
            $config = $this->config('drivers.' . $this->config('driver'), []);

            // Get driver class
            $driver = Arr::pull($config, 'class');

            // Create driver instance
            $this->driver = new $driver($config);
        }

        return $this->driver;
    }
113021
protected function createSessionDriver()
    {
        $determiner = new Determiners\Session(
            $this->app['config']['localize-middleware']['session']
        );

        $determiner->setFallback($this->app['config']['app']['fallback_locale']);

        return $determiner;
    }
839704
public function create()
    {
        $this->assertPathIsSet();
        $this->assertNotExists();
        $this->doCreate();
        $this->setPermissions();

        return $this;
    }
936063
protected function createEztextingDriver()
    {
        $config = $this->app['config']->get('sms.eztexting', []);

        $provider = new EZTextingSMS(new Client());

        $data = [
            'User'     => $config['username'],
            'Password' => $config['password'],
        ];

        $provider->buildBody($data);

        return $provider;
    }
905699
protected function createLabsMobileDriver()
    {
        $config = $this->app['config']->get('sms.labsmobile', []);

        $provider = new LabsMobileSMS(new Client());

        $auth = [
            'username' => $config['username'],
            'password' => $config['password'],
        ];

        $provider->buildBody($auth);

        return $provider;
    }
47204
public function create()
    {
        $instance = self::createVariant($this);
        $this->setId($instance->getId());
        return $instance;
    }
190838
public function build(): ConsulEnvManager
    {
        $kv = (new ServiceFactory([
            'base_uri' => $this->consulServer
        ]))->get('kv');

        $manager = new ConsulEnvManager(
            $kv,
            $this->overwriteEvenIfDefined
        );

        $this->clear();

        return $manager;
    }
1196648
public function getDriver()
    {
        if ($this->driver) {
            return $this->driver;
        }

        // Get driver configuration
        $config = $this->getConfig('drivers.' . $this->getConfig('driver'), []);

        // Get driver class
        $driver = Arr::pull($config, 'class');

        // Create driver instance
        return $this->driver = new $driver($config, $this->locale);
    }