Live   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 30
ccs 0
cts 8
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultScope() 0 3 1
A getTitle() 0 3 1
A getName() 0 3 1
A initUserAttributes() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\AuthClient\Client;
6
7
use Yiisoft\Yii\AuthClient\OAuth2;
8
9
/**
10
 * Live allows authentication via Microsoft Live OAuth.
11
 *
12
 * In order to use Microsoft Live OAuth you must register your application at <https://account.live.com/developers/applications>
13
 *
14
 * @see https://account.live.com/developers/applications
15
 * @see https://msdn.microsoft.com/en-us/library/live/hh243647.aspx
16
 */
17
final class Live extends OAuth2
18
{
19
    protected string $authUrl = 'https://login.live.com/oauth20_authorize.srf';
20
    protected string $tokenUrl = 'https://login.live.com/oauth20_token.srf';
21
    protected string $endpoint = 'https://apis.live.net/v5.0';
22
23
    /**
24
     * @return string service name.
25
     */
26
    public function getName(): string
27
    {
28
        return 'live';
29
    }
30
31
    /**
32
     * @return string service title.
33
     */
34
    public function getTitle(): string
35
    {
36
        return 'Live';
37
    }
38
39
    protected function getDefaultScope(): string
40
    {
41
        return 'wl.basic wl.emails';
42
    }
43
44
    protected function initUserAttributes(): array
45
    {
46
        return $this->api('me', 'GET');
47
    }
48
}
49