Passed
Push — master ( 62f1fa...d989df )
by Magnar Ovedal
02:51
created

Password::getPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stadly\PasswordPolice;
6
7
use DateTimeInterface;
8
9
final class Password
10
{
11
    /**
12
     * @var string Password.
13
     */
14
    private $password;
15
16
    /**
17
     * @var (string|DateTimeInterface)[] Guessable data.
18
     */
19
    private $guessableData;
20
21
    /**
22
     * @param string $password Password.
23
     * @param (string|DateTimeInterface)[] $guessableData Guessable data.
24
     */
25 2
    public function __construct(string $password, array $guessableData = [])
26
    {
27 2
        $this->password = $password;
28 2
        $this->guessableData = $guessableData;
29 2
    }
30
31
    /**
32
     * @return string Password.
33
     */
34 1
    public function __toString(): string
35
    {
36 1
        return $this->password;
37
    }
38
39
    /**
40
     * @return string Password.
41
     */
42 1
    public function getPassword(): string
43
    {
44 1
        return $this->password;
45
    }
46
47
    /**
48
     * @return (string|DateTimeInterface)[]
49
     */
50 1
    public function getGuessableData(): array
51
    {
52 1
        return $this->guessableData;
53
    }
54
}
55