| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function __invoke(): ?Constant |
||
| 11 | { |
||
| 12 | $node = new Crawler($this->definition); |
||
| 13 | |||
| 14 | $constant = new Constant(); |
||
| 15 | |||
| 16 | $constant->name = preg_replace('/\s+/', '_', $this->getText($node, '[property="rdfs:label"]')); |
||
| 17 | |||
| 18 | if (empty($constant->name)) { |
||
| 19 | return null; |
||
| 20 | } |
||
| 21 | |||
| 22 | $constant->description = $this->getText($node, '[property="rdfs:comment"]'); |
||
| 23 | |||
| 24 | $constant->value = $this->getAttribute($node, 'resource'); |
||
| 25 | |||
| 26 | return $constant; |
||
| 27 | } |
||
| 28 | } |
||
| 29 |