From 563ae1021736f5786bdbb1dd51e818d14a219663 Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Tue, 1 Feb 2022 17:47:19 +0100 Subject: [PATCH] Protected oauth methods --- src/Appwrite/Auth/OAuth2.php | 2 +- src/Appwrite/Auth/OAuth2/Amazon.php | 2 +- src/Appwrite/Auth/OAuth2/Apple.php | 2 +- src/Appwrite/Auth/OAuth2/Bitbucket.php | 2 +- src/Appwrite/Auth/OAuth2/Bitly.php | 2 +- src/Appwrite/Auth/OAuth2/Box.php | 2 +- src/Appwrite/Auth/OAuth2/Discord.php | 2 +- src/Appwrite/Auth/OAuth2/Dropbox.php | 2 +- src/Appwrite/Auth/OAuth2/Facebook.php | 2 +- src/Appwrite/Auth/OAuth2/Github.php | 2 +- src/Appwrite/Auth/OAuth2/Gitlab.php | 2 +- src/Appwrite/Auth/OAuth2/Google.php | 2 +- src/Appwrite/Auth/OAuth2/Linkedin.php | 2 +- src/Appwrite/Auth/OAuth2/Microsoft.php | 2 +- src/Appwrite/Auth/OAuth2/Mock.php | 2 +- src/Appwrite/Auth/OAuth2/Notion.php | 2 +- src/Appwrite/Auth/OAuth2/Paypal.php | 2 +- src/Appwrite/Auth/OAuth2/Salesforce.php | 2 +- src/Appwrite/Auth/OAuth2/Slack.php | 2 +- src/Appwrite/Auth/OAuth2/Spotify.php | 2 +- src/Appwrite/Auth/OAuth2/Stripe.php | 2 +- src/Appwrite/Auth/OAuth2/Tradeshift.php | 2 +- src/Appwrite/Auth/OAuth2/Twitch.php | 2 +- src/Appwrite/Auth/OAuth2/Vk.php | 2 +- src/Appwrite/Auth/OAuth2/WordPress.php | 2 +- src/Appwrite/Auth/OAuth2/Yahoo.php | 2 +- src/Appwrite/Auth/OAuth2/Yammer.php | 2 +- src/Appwrite/Auth/OAuth2/Yandex.php | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2.php b/src/Appwrite/Auth/OAuth2.php index 0aa87c219b..9b4c3b9384 100644 --- a/src/Appwrite/Auth/OAuth2.php +++ b/src/Appwrite/Auth/OAuth2.php @@ -64,7 +64,7 @@ abstract class OAuth2 * * @return array */ - abstract public function getTokens(string $code):array; + abstract protected function getTokens(string $code):array; /** * @param string $refreshToken diff --git a/src/Appwrite/Auth/OAuth2/Amazon.php b/src/Appwrite/Auth/OAuth2/Amazon.php index 4a970e1aa3..5720470509 100644 --- a/src/Appwrite/Auth/OAuth2/Amazon.php +++ b/src/Appwrite/Auth/OAuth2/Amazon.php @@ -66,7 +66,7 @@ class Amazon extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = ['Content-Type: application/x-www-form-urlencoded;charset=UTF-8']; diff --git a/src/Appwrite/Auth/OAuth2/Apple.php b/src/Appwrite/Auth/OAuth2/Apple.php index 51b3e8f0b5..51b8c307bb 100644 --- a/src/Appwrite/Auth/OAuth2/Apple.php +++ b/src/Appwrite/Auth/OAuth2/Apple.php @@ -61,7 +61,7 @@ class Apple extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = ['Content-Type: application/x-www-form-urlencoded']; diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index dbda90dd2a..6cd31e61f7 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -50,7 +50,7 @@ class Bitbucket extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { // Required as per Bitbucket Spec. diff --git a/src/Appwrite/Auth/OAuth2/Bitly.php b/src/Appwrite/Auth/OAuth2/Bitly.php index 123a8f8a4e..f62379829d 100644 --- a/src/Appwrite/Auth/OAuth2/Bitly.php +++ b/src/Appwrite/Auth/OAuth2/Bitly.php @@ -61,7 +61,7 @@ class Bitly extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Box.php b/src/Appwrite/Auth/OAuth2/Box.php index e0e22bc497..d6b57fa333 100644 --- a/src/Appwrite/Auth/OAuth2/Box.php +++ b/src/Appwrite/Auth/OAuth2/Box.php @@ -66,7 +66,7 @@ class Box extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = ['Content-Type: application/x-www-form-urlencoded']; diff --git a/src/Appwrite/Auth/OAuth2/Discord.php b/src/Appwrite/Auth/OAuth2/Discord.php index bda797616f..c3bfc87909 100644 --- a/src/Appwrite/Auth/OAuth2/Discord.php +++ b/src/Appwrite/Auth/OAuth2/Discord.php @@ -62,7 +62,7 @@ class Discord extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Dropbox.php b/src/Appwrite/Auth/OAuth2/Dropbox.php index facd54b3dd..9fb3bf733a 100644 --- a/src/Appwrite/Auth/OAuth2/Dropbox.php +++ b/src/Appwrite/Auth/OAuth2/Dropbox.php @@ -51,7 +51,7 @@ class Dropbox extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = ['Content-Type: application/x-www-form-urlencoded']; diff --git a/src/Appwrite/Auth/OAuth2/Facebook.php b/src/Appwrite/Auth/OAuth2/Facebook.php index 37a0019c1e..2a416fbb68 100644 --- a/src/Appwrite/Auth/OAuth2/Facebook.php +++ b/src/Appwrite/Auth/OAuth2/Facebook.php @@ -54,7 +54,7 @@ class Facebook extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Github.php b/src/Appwrite/Auth/OAuth2/Github.php index 913e1e90f5..abddc4aafd 100644 --- a/src/Appwrite/Auth/OAuth2/Github.php +++ b/src/Appwrite/Auth/OAuth2/Github.php @@ -49,7 +49,7 @@ class Github extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Gitlab.php b/src/Appwrite/Auth/OAuth2/Gitlab.php index 68d52fd46a..40052daa61 100644 --- a/src/Appwrite/Auth/OAuth2/Gitlab.php +++ b/src/Appwrite/Auth/OAuth2/Gitlab.php @@ -53,7 +53,7 @@ class Gitlab extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Google.php b/src/Appwrite/Auth/OAuth2/Google.php index 66b4fa9c50..f05df4a8a7 100644 --- a/src/Appwrite/Auth/OAuth2/Google.php +++ b/src/Appwrite/Auth/OAuth2/Google.php @@ -62,7 +62,7 @@ class Google extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Linkedin.php b/src/Appwrite/Auth/OAuth2/Linkedin.php index 2c7907fb81..a719b14486 100644 --- a/src/Appwrite/Auth/OAuth2/Linkedin.php +++ b/src/Appwrite/Auth/OAuth2/Linkedin.php @@ -64,7 +64,7 @@ class Linkedin extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Microsoft.php b/src/Appwrite/Auth/OAuth2/Microsoft.php index 2b09888dc8..2763ed3969 100644 --- a/src/Appwrite/Auth/OAuth2/Microsoft.php +++ b/src/Appwrite/Auth/OAuth2/Microsoft.php @@ -56,7 +56,7 @@ class Microsoft extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = ['Content-Type: application/x-www-form-urlencoded']; diff --git a/src/Appwrite/Auth/OAuth2/Mock.php b/src/Appwrite/Auth/OAuth2/Mock.php index b051e51f05..1daaeb2279 100644 --- a/src/Appwrite/Auth/OAuth2/Mock.php +++ b/src/Appwrite/Auth/OAuth2/Mock.php @@ -54,7 +54,7 @@ class Mock extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Notion.php b/src/Appwrite/Auth/OAuth2/Notion.php index 9fd0d47846..f4d00eff3f 100644 --- a/src/Appwrite/Auth/OAuth2/Notion.php +++ b/src/Appwrite/Auth/OAuth2/Notion.php @@ -58,7 +58,7 @@ class Notion extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = ['Authorization: Basic ' . \base64_encode($this->appID . ':' . $this->appSecret)]; diff --git a/src/Appwrite/Auth/OAuth2/Paypal.php b/src/Appwrite/Auth/OAuth2/Paypal.php index 8131536ca9..429118e13b 100644 --- a/src/Appwrite/Auth/OAuth2/Paypal.php +++ b/src/Appwrite/Auth/OAuth2/Paypal.php @@ -81,7 +81,7 @@ class Paypal extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Salesforce.php b/src/Appwrite/Auth/OAuth2/Salesforce.php index 07c883b962..92ed7e2d3c 100644 --- a/src/Appwrite/Auth/OAuth2/Salesforce.php +++ b/src/Appwrite/Auth/OAuth2/Salesforce.php @@ -66,7 +66,7 @@ class Salesforce extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = [ diff --git a/src/Appwrite/Auth/OAuth2/Slack.php b/src/Appwrite/Auth/OAuth2/Slack.php index dfc4e58303..bebf8d1550 100644 --- a/src/Appwrite/Auth/OAuth2/Slack.php +++ b/src/Appwrite/Auth/OAuth2/Slack.php @@ -53,7 +53,7 @@ class Slack extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { // https://api.slack.com/docs/oauth#step_3_-_exchanging_a_verification_code_for_an_access_token diff --git a/src/Appwrite/Auth/OAuth2/Spotify.php b/src/Appwrite/Auth/OAuth2/Spotify.php index db800b3fe0..e2edaee76d 100644 --- a/src/Appwrite/Auth/OAuth2/Spotify.php +++ b/src/Appwrite/Auth/OAuth2/Spotify.php @@ -65,7 +65,7 @@ class Spotify extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = ['Authorization: Basic ' . \base64_encode($this->appID . ':' . $this->appSecret)]; diff --git a/src/Appwrite/Auth/OAuth2/Stripe.php b/src/Appwrite/Auth/OAuth2/Stripe.php index 1b2984a86b..0d524c870e 100644 --- a/src/Appwrite/Auth/OAuth2/Stripe.php +++ b/src/Appwrite/Auth/OAuth2/Stripe.php @@ -64,7 +64,7 @@ class Stripe extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Tradeshift.php b/src/Appwrite/Auth/OAuth2/Tradeshift.php index b8d00cde31..c944b63772 100644 --- a/src/Appwrite/Auth/OAuth2/Tradeshift.php +++ b/src/Appwrite/Auth/OAuth2/Tradeshift.php @@ -76,7 +76,7 @@ class Tradeshift extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Twitch.php b/src/Appwrite/Auth/OAuth2/Twitch.php index d355820a7c..b42d941569 100644 --- a/src/Appwrite/Auth/OAuth2/Twitch.php +++ b/src/Appwrite/Auth/OAuth2/Twitch.php @@ -66,7 +66,7 @@ class Twitch extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Vk.php b/src/Appwrite/Auth/OAuth2/Vk.php index 046a508488..33329628e8 100644 --- a/src/Appwrite/Auth/OAuth2/Vk.php +++ b/src/Appwrite/Auth/OAuth2/Vk.php @@ -64,7 +64,7 @@ class Vk extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = ['Content-Type: application/x-www-form-urlencoded;charset=UTF-8']; diff --git a/src/Appwrite/Auth/OAuth2/WordPress.php b/src/Appwrite/Auth/OAuth2/WordPress.php index ac4b350593..4b92868761 100644 --- a/src/Appwrite/Auth/OAuth2/WordPress.php +++ b/src/Appwrite/Auth/OAuth2/WordPress.php @@ -53,7 +53,7 @@ class WordPress extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $this->tokens = \json_decode($this->request( diff --git a/src/Appwrite/Auth/OAuth2/Yahoo.php b/src/Appwrite/Auth/OAuth2/Yahoo.php index 6fca884be6..12d51d52a7 100644 --- a/src/Appwrite/Auth/OAuth2/Yahoo.php +++ b/src/Appwrite/Auth/OAuth2/Yahoo.php @@ -77,7 +77,7 @@ class Yahoo extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = [ diff --git a/src/Appwrite/Auth/OAuth2/Yammer.php b/src/Appwrite/Auth/OAuth2/Yammer.php index 55f3844740..df3863b58b 100644 --- a/src/Appwrite/Auth/OAuth2/Yammer.php +++ b/src/Appwrite/Auth/OAuth2/Yammer.php @@ -51,7 +51,7 @@ class Yammer extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = ['Content-Type: application/x-www-form-urlencoded']; diff --git a/src/Appwrite/Auth/OAuth2/Yandex.php b/src/Appwrite/Auth/OAuth2/Yandex.php index 5db2bf5b29..e54e52f1e9 100644 --- a/src/Appwrite/Auth/OAuth2/Yandex.php +++ b/src/Appwrite/Auth/OAuth2/Yandex.php @@ -63,7 +63,7 @@ class Yandex extends OAuth2 * * @return array */ - public function getTokens(string $code): array + protected function getTokens(string $code): array { if(empty($this->tokens)) { $headers = [