Passed
Push — master ( 52f4fd...745a73 )
by Bastien
01:42
created

DeamonLoggerExtraContext::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 10
cc 2
nc 2
nop 3
crap 2
1
<?php
2
3
namespace Deamon\LoggerExtraBundle\Services;
4
5
class DeamonLoggerExtraContext
6
{
7 6
    public function __construct(
8
        private ?string $applicationName,
9
        private ?string $locale = null,
10
        private ?string $applicationVersion = null)
11
    {
12 6
        if(null !== $applicationVersion){
13 1
            $this->applicationVersion = trim($this->applicationVersion);
14
        }
15
    }
16
17 4
    public function getLocale(): ?string
18
    {
19 4
        return $this->locale;
20
    }
21
22 4
    public function getApplicationName(): ?string
23
    {
24 4
        return $this->applicationName;
25
    }
26
27 2
    public function getApplicationVersion(): ?string
28
    {
29 2
        return $this->applicationVersion;
30
    }
31
}
32