Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class Logger |
||
9 | { |
||
10 | protected $logger; |
||
11 | |||
12 | /** |
||
13 | * Constructor. |
||
14 | * |
||
15 | * @param LoggerInterface $logger |
||
16 | * |
||
17 | * @throws InvalidArgumentException |
||
18 | */ |
||
19 | public function __construct(LoggerInterface $logger = null) |
||
20 | { |
||
21 | $this->logger = $logger; |
||
22 | } |
||
23 | |||
24 | public function error($command, $error) |
||
25 | { |
||
26 | $this->log($command, $error, 'error'); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Logs a command |
||
31 | * |
||
32 | * @param string $command Ccommand |
||
33 | * @param null|string $error Error message or null |
||
34 | * @param string $type Log type |
||
35 | */ |
||
36 | public function log($command, $error = null, $type = 'info') |
||
39 | } |
||
40 | } |
||
41 |