FormatterAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormatter() 0 4 1
A setFormatter() 0 5 1
1
<?php
2
3
/**
4
 * Phoole (PHP7.2+)
5
 *
6
 * @category  Library
7
 * @package   Phoole\Logger
8
 * @copyright Copyright (c) 2019 Hong Zhang
9
 */
10
declare(strict_types=1);
11
12
namespace Phoole\Logger\Formatter;
13
14
/**
15
 * FormatterAwareTrait
16
 *
17
 * @package   Phoole\Logger
18
 * @interface FormatterAwareInterface
19
 */
20
trait FormatterAwareTrait
21
{
22
    /**
23
     * @var FormatterInterface
24
     */
25
    protected $formatter;
26
27
    /**
28
     * {@inheritDoc}
29
     */
30
    public function getFormatter(): FormatterInterface
31
    {
32
        return $this->formatter;
33
    }
34
35
    /**
36
     * {@inheritDoc}
37
     */
38
    public function setFormatter(FormatterInterface $formatter)
39
    {
40
        $this->formatter = $formatter;
41
        return $this;
42
    }
43
}