Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
CouldNotCastPropertyException | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | namespace Apie\StorageMetadata\Exceptions; |
3 | |
4 | use Apie\Core\Exceptions\ApieException; |
5 | use ReflectionProperty; |
6 | use ReflectionType; |
7 | use Throwable; |
8 | |
9 | class CouldNotCastPropertyException extends ApieException |
10 | { |
11 | public function __construct( |
12 | ?ReflectionProperty $storageProperty, |
13 | object $domainObject, |
14 | ?ReflectionType $wantedType, |
15 | Throwable $previous |
16 | ) { |
17 | parent::__construct( |
18 | sprintf( |
19 | 'Could not cast to type %s from storage property "%s" from domain object "%s": %s', |
20 | (string) $wantedType, |
21 | $storageProperty ? $storageProperty->name : '(null)', |
22 | get_debug_type($domainObject), |
23 | $previous->getMessage() |
24 | ), |
25 | 0, |
26 | $previous |
27 | ); |
28 | } |
29 | } |