protected static function adapter($adapter, array $vars)
    {
        if (class_exists($adapter)) {
            return (new \ReflectionClass($adapter))->newInstanceArgs($vars);
        }

        $leagueAdapter = '\\League\\Flysystem\\Adapter\\' . $adapter;
        if (class_exists($leagueAdapter)) {
            return (new \ReflectionClass($leagueAdapter))->newInstanceArgs($vars);
        }

        $leagueAdapter = '\\League\\Flysystem\\' . $adapter . '\\' . $adapter . 'Adapter';
        if (class_exists($leagueAdapter)) {
            return (new \ReflectionClass($leagueAdapter))->newInstanceArgs($vars);
        }

        throw new \InvalidArgumentException('Unknown adapter');
    }
protected static function adapter($adapter, array $vars)
    {
        if (class_exists($adapter)) {
            return (new \ReflectionClass($adapter))->newInstanceArgs($vars);
        }

        $leagueAdapter = '\\League\\Flysystem\\Adapter\\' . $adapter;
        if (class_exists($leagueAdapter)) {
            return (new \ReflectionClass($leagueAdapter))->newInstanceArgs($vars);
        }

        $leagueAdapter = '\\League\\Flysystem\\' . $adapter . '\\' . $adapter . 'Adapter';
        if (class_exists($leagueAdapter)) {
            return (new \ReflectionClass($leagueAdapter))->newInstanceArgs($vars);
        }

        throw new \InvalidArgumentException('Unknown adapter');
    }
protected static function adapter ( $ adapter , array $ vars ) { if ( class_exists ( $ adapter ) ) { return ( new \ ReflectionClass ( $ adapter ) ) -> newInstanceArgs ( $ vars ) ; } $ leagueAdapter = '\\League\\Flysystem\\Adapter\\' . $ adapter ; if ( class_exists ( $ leagueAdapter ) ) { return ( new \ ReflectionClass ( $ leagueAdapter ) ) -> newInstanceArgs ( $ vars ) ; } $ leagueAdapter = '\\League\\Flysystem\\' . $ adapter . '\\' . $ adapter . 'Adapter' ; if ( class_exists ( $ leagueAdapter ) ) { return ( new \ ReflectionClass ( $ leagueAdapter ) ) -> newInstanceArgs ( $ vars ) ; } throw new \ InvalidArgumentException ( 'Unknown adapter' ) ; }
Instantiate adapter.

@param string $adapter Adapter to create.
@param array  $vars    Vars to pass to adapter.

@throws \InvalidArgumentException Thrown when the given adapter class doesn't exists.

@return AdapterInterface
Instantiate adapter .