Skip to content

Commit f56e82b

Browse files
committed
cs
1 parent f90bb7c commit f56e82b

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
}],
99
"require": {
1010
"php": "^5.6 || ^7.0",
11+
"ext-json": "*",
1112
"socialiteproviders/manager": "~3.0"
1213
},
1314
"autoload": {

src/MailRuExtendSocialite.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace JhaoDa\SocialiteProviders\MailRu;
34

45
use SocialiteProviders\Manager\SocialiteWasCalled;
@@ -13,7 +14,7 @@ class MailRuExtendSocialite
1314
public function handle(SocialiteWasCalled $socialiteWasCalled)
1415
{
1516
$socialiteWasCalled->extendSocialite(
16-
'mailru', __NAMESPACE__ . '\Provider'
17+
'mailru', Provider::class
1718
);
1819
}
1920
}

src/Provider.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ protected function getUserByToken($token)
4545
'session_key' => $token
4646
];
4747

48-
ksort($params, SORT_STRING);
48+
\ksort($params, \SORT_STRING);
4949

50-
$_params = array_map(function($key, $value) {
50+
$_params = \array_map(static function($key, $value) {
5151
return $key . '=' . $value;
52-
}, array_keys($params), array_values($params));
52+
}, \array_keys($params), \array_values($params));
5353

54-
$params['sig'] = md5(implode('', $_params) . $this->clientSecret);
54+
$params['sig'] = \md5(\implode('', $_params).$this->clientSecret);
5555

5656
$response = $this->getHttpClient()->get(
57-
'http://www.appsmail.ru/platform/api?' . http_build_query($params)
57+
'http://www.appsmail.ru/platform/api?'.\http_build_query($params)
5858
);
5959

60-
return json_decode($response->getBody(), true)[0];
60+
return \json_decode($response->getBody(), true)[0];
6161
}
6262

6363
/**
@@ -79,7 +79,7 @@ protected function mapUserToObject(array $user)
7979
*/
8080
protected function getTokenFields($code)
8181
{
82-
return array_merge(parent::getTokenFields($code), [
82+
return \array_merge(parent::getTokenFields($code), [
8383
'grant_type' => 'authorization_code',
8484
]);
8585
}

0 commit comments

Comments
 (0)