Total Complexity | 4 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class CodeGetter implements GetterInterface |
||
14 | { |
||
15 | public function getName(): string |
||
16 | { |
||
17 | return 'code'; |
||
18 | } |
||
19 | |||
20 | public function getValue($object) |
||
21 | { |
||
22 | $code = $object->getCode(); |
||
23 | // even though exceptions should return ints, some php exceptions like DBOException throw strings. |
||
24 | return (int) $code; |
||
25 | } |
||
26 | |||
27 | public function toType(): ?Type |
||
28 | { |
||
29 | return new Type(Type::BUILTIN_TYPE_INT); |
||
30 | } |
||
31 | |||
32 | public function getPriority(): int |
||
35 | } |
||
36 | } |
||
37 |