Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from widop/f-response
Introduce OAuth response and exception
- Loading branch information
Showing
9 changed files
with
610 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Wid'op package. | ||
* | ||
* (c) Wid'op <contact@widop.com> | ||
* | ||
* For the full copyright and license information, please read the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Widop\Twitter\OAuth; | ||
|
||
/** | ||
* OAuth exception. | ||
* | ||
* @author GeLo <geloen.eric@gmail.com> | ||
*/ | ||
class OAuthException extends \Exception | ||
{ | ||
/** @var \Widop\Twitter\OAuth\OAuthResponse */ | ||
private $response; | ||
|
||
/** | ||
* Creates an OAuth exception. | ||
* | ||
* @param string $message The message. | ||
* @param \Widop\Twitter\OAuth\OAuthResponse $response The response. | ||
*/ | ||
public function __construct($message, OAuthResponse $response) | ||
{ | ||
parent::__construct($message, null, null); | ||
|
||
$this->response = $response; | ||
} | ||
|
||
/** | ||
* Gets the response. | ||
* | ||
* @return \Widop\Twitter\OAuth\OAuthResponse The response. | ||
*/ | ||
public function getResponse() | ||
{ | ||
return $this->response; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.