Skip to content

Commit

Permalink
Merge pull request #59 from irfanevrens/master
Browse files Browse the repository at this point in the history
Tiny improvements.
  • Loading branch information
Nyholm committed Jul 1, 2015
2 parents 6f187c9 + 886cf0a commit a119714
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
phpunit.xml
composer.lock
vendor
vendor
12 changes: 10 additions & 2 deletions src/Exceptions/LoginError.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ public function __construct($name, $description)
$this->description = $description;
}

/**
* @return string
*/
public function getName()
{
return $this->name;
}

/**
* @return string
*/
Expand All @@ -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();
}
}
8 changes: 4 additions & 4 deletions src/Http/CurlRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Http/UrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -178,7 +178,7 @@ protected function getHttpProtocol()
}

/**
* @param boolean $trustForwarded
* @param bool $trustForwarded
*
* @return $this
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Http/UrlGeneratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getCurrentUrl();
/**
* Should we trust forwarded headers?
*
* @param boolean $trustForwarded
* @param bool $trustForwarded
*
* @return $this
*/
Expand Down
5 changes: 3 additions & 2 deletions src/LinkedIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a119714

Please sign in to comment.