LoggedRequestValidator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 1
b 0
f 0
dl 0
loc 20
ccs 13
cts 13
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A validate() 0 12 1
1
<?php
2
3
namespace CHStudio\Raven\Validator;
4
5
use Psr\Http\Message\RequestInterface;
6
use Psr\Log\LoggerInterface;
7
8
class LoggedRequestValidator implements RequestValidatorInterface
9
{
10 2
    public function __construct(
11
        private readonly LoggerInterface $logger,
12
        private readonly RequestValidatorInterface $decorated
13
    ) {
14 2
    }
15
16 1
    public function validate(RequestInterface $request): void
17
    {
18 1
        $this->logger->debug(sprintf(
19 1
            "Start testing Request: [%s] %s",
20 1
            $request->getMethod(),
21 1
            $request->getUri()
22 1
        ));
23 1
        $this->decorated->validate($request);
24 1
        $this->logger->debug(sprintf(
25 1
            'Finish testing Request: [%s] %s',
26 1
            $request->getMethod(),
27 1
            $request->getUri()
28 1
        ));
29
    }
30
}
31