src/Client.php
public static function setClient($input=null)
    {
        // New or encapsulate
        self::$client = ($input instanceof Google_client) ? $input : new Google_Client();

        // While new and there has the config
        if (is_array($input)) {
            
            foreach ($input as $key => $value) {
                // ex. 'authConfig' => setAuthConfig()
                $method = "set" . ucfirst($key);
                // Config method check
                if (!method_exists(self::$client, $method)) {
                    throw new Exception("setClient() Config Key: `{$key}` is invalid referred to Google_Client->{$method}()", 500);
                }
                // Call set method by Google_Client
                call_user_func([self::$client, $method], $value);
            }
        }

        return new self;
    }
public static function setClient($input=null)
    {
        // New or encapsulate
        self::$client = ($input instanceof Google_client) ? $input : new Google_Client();

        // While new and there has the config
        if (is_array($input)) {
            
            foreach ($input as $key => $value) {
                // ex. 'authConfig' => setAuthConfig()
                $method = "set" . ucfirst($key);
                // Config method check
                if (!method_exists(self::$client, $method)) {
                    throw new Exception("setClient() Config Key: `{$key}` is invalid referred to Google_Client->{$method}()", 500);
                }
                // Call set method by Google_Client
                call_user_func([self::$client, $method], $value);
            }
        }

        return new self;
    }
public static function setClient ( $ input = null ) { // New or encapsulate
 self :: $ client = ( $ input instanceof Google_client ) ? $ input : new Google_Client ( ) ; // While new and there has the config
 if ( is_array ( $ input ) ) { foreach ( $ input as $ key => $ value ) { // ex. 'authConfig' => setAuthConfig()
 $ method = "set" . ucfirst ( $ key ) ; // Config method check
 if ( ! method_exists ( self :: $ client , $ method ) ) { throw new Exception ( "setClient() Config Key: `{$key}` is invalid referred to Google_Client->{$method}()" , 500 ) ; } // Call set method by Google_Client
 call_user_func ( [ self :: $ client , $ method ] , $ value ) ; } } return new self ; }
New a Google_Client with config or set Google_Client by giving

@param array|Google_Client Config array or Google_Client
@return self
New a Google_Client with config or set Google_Client by giving