Logger   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A destroyLogger() 0 3 1
A buildLogger() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VM\RequestLogger\Tests\Traits;
6
7
use Psr\Log\LoggerInterface;
8
9
trait Logger
10
{
11
    private $logger;
12
13
    private function buildLogger(): void
14
    {
15
        $this->logger = $this->getMockBuilder(LoggerInterface::class)
0 ignored issues
show
Bug introduced by
It seems like getMockBuilder() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

15
        $this->logger = $this->/** @scrutinizer ignore-call */ getMockBuilder(LoggerInterface::class)
Loading history...
16
            ->disableOriginalConstructor()
17
            ->setMethods([
18
                'debug',
19
                'log',
20
                'emergency',
21
                'info',
22
                'warning',
23
                'alert',
24
                'critical',
25
                'error',
26
                'notice',
27
            ])
28
            ->getMock()
29
        ;
30
    }
31
32
    private function destroyLogger(): void
33
    {
34
        $this->logger = null;
35
    }
36
}
37