Passed
Pull Request — master (#14)
by Barney
02:28
created

FormatterConstructorTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 22
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
/**
3
 * @codingStandardsIgnoreStart
4
 *
5
 * @author       Barney Hanlon <[email protected]>
6
 * @copyright    Barney Hanlon 2017
7
 * @license      https://opensource.org/licenses/MIT
8
 *
9
 * @codingStandardsIgnoreEnd
10
 */
11
12
namespace Shrikeh\GuzzleMiddleware\TimerLogger\Formatter\Traits;
13
14
use Psr\Log\LogLevel;
15
16
/**
17
 * Trait FormatterConstructorTrait
18
 */
19
trait FormatterConstructorTrait
20
{
21
    /**
22
     * @var string|callable
23
     */
24
    private $msg;
25
26
    /**
27
     * @var string|callable
28
     */
29
    private $level;
30
31
    /**
32
     * StartFormatter constructor.
33
     *
34
     * @param callable        $msg   A callable used to create the message
35
     * @param callable|string $level The level this should be logged at
36
     */
37
    private function __construct(callable $msg, $level = LogLevel::DEBUG)
38
    {
39
        $this->msg = $msg;
40
        $this->level = $level;
41
    }
42
}
43