InvalidTypeCastException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 20
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
namespace Tdn\PhpTypes\Exception;
4
5
class InvalidTypeCastException extends InvalidTransformationException
6
{
7
    /**
8
     * @param string          $typeFrom
9
     * @param string          $typeTo
10
     * @param string|null     $message
11
     * @param int             $code
12
     * @param \Exception|null $previous
13
     */
14 15
    public function __construct(
15
        string $typeFrom,
16
        string $typeTo,
17
        string $message = null,
18
        int $code = 0,
19
        \Exception $previous = null
20
    ) {
21 15
        $message = $message ?? 'Could not cast %s to %s.';
22 15
        parent::__construct($typeFrom, $typeTo, $message, $code, $previous);
23 15
    }
24
}
25