OperationNotFoundException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 11
ccs 7
cts 7
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace CHStudio\Raven\Validator\Exception;
4
5
use Psr\Http\Message\RequestInterface;
6
use RuntimeException;
7
use Throwable;
8
9
class OperationNotFoundException extends RuntimeException implements ValidationException
10
{
11 5
    public function __construct(
12
        public readonly RequestInterface $request,
13
        Throwable $previous = null
14
    ) {
15 5
        $message = sprintf(
16 5
            'API operation for request [%s] %s hasn\'t been found.',
17 5
            $request->getMethod(),
18 5
            $request->getUri()
19 5
        );
20
21 5
        parent::__construct($message, 0, $previous);
22
    }
23
}
24