Passed
Push — master ( cd18e5...9103a9 )
by Alexander
01:59
created

ApplicationParameters::getCharset()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App;
6
7
use Yiisoft\Yii\Web\Middleware\Csrf;
8
9
final class ApplicationParameters
10
{
11
    private string $charset = 'UTF-8';
12
    private string $language = 'en';
13
    private string $name = 'My Project';
14
    private string $email = '[email protected]';
15
    private string $csrfAttribute = Csrf::REQUEST_NAME;
16
17 8
    public function getCharset(): string
18
    {
19 8
        return $this->charset;
20
    }
21
22
    public function getEmail(): string
23
    {
24
        return $this->email;
25
    }
26
27 8
    public function getLanguage(): string
28
    {
29 8
        return $this->language;
30
    }
31
32 8
    public function getName(): string
33
    {
34 8
        return $this->name;
35
    }
36
37 6
    public function getCsrfAttribute(): string
38
    {
39 6
        return $this->csrfAttribute;
40
    }
41
42 8
    public function charset(string $value): self
43
    {
44 8
        $new = clone $this;
45 8
        $new->charset = $value;
46 8
        return $new;
47
    }
48
49
    public function email(string $value): self
50
    {
51
        $new = clone $this;
52
        $new->email = $value;
53
        return $new;
54
    }
55
56 8
    public function language(string $value): self
57
    {
58 8
        $new = clone $this;
59 8
        $new->language = $value;
60 8
        return $new;
61
    }
62
63 8
    public function name(string $value): self
64
    {
65 8
        $new = clone $this;
66 8
        $new->name = $value;
67 8
        return $new;
68
    }
69
70 8
    public function csrfAttribute(string $value): self
71
    {
72 8
        $new = clone $this;
73 8
        $new->csrfAttribute = $value;
74 8
        return $new;
75
    }
76
}
77