Completed
Push — log-level ( 45be4f...1ddb1b )
by Akihito
03:47
created

ErrorLogLogger   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Resource;
6
7
use function error_log;
8
use function sprintf;
9
10
final class ErrorLogLogger implements LoggerInterface
11
{
12
    public function __invoke(ResourceObject $ro) : void
13
    {
14
        $requestLog = sprintf('request: %s %s', $ro->uri->method, (string) $ro->uri);
15
        $responseLog = sprintf('response %s %s', $ro->code, $ro->view);
16
        error_log($requestLog);
17
        error_log($responseLog);
18
    }
19
}
20