Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public function compile(): void |
||
38 | { |
||
39 | if (strlen($this->getStringContent()) > 0) { |
||
40 | // Decode JSON content |
||
41 | try { |
||
42 | $decoded = Json::decode($this->getStringContent()); |
||
43 | } catch (JsonException $exception) { |
||
44 | throw new AnnotationParseException('"assertion" annotation content is invalid (invalid JSON content)'); |
||
45 | } |
||
46 | if (! is_string($decoded)) { |
||
47 | throw new AnnotationParseException( |
||
48 | '"assertion" annotation content is invalid (expected value must be a string)' |
||
49 | ); |
||
50 | } |
||
51 | $this->expected = $decoded; |
||
52 | } |
||
63 |