Passed
Push — master ( 60b6ca...163cac )
by Kylian
06:19
created

User   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 74
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getStats() 0 3 1
A isUniqueSet() 0 3 1
A __construct() 0 3 1
A getHash() 0 3 1
A getType() 0 3 1
A getName() 0 3 1
A getAvatarURL() 0 3 1
1
<?php
2
3
namespace KriKrixs\object\user;
4
5
class User
6
{
7
    private object $user;
8
9
    /**
10
     * Create a new User object
11
     * @param object $user
12
     */
13
    public function __construct(object $user)
14
    {
15
        $this->user = $user;
16
    }
17
18
    /**
19
     * Get user ID
20
     * @return int
21
     */
22
    public function getId(): int
23
    {
24
        return $this->user->id;
25
    }
26
27
    /**
28
     * Get user name
29
     * @return string
30
     */
31
    public function getName(): string
32
    {
33
        return $this->user->name;
34
    }
35
36
    /**
37
     * Is user unique set
38
     * @return bool
39
     */
40
    public function isUniqueSet(): bool
41
    {
42
        return $this->user->uniqueSet;
43
    }
44
45
    /**
46
     * Get user hash
47
     * @return string
48
     */
49
    public function getHash(): string
50
    {
51
        return $this->user->hash;
52
    }
53
54
    /**
55
     * Get user avatar link
56
     * @return string
57
     */
58
    public function getAvatarURL(): string
59
    {
60
        return $this->user->avatar;
61
    }
62
63
    /**
64
     * Get user stats (UserStats object)
65
     * @return UserStats
66
     */
67
    public function getStats(): UserStats
68
    {
69
        return new UserStats($this->user->stats);
70
    }
71
72
    /**
73
     * Get user type
74
     * @return string
75
     */
76
    public function getType(): string
77
    {
78
        return $this->user->type;
79
    }
80
}