PsrLogger   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A reactTo() 0 4 1
1
<?php
2
3
namespace Ionut\Sylar\Reactions;
4
5
6
use Ionut\Sylar\Report;
7
use Psr\Log\LoggerInterface;
8
9
class PsrLogger implements ReactionInterface
10
{
11
    use Traits\ReactBasedOnThreshold;
12
13
    /**
14
     * @var LoggerInterface
15
     */
16
    protected $logger;
17
18
    public function __construct(LoggerInterface $logger, $threshold = 0)
19
    {
20
        $this->logger = $logger;
21
        $this->threshold = $threshold;
22
    }
23
24
    public function reactTo(Report $report)
25
    {
26
        $this->logger->emergency($report);
27
    }
28
}