Passed
Push — master ( 48ebae...be64f6 )
by Alexander
11:25
created

ApplicationParameters::csrfAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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