AuthResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 3 1
A getUserId() 0 3 1
A isAuth() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace Nighten\ApiClient\Response\Auth;
4
5
class AuthResponse
6
{
7
    private bool $isAuth;
8
    private ?int $userId;
9
    private ?string $key;
10
11 4
    public function __construct(bool $isAuth, ?int $userId = null, ?string $key = null)
12
    {
13 4
        $this->isAuth = $isAuth;
14 4
        $this->userId = $userId;
15 4
        $this->key = $key;
16 4
    }
17
18
    /**
19
     * @return bool
20
     */
21 4
    public function isAuth(): bool
22
    {
23 4
        return $this->isAuth;
24
    }
25
26
    /**
27
     * @return int|null
28
     */
29 4
    public function getUserId(): ?int
30
    {
31 4
        return $this->userId;
32
    }
33
34
    /**
35
     * @return string|null
36
     */
37 4
    public function getKey(): ?string
38
    {
39 4
        return $this->key;
40
    }
41
}
42