Total Complexity | 4 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | class Credentials implements CredentialInterface |
||
21 | { |
||
22 | use Getter; |
||
23 | |||
24 | private $username; |
||
25 | |||
26 | private $password; |
||
27 | |||
28 | private $host; |
||
29 | |||
30 | private $port; |
||
31 | |||
32 | /** |
||
33 | * @inheritDoc |
||
34 | */ |
||
35 | public function set(array $credentials): CredentialInterface |
||
36 | { |
||
37 | $attributes = array_keys(get_object_vars($this)); |
||
38 | foreach ($attributes as $attribute) { |
||
39 | $this->$attribute = isset($credentials[$attribute]) ? $credentials[$attribute] : null; |
||
40 | } |
||
41 | return $this; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @inheritDoc |
||
46 | */ |
||
47 | public function getAll(): array |
||
50 | } |
||
51 | } |
||
52 |