From 2727ba00789cde7c4f4a605f70c2c4f5f7d1f6ea Mon Sep 17 00:00:00 2001 From: Daniel Horrigan Date: Thu, 17 Jan 2013 15:19:01 -0500 Subject: [PATCH] Adding a few Getters to the Resource, moving Exceptions and adding some new ones. --- .../Exception/InvalidGrantTypeException.php | 8 +++++++ .../Exception/MissingAccessTokenException.php | 8 +++++++ src/OAuth2/Exception/OAuth2Exception.php | 8 +++++++ src/OAuth2/MissingAccessTokenException.php | 8 ------- src/OAuth2/Resource.php | 24 +++++++++++++++++-- 5 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 src/OAuth2/Exception/InvalidGrantTypeException.php create mode 100644 src/OAuth2/Exception/MissingAccessTokenException.php create mode 100644 src/OAuth2/Exception/OAuth2Exception.php delete mode 100644 src/OAuth2/MissingAccessTokenException.php diff --git a/src/OAuth2/Exception/InvalidGrantTypeException.php b/src/OAuth2/Exception/InvalidGrantTypeException.php new file mode 100644 index 00000000..08b31e6a --- /dev/null +++ b/src/OAuth2/Exception/InvalidGrantTypeException.php @@ -0,0 +1,8 @@ +request; } + /** + * Gets the Owner ID. + * + * @return int + */ + public function getOwnerId() + { + return $this->ownerId; + } + + /** + * Gets the Owner Type. + * + * @return string + */ + public function getOwnerType() + { + return $this->ownerId; + } + /** * Checks if the Access Token is valid or not. * @@ -113,7 +133,7 @@ class Resource * Reads in the Access Token from the headers. * * @return string - * @throws MissingAccessTokenException + * @throws Exception\MissingAccessTokenException */ protected function determineAccessToken() { @@ -125,7 +145,7 @@ class Resource } if (empty($access_token)) { - throw new MissingAccessTokenException('Access Token is Missing'); + throw new Exception\MissingAccessTokenException('Access Token is Missing'); } return $access_token;