mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Run PHP-CS-FIXER to make sure
code is consisted with PSR-1 + PSR-2
This commit is contained in:
1 parent
c9d3448571
commit
35680bbae9
37 files changed
+928
-753
No files matched your search
+14
-9
@@ -30,14 +30,14 @@ abstract class OAuth
|
||||
* @param string $appId
|
||||
* @param string $appSecret
|
||||
* @param string $callback
|
||||
* @param array $state
|
||||
* @param array $state
|
||||
*/
|
||||
public function __construct(string $appId, string $appSecret, string $callback, $state = [])
|
||||
{
|
||||
$this->appID = $appId;
|
||||
$this->appSecret = $appSecret;
|
||||
$this->callback = $callback;
|
||||
$this->state = $state;
|
||||
$this->appID = $appId;
|
||||
$this->appSecret = $appSecret;
|
||||
$this->callback = $callback;
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,24 +52,28 @@ abstract class OAuth
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getAccessToken(string $code):string;
|
||||
|
||||
/**
|
||||
* @param $accessToken
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getUserID(string $accessToken):string;
|
||||
|
||||
/**
|
||||
* @param $accessToken
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getUserEmail(string $accessToken):string;
|
||||
|
||||
/**
|
||||
* @param $accessToken
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getUserName(string $accessToken):string;
|
||||
@@ -77,13 +81,14 @@ abstract class OAuth
|
||||
/**
|
||||
* @param string $method
|
||||
* @param string $url
|
||||
* @param array $headers
|
||||
* @param array $headers
|
||||
* @param string $payload
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function request(string $method, string $url = '', array $headers = [], string $payload = ''):string
|
||||
{
|
||||
$ch = curl_init($url);
|
||||
$ch = curl_init($url);
|
||||
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
@@ -91,7 +96,7 @@ abstract class OAuth
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Console_OAuth_Agent');
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
|
||||
if(!empty($payload)) {
|
||||
if (!empty($payload)) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
|
||||
}
|
||||
|
||||
@@ -102,4 +107,4 @@ abstract class OAuth
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user