GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Member   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 48
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getHashedPassword() 0 3 1
A getUsername() 0 3 1
A __construct() 0 4 1
A serialize() 0 5 1
A unserialize() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LM\AuthAbstractor\Implementation;
6
7
use LM\AuthAbstractor\Model\IMember;
8
use Serializable;
9
10
/**
11
 * This is a convenience implementation of IMember. It only serves as data
12
 * object storing two strings: a username and a hashed password.
13
 */
14
class Member implements IMember, Serializable
15
{
16
    /** @var string */
17
    private $hashedPassword;
18
19
    /** @var string */
20
    private $username;
21
22
    /**
23
     * @api
24
     * @param string $hashedPassword The hashed password of the member.
25
     * @param string $username The member's username.
26
     */
27
    public function __construct(string $hashedPassword, string $username)
28
    {
29
        $this->hashedPassword = $hashedPassword;
30
        $this->username = $username;
31
    }
32
33
    /**
34
     * @return string The hashed password of the member.
35
     */
36
    public function getHashedPassword(): string
37
    {
38
        return $this->hashedPassword;
39
    }
40
41
    /**
42
     * @return string The username of the member.
43
     */
44
    public function getUsername(): string
45
    {
46
        return $this->username;
47
    }
48
49
    public function serialize()
50
    {
51
        return serialize([
52
            $this->hashedPassword,
53
            $this->username,
54
        ]);
55
    }
56
57
    public function unserialize($serialized)
58
    {
59
        list(
60
            $this->hashedPassword,
61
            $this->username) = unserialize($serialized);
62
    }
63
}
64