GenericException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace CHStudio\Raven\Validator\Exception;
4
5
use RuntimeException;
6
use Throwable;
7
8
class GenericException extends RuntimeException implements ValidationException
9
{
10 5
    public function __construct(
11
        Throwable $previous
12
    ) {
13 5
        $message = sprintf(
14 5
            'Something went wrong: %s.',
15 5
            $previous->getMessage()
16 5
        );
17
18 5
        parent::__construct($message, 0, $previous);
19
    }
20
}
21