diff --git a/.gitignore b/.gitignore index 1f82cda..7e2210e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ phpunit.xml composer.lock -vendor +vendor \ No newline at end of file diff --git a/src/Exceptions/LoginError.php b/src/Exceptions/LoginError.php index 0cb1b2e..3f17c50 100644 --- a/src/Exceptions/LoginError.php +++ b/src/Exceptions/LoginError.php @@ -29,6 +29,14 @@ public function __construct($name, $description) $this->description = $description; } + /** + * @return string + */ + public function getName() + { + return $this->name; + } + /** * @return string */ @@ -40,8 +48,8 @@ public function getDescription() /** * @return string */ - public function getName() + public function __toString() { - return $this->name; + 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 4e217d0..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. @@ -659,7 +659,8 @@ protected function filterRequestOption(array &$options) switch ($options['format']) { case 'simple_xml': $options['simple_xml'] = true; - // simple_xml is still xml. This should fall through + $options['headers']['Content-Type'] = 'text/xml'; + break; case 'xml': $options['headers']['Content-Type'] = 'text/xml'; break;