SiteConfig   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 132
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 33
c 1
b 0
f 0
dl 0
loc 132
ccs 33
cts 33
cp 1
rs 10
wmc 11

11 Methods

Rating   Name   Duplication   Size   Complexity  
A getDomain() 0 3 1
A getBaseUrl() 0 3 1
A getEmailLogo() 0 3 1
A __construct() 0 13 1
A getAddress() 0 3 1
A getServerEmail() 0 3 1
A getContactEmail() 0 3 1
A getEnvironment() 0 3 1
A getCompany() 0 3 1
A getLogo() 0 3 1
A getTitle() 0 3 1
1
<?php
2
3
namespace Bone\Server;
4
5
use Bone\Server\Traits\HasAttributesTrait;
6
7
class SiteConfig
8
{
9
    use HasAttributesTrait;
10
11
    /** @var string $title */
12
    private $title;
13
14
    /** @var string $domain  */
15
    private $domain;
16
17
    /** @var string $baseUrl  */
18
    private $baseUrl;
19
    
20
    /** @var string $contactEmail  */
21
    private $contactEmail;
22
    
23
    /** @var string $serverEmail */
24
    private $serverEmail;
25
26
    /** @var string $company */
27
    private $company;
28
29
    /** @var string $address */
30
    private $address;
31
32
    /** @var string $logo */
33
    private $logo;
34
35
    /** @var string $emailLogo */
36
    private $emailLogo;
37
    
38
    /** @var Environment $environment */
39
    private $environment;
40
41
    /**
42
     * SiteConfig constructor.
43
     * @param array $config
44
     * @param Environment $environment
45
     */
46 2
    public function __construct(array $config, Environment $environment)
47
    {
48 2
        $this->title = $config['site']['title'];
49 2
        $this->domain = $config['site']['domain'];
50 2
        $this->baseUrl = $config['site']['baseUrl'];
51 2
        $this->contactEmail = $config['site']['contactEmail'];
52 2
        $this->serverEmail = $config['site']['serverEmail'];
53 2
        $this->company = $config['site']['company'];
54 2
        $this->address = $config['site']['address'];
55 2
        $this->logo = $config['site']['logo'];
56 2
        $this->emailLogo = $config['site']['emailLogo'];
57 2
        $this->environment = $environment;
58 2
        $this->setAttributes($config);
59 2
    }
60
61
    /**
62
     * @return string
63
     */
64 1
    public function getTitle(): string
65
    {
66 1
        return $this->title;
67
    }
68
69
    /**
70
     * @return string
71
     */
72 1
    public function getDomain(): string
73
    {
74 1
        return $this->domain;
75
    }
76
77
    /**
78
     * @return string
79
     */
80 1
    public function getContactEmail(): string
81
    {
82 1
        return $this->contactEmail;
83
    }
84
85
    /**
86
     * @return string
87
     */
88 1
    public function getServerEmail(): string
89
    {
90 1
        return $this->serverEmail;
91
    }
92
93
    /**
94
     * @return Environment
95
     */
96 1
    public function getEnvironment(): Environment
97
    {
98 1
        return $this->environment;
99
    }
100
101
    /**
102
     * @return string
103
     */
104 1
    public function getBaseUrl(): string
105
    {
106 1
        return $this->baseUrl;
107
    }
108
109
    /**
110
     * @return string
111
     */
112 1
    public function getCompany(): string
113
    {
114 1
        return $this->company;
115
    }
116
117
    /**
118
     * @return string
119
     */
120 1
    public function getAddress(): string
121
    {
122 1
        return $this->address;
123
    }
124
125
    /**
126
     * @return string
127
     */
128 1
    public function getLogo(): string
129
    {
130 1
        return $this->logo;
131
    }
132
133
    /**
134
     * @return string
135
     */
136 1
    public function getEmailLogo(): string
137
    {
138 1
        return $this->emailLogo;
139
    }
140
141
142
}
143