TagAppending   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
cbo 0
dl 0
loc 24
rs 10
c 0
b 0
f 0
ccs 7
cts 7
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __invoke() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dziki\MonologSentryBundle\Processor;
6
7
class TagAppending
8
{
9
    /**
10
     * @var string
11
     */
12
    private $tag;
13
    /**
14
     * @var string
15
     */
16
    private $value;
17
18 3
    public function __construct(string $tag, string $value)
19
    {
20 3
        $this->tag = $tag;
21 3
        $this->value = $value;
22 3
    }
23
24 3
    public function __invoke(array $record)
25
    {
26 3
        $record['extra']['tags'][$this->tag] = $this->value;
27
28 3
        return $record;
29
    }
30
}
31