Passed
Push — master ( 5925d2...8c8f24 )
by Alexander
18:53 queued 16:43
created

ApplicationParameters   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 21
c 2
b 0
f 0
dl 0
loc 53
ccs 18
cts 24
cp 0.75
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A name() 0 5 1
A email() 0 5 1
A charset() 0 5 1
A getCharset() 0 3 1
A language() 0 5 1
A getLanguage() 0 3 1
A getEmail() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App;
6
7
final class ApplicationParameters
8
{
9
    private string $charset = 'UTF-8';
10
    private string $language = 'en';
11
    private string $name = 'My Project';
12
    private string $email = '[email protected]';
13
14 8
    public function getCharset(): string
15
    {
16 8
        return $this->charset;
17
    }
18
19
    public function getEmail(): string
20
    {
21
        return $this->email;
22
    }
23
24 8
    public function getLanguage(): string
25
    {
26 8
        return $this->language;
27
    }
28
29 8
    public function getName(): string
30
    {
31 8
        return $this->name;
32
    }
33
34 8
    public function charset(string $value): self
35
    {
36 8
        $new = clone $this;
37 8
        $new->charset = $value;
38 8
        return $new;
39
    }
40
41
    public function email(string $value): self
42
    {
43
        $new = clone $this;
44
        $new->email = $value;
45
        return $new;
46
    }
47
48 8
    public function language(string $value): self
49
    {
50 8
        $new = clone $this;
51 8
        $new->language = $value;
52 8
        return $new;
53
    }
54
55 8
    public function name(string $value): self
56
    {
57 8
        $new = clone $this;
58 8
        $new->name = $value;
59 8
        return $new;
60
    }
61
}
62