Token::user()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 9
rs 10
1
<?php
2
3
namespace LeandroFerreiraMa\GoogleCalendar;
4
5
class Token extends GoogleCalendar
6
{
7
    public function __construct(string $token)
8
    {
9
        parent::__construct($token);
10
    }
11
12
    public function read(?array $headers): Token
13
    {
14
        $this->request(
15
            "GET",
16
            "v3/tokeninfo",
17
            null,
18
            $headers
19
        );
20
        return $this;
21
    }
22
23
    public function user(?array $headers): Token
24
    {
25
        $this->request(
26
            "GET",
27
            "v3/userinfo",
28
            null,
29
            $headers
30
        );
31
        return $this;
32
    }
33
}