Test Failed
Pull Request — master (#38)
by
unknown
01:54
created

DeamonLoggerExtraContext   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getLocale() 0 3 1
A __construct() 0 7 2
A getApplicationName() 0 3 1
A getApplicationVersion() 0 3 1
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
            $this->applicationVersion = trim($this->applicationVersion);
1 ignored issue
show
Bug introduced by
It seems like $this->applicationVersion can also be of type null; however, parameter $string of trim() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

13
            $this->applicationVersion = trim(/** @scrutinizer ignore-type */ $this->applicationVersion);
Loading history...
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