22
33namespace PulkitJalan \Google ;
44
5- use Google_Client ;
65use Illuminate \Support \Arr ;
6+ use Google \Client as GoogleClient ;
77use PulkitJalan \Google \Exceptions \UnknownServiceException ;
88
99class Client
@@ -14,20 +14,20 @@ class Client
1414 protected $ config ;
1515
1616 /**
17- * @var \Google_Client
17+ * @var Google\Client
1818 */
1919 protected $ client ;
2020
2121 /**
22- * @param array $config
23- * @param string $userEmail
22+ * @param array $config
23+ * @param string $userEmail
2424 */
2525 public function __construct (array $ config , $ userEmail = '' )
2626 {
2727 $ this ->config = $ config ;
2828
2929 // create an instance of the google client for OAuth2
30- $ this ->client = new Google_Client (Arr::get ($ config , 'config ' , []));
30+ $ this ->client = new GoogleClient (Arr::get ($ config , 'config ' , []));
3131
3232 // set application name
3333 $ this ->client ->setApplicationName (Arr::get ($ config , 'application_name ' , '' ));
@@ -52,7 +52,7 @@ public function __construct(array $config, $userEmail = '')
5252 /**
5353 * Getter for the google client.
5454 *
55- * @return \Google_Client
55+ * @return Google\Client
5656 */
5757 public function getClient ()
5858 {
@@ -62,11 +62,10 @@ public function getClient()
6262 /**
6363 * Setter for the google client.
6464 *
65- * @param string $client
66- *
65+ * @param string $client
6766 * @return self
6867 */
69- public function setClient (Google_Client $ client )
68+ public function setClient (GoogleClient $ client )
7069 {
7170 $ this ->client = $ client ;
7271
@@ -76,15 +75,14 @@ public function setClient(Google_Client $client)
7675 /**
7776 * Getter for the google service.
7877 *
79- * @param string $service
78+ * @param string $service
79+ * @return \Google_Service
8080 *
8181 * @throws \Exception
82- *
83- * @return \Google_Service
8482 */
8583 public function make ($ service )
8684 {
87- $ service = 'Google_Service_ ' .ucfirst ($ service );
85+ $ service = 'Google \\ Service \\ ' .ucfirst ($ service );
8886
8987 if (class_exists ($ service )) {
9088 $ class = new \ReflectionClass ($ service );
@@ -114,6 +112,7 @@ protected function auth($userEmail = '')
114112
115113 /**
116114 * Determine and use credentials if user has set them.
115+ *
117116 * @param $userEmail
118117 * @return bool used or not
119118 */
@@ -137,12 +136,11 @@ protected function useAssertCredentials($userEmail = '')
137136 /**
138137 * Magic call method.
139138 *
140- * @param string $method
141- * @param array $parameters
139+ * @param string $method
140+ * @param array $parameters
141+ * @return mixed
142142 *
143143 * @throws \BadMethodCallException
144- *
145- * @return mixed
146144 */
147145 public function __call ($ method , $ parameters )
148146 {
0 commit comments