Configuration   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
dl 0
loc 36
ccs 15
cts 15
cp 1
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A toArray() 0 6 1
A getPassword() 0 3 1
A getUsername() 0 3 1
A getLanguage() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VasilDakov\Speedy;
6
7
/**
8
 * Class Options.
9
 *
10
 * @author Vasil Dakov <[email protected]>
11
 * @copyright 2009-2022 Neutrino.bg
12
 *
13
 * @version 1.0
14
 */
15
class Configuration
16
{
17
    private string $username;
18
19
    private string $password;
20
21
    private string $language;
22
23 1
    public function __construct(string $username, string $password, string $language)
24
    {
25 1
        $this->username = $username;
26 1
        $this->password = $password;
27 1
        $this->language = $language;
28
    }
29
30 1
    public function getUsername(): string
31
    {
32 1
        return $this->username;
33
    }
34
35 1
    public function getPassword(): string
36
    {
37 1
        return $this->password;
38
    }
39
40 1
    public function getLanguage(): string
41
    {
42 1
        return $this->language;
43
    }
44
45 1
    public function toArray(): array
46
    {
47 1
        return [
48 1
            Property::USER_NAME->value => $this->getUsername(),
49 1
            Property::PASSWORD->value  => $this->getPassword(),
50 1
            Property::LANGUAGE->value  => $this->getLanguage(),
51 1
        ];
52
    }
53
}
54