| Conditions | 5 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function parse(DOMDocument $dom, DOMXPath $xpath) |
||
|
|
|||
| 19 | { |
||
| 20 | // This expression does not work. It looks like the reason is the array-notation... |
||
| 21 | //$uriPath = $xpath->query('//div[contains(text()[2], "website")]/following-sibling::h2/a'); |
||
| 22 | $uriPath = $xpath->query('//div[contains(., "website")]'); |
||
| 23 | |||
| 24 | if (! $uriPath || $uriPath->length == 0) { |
||
| 25 | throw new \InvalidArgumentException('The CfP does not seem to have an EventUri'); |
||
| 26 | } |
||
| 27 | |||
| 28 | $uriPath = $xpath->query('//h2/a', $uriPath->item(0)->parentNode); |
||
| 29 | |||
| 30 | if (! $uriPath || $uriPath->length == 0) { |
||
| 31 | throw new \InvalidArgumentException('The Event does not seem to have a location'); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $uriPath->item(0)->attributes->getNamedItem('href')->textContent; |
||
| 35 | } |
||
| 36 | } |
||
| 37 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.