Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | class ObjectAccessException extends ApieException implements LocalizationableException |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $name; |
||
17 | |||
18 | /** |
||
19 | * @param GetterInterface $method |
||
20 | * @param string $fieldName |
||
21 | * @param Throwable $previous |
||
22 | */ |
||
23 | public function __construct( |
||
24 | GetterInterface $method, |
||
25 | string $fieldName, |
||
26 | Throwable $previous |
||
27 | ) { |
||
28 | $this->name = $method->getName(); |
||
29 | $message = 'Could not access property "' . $fieldName . '" from ' . $this->name . ': ' . $previous->getMessage(); |
||
30 | parent::__construct(500, $message, $previous); |
||
31 | } |
||
32 | |||
33 | public function getI18n(): LocalizationInfo |
||
40 | ] |
||
41 | ); |
||
44 |