1
0
Fork 0
mirror of synced 2024-06-03 11:24:48 +12:00

Updated coding standards

This commit is contained in:
Eldad Fux 2020-06-25 00:05:16 +03:00
parent dcf4e948e7
commit 65c08825a5
16 changed files with 47 additions and 38 deletions

View file

@ -137,8 +137,11 @@ class Spotify extends OAuth2
protected function getUser(string $accessToken)
{
if (empty($this->user)) {
$this->user = \json_decode($this->request('GET',
$this->resourceEndpoint . "me", ['Authorization: Bearer '.\urlencode($accessToken)]), true);
$this->user = \json_decode($this->request(
'GET',
$this->resourceEndpoint . "me",
['Authorization: Bearer '.\urlencode($accessToken)]
), true);
}
return $this->user;

View file

@ -139,8 +139,11 @@ class Twitch extends OAuth2
protected function getUser(string $accessToken)
{
if (empty($this->user)) {
$this->user = \json_decode($this->request('GET',
$this->resourceEndpoint, ['Authorization: Bearer '.\urlencode($accessToken)]), true)['data']['0'];
$this->user = \json_decode($this->request(
'GET',
$this->resourceEndpoint,
['Authorization: Bearer '.\urlencode($accessToken)]
), true)['data']['0'];
}
return $this->user;

View file

@ -153,8 +153,11 @@ class Yahoo extends OAuth2
protected function getUser(string $accessToken)
{
if (empty($this->user)) {
$this->user = \json_decode($this->request('GET',
$this->resourceEndpoint, ['Authorization: Bearer '.\urlencode($accessToken)]), true);
$this->user = \json_decode($this->request(
'GET',
$this->resourceEndpoint,
['Authorization: Bearer '.\urlencode($accessToken)]
), true);
}
return $this->user;

View file

@ -78,7 +78,7 @@ class Storage
*
* @return string
*/
static public function human($bytes, $decimals = 2)
public static function human($bytes, $decimals = 2)
{
$units = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');
$step = 1024;

View file

@ -13,7 +13,7 @@ class URL
*
* @return array
*/
static public function parse(string $url):array
public static function parse(string $url):array
{
$default = [
'scheme' => '',
@ -39,7 +39,7 @@ class URL
*
* @return string
*/
static public function unparse(array $url, array $ommit = []):string
public static function unparse(array $url, array $ommit = []):string
{
if (isset($url['path']) && \mb_substr($url['path'], 0, 1) !== '/') {
$url['path'] = '/'.$url['path'];
@ -85,7 +85,7 @@ class URL
*
* @return array
*/
static public function parseQuery(string $query):array
public static function parseQuery(string $query):array
{
\parse_str($query, $result);
@ -101,7 +101,7 @@ class URL
*
* @return array
*/
static public function unparseQuery(array $query):string
public static function unparseQuery(array $query):string
{
return \http_build_query($query);
}