@@ -262,7 +262,7 @@ public function refreshToken($refreshToken)
262262 */
263263 public function fetchAccessTokenWithRefreshToken ($ refreshToken = null )
264264 {
265- if (is_null ( $ refreshToken) ) {
265+ if (null === $ refreshToken ) {
266266 if (!isset ($ this ->token ['refresh_token ' ])) {
267267 throw new LogicException (
268268 'refresh token must be passed in or set as part of setAccessToken '
@@ -352,7 +352,7 @@ public function authorize(ClientInterface $http = null)
352352 $ credentials = null ;
353353 $ token = null ;
354354 $ scopes = null ;
355- if (is_null ( $ http) ) {
355+ if (null === $ http ) {
356356 $ http = $ this ->getHttpClient ();
357357 }
358358
@@ -366,7 +366,7 @@ public function authorize(ClientInterface $http = null)
366366 } elseif ($ token = $ this ->getAccessToken ()) {
367367 $ scopes = $ this ->prepareScopes ();
368368 // add refresh subscriber to request a new token
369- if ($ this -> isAccessTokenExpired () && isset ($ token ['refresh_token ' ])) {
369+ if (isset ($ token ['refresh_token ' ]) && $ this -> isAccessTokenExpired ( )) {
370370 $ credentials = $ this ->createUserRefreshCredentials (
371371 $ scopes ,
372372 $ token ['refresh_token ' ]
@@ -477,10 +477,7 @@ public function isAccessTokenExpired()
477477 }
478478
479479 // If the token is set to expire in the next 30 seconds.
480- $ expired = ($ created
481- + ($ this ->token ['expires_in ' ] - 30 )) < time ();
482-
483- return $ expired ;
480+ return ($ created + ($ this ->token ['expires_in ' ] - 30 )) < time ();
484481 }
485482
486483 public function getAuth ()
@@ -598,7 +595,7 @@ public function setApplicationName($applicationName)
598595 public function setRequestVisibleActions ($ requestVisibleActions )
599596 {
600597 if (is_array ($ requestVisibleActions )) {
601- $ requestVisibleActions = join (" " , $ requestVisibleActions );
598+ $ requestVisibleActions = implode (" " , $ requestVisibleActions );
602599 }
603600 $ this ->config ['request_visible_actions ' ] = $ requestVisibleActions ;
604601 }
@@ -699,7 +696,7 @@ public function verifyIdToken($idToken = null)
699696 $ this ->config ['jwt ' ]
700697 );
701698
702- if (is_null ( $ idToken) ) {
699+ if (null === $ idToken ) {
703700 $ token = $ this ->getAccessToken ();
704701 if (!isset ($ token ['id_token ' ])) {
705702 throw new LogicException (
@@ -764,8 +761,8 @@ public function prepareScopes()
764761 if (empty ($ this ->requestedScopes )) {
765762 return null ;
766763 }
767- $ scopes = implode ( ' ' , $ this -> requestedScopes );
768- return $ scopes ;
764+
765+ return implode ( ' ' , $ this -> requestedScopes ) ;
769766 }
770767
771768 /**
@@ -1031,7 +1028,7 @@ public function setHttpClient(ClientInterface $http)
10311028 */
10321029 public function getHttpClient ()
10331030 {
1034- if (is_null ( $ this ->http ) ) {
1031+ if (null === $ this ->http ) {
10351032 $ this ->http = $ this ->createDefaultHttpClient ();
10361033 }
10371034
0 commit comments