Total Complexity | 4 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | final class IntegerAttribute implements AttributeInterface |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * @var int |
||
17 | */ |
||
18 | private $value; |
||
19 | |||
20 | /** |
||
21 | * @param int $value |
||
22 | */ |
||
23 | 3 | public function __construct(int $value) |
|
26 | 3 | } |
|
27 | |||
28 | /** |
||
29 | * @return StringInterface |
||
30 | * @psalm-pure |
||
31 | */ |
||
32 | 1 | public function asString(): StringInterface |
|
33 | { |
||
34 | 1 | throw new Exception\WrongAttributeTypeException($this->value, 'Unicode string'); |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return bool |
||
39 | * @psalm-pure |
||
40 | */ |
||
41 | 1 | public function asBoolean(): bool |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return int |
||
48 | * @psalm-pure |
||
49 | */ |
||
50 | 1 | public function asInteger(): int |
|
53 | } |
||
54 | } |
||
55 |