DeamonLoggerExtraContext   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
eloc 6
c 2
b 0
f 0
dl 0
loc 25
ccs 9
cts 9
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getLocale() 0 3 1
A getApplicationName() 0 3 1
A getApplicationVersion() 0 3 1
A __construct() 0 7 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