Passed
Push — master ( 4d2afb...37b1cc )
by Tim
02:49
created

SiteConfiguration   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 22
dl 0
loc 67
rs 10
c 1
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getFallbackDetectionLanguage() 0 3 1
A getForwardRedirectParameters() 0 3 1
A isEnableLanguageDetection() 0 3 1
A isDisableRedirectWithBackendSession() 0 3 1
A __construct() 0 16 1
A getAddIpLocationToBrowserLanguage() 0 3 1
A isAllowAllPaths() 0 3 1
A getRedirectHttpStatusCode() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LD\LanguageDetection\Domain\Model\Dto;
6
7
class SiteConfiguration
8
{
9
    protected bool $enableLanguageDetection;
10
11
    protected bool $disableRedirectWithBackendSession;
12
13
    protected string $addIpLocationToBrowserLanguage;
14
15
    protected bool $allowAllPaths;
16
17
    protected int $redirectHttpStatusCode;
18
19
    protected string $forwardRedirectParameters;
20
21
    protected int $fallbackDetectionLanguage;
22
23
    public function __construct(
24
        $enableLanguageDetection,
25
        $disableRedirectWithBackendSession,
26
        $addIpLocationToBrowserLanguage,
27
        $allowAllPaths,
28
        $redirectHttpStatusCode,
29
        $forwardRedirectParameters,
30
        $fallbackDetectionLanguage
31
    ) {
32
        $this->enableLanguageDetection = (bool)$enableLanguageDetection;
33
        $this->disableRedirectWithBackendSession = (bool)$disableRedirectWithBackendSession;
34
        $this->addIpLocationToBrowserLanguage = (string)$addIpLocationToBrowserLanguage;
35
        $this->allowAllPaths = (bool)$allowAllPaths;
36
        $this->redirectHttpStatusCode = (int)$redirectHttpStatusCode;
37
        $this->forwardRedirectParameters = (string)$forwardRedirectParameters;
38
        $this->fallbackDetectionLanguage = (int)$fallbackDetectionLanguage;
39
    }
40
41
    public function isEnableLanguageDetection(): bool
42
    {
43
        return $this->enableLanguageDetection;
44
    }
45
46
    public function isDisableRedirectWithBackendSession(): bool
47
    {
48
        return $this->disableRedirectWithBackendSession;
49
    }
50
51
    public function getAddIpLocationToBrowserLanguage(): string
52
    {
53
        return $this->addIpLocationToBrowserLanguage;
54
    }
55
56
    public function isAllowAllPaths(): bool
57
    {
58
        return $this->allowAllPaths;
59
    }
60
61
    public function getRedirectHttpStatusCode(): int
62
    {
63
        return $this->redirectHttpStatusCode;
64
    }
65
66
    public function getForwardRedirectParameters(): string
67
    {
68
        return $this->forwardRedirectParameters;
69
    }
70
71
    public function getFallbackDetectionLanguage(): int
72
    {
73
        return $this->fallbackDetectionLanguage;
74
    }
75
}
76