diff --git a/src/Exceptions/LoginError.php b/src/Exceptions/LoginError.php index 5698ccc..3f17c50 100644 --- a/src/Exceptions/LoginError.php +++ b/src/Exceptions/LoginError.php @@ -50,6 +50,6 @@ public function getDescription() */ public function __toString() { - return 'Name: ' . $this->getName() . ', Description: ' . $this->getDescription(); + return 'Name: '.$this->getName().', Description: '.$this->getDescription(); } } diff --git a/src/Http/CurlRequest.php b/src/Http/CurlRequest.php index 7142fb2..05f8645 100644 --- a/src/Http/CurlRequest.php +++ b/src/Http/CurlRequest.php @@ -24,10 +24,10 @@ class CurlRequest implements RequestInterface public static $curlOptions = array( CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_RETURNTRANSFER => true, - CURLOPT_TIMEOUT => 60, - CURLOPT_USERAGENT => RequestInterface::USER_AGENT, - CURLOPT_VERBOSE => true, - CURLOPT_HEADER => true, + CURLOPT_TIMEOUT => 60, + CURLOPT_USERAGENT => RequestInterface::USER_AGENT, + CURLOPT_VERBOSE => true, + CURLOPT_HEADER => true, ); /** diff --git a/src/Http/UrlGenerator.php b/src/Http/UrlGenerator.php index dbb66b2..54e0061 100644 --- a/src/Http/UrlGenerator.php +++ b/src/Http/UrlGenerator.php @@ -22,12 +22,12 @@ class UrlGenerator implements UrlGeneratorInterface * Maps aliases to LinkedIn domains. */ public static $domainMap = array( - 'api' => 'https://api.linkedin.com/', - 'www' => 'https://www.linkedin.com/', + 'api' => 'https://api.linkedin.com/', + 'www' => 'https://www.linkedin.com/', ); /** - * @var boolean + * @var bool * * Indicates if we trust HTTP_X_FORWARDED_* headers. */ @@ -178,7 +178,7 @@ protected function getHttpProtocol() } /** - * @param boolean $trustForwarded + * @param bool $trustForwarded * * @return $this */ diff --git a/src/Http/UrlGeneratorInterface.php b/src/Http/UrlGeneratorInterface.php index e789d86..798fb17 100644 --- a/src/Http/UrlGeneratorInterface.php +++ b/src/Http/UrlGeneratorInterface.php @@ -33,7 +33,7 @@ public function getCurrentUrl(); /** * Should we trust forwarded headers? * - * @param boolean $trustForwarded + * @param bool $trustForwarded * * @return $this */ diff --git a/src/LinkedIn.php b/src/LinkedIn.php index dbdc23c..73ade48 100644 --- a/src/LinkedIn.php +++ b/src/LinkedIn.php @@ -246,7 +246,7 @@ protected function getUserFromAvailableData() $accessToken = $this->getAccessToken(); - /** + /* * This is true if both statements are true: * 1: We got an access token * 2: The access token has changed or if we don't got a user. @@ -277,7 +277,7 @@ protected function getUserFromAccessToken() try { return $this->api('GET', '/v1/people/~:(id,firstName,lastName,headline)'); } catch (LinkedInApiException $e) { - return null; + return; } } @@ -297,7 +297,7 @@ protected function getCode() if (isset($_REQUEST['code'])) { if ($storage->get('code') === $_REQUEST['code']) { //we have already validated this code - return null; + return; } //if stored state does not exists @@ -322,7 +322,7 @@ protected function getCode() return $_REQUEST['code']; } - return null; + return; } /** @@ -399,7 +399,7 @@ protected function fetchNewAccessToken() protected function getAccessTokenFromCode($code, $redirectUri = null) { if (empty($code)) { - return null; + return; } if ($redirectUri === null) { @@ -423,18 +423,18 @@ protected function getAccessTokenFromCode($code, $redirectUri = null) } catch (LinkedInApiException $e) { // most likely that user very recently revoked authorization. // In any event, we don't have an access token, so say so. - return null; + return; } if (empty($response)) { - return null; + return; } $tokenData = array_merge(array('access_token' => null, 'expires_in' => null), $response); $token = new AccessToken($tokenData['access_token'], $tokenData['expires_in']); if (!$token->hasToken()) { - return null; + return; } return $token; @@ -606,7 +606,7 @@ public function hasError() public function getError() { if (!$this->hasError()) { - return null; + return; } return new LoginError($_GET['error'], isset($_GET['error_description']) ? $_GET['error_description'] : null);