Configuration::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
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