| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function dump(?string $selector = null): void |
||
| 15 | { |
||
| 16 | if (null === $selector) { |
||
| 17 | parent::dump(); |
||
| 18 | |||
| 19 | return; |
||
| 20 | } |
||
| 21 | |||
| 22 | $elements = $this->session()->getPage()->findAll('css', $selector); |
||
| 23 | $elements = \array_map(static fn(NodeElement $node) => $node->getHtml(), $elements); |
||
| 24 | |||
| 25 | if (empty($elements)) { |
||
| 26 | throw new \RuntimeException("Element \"{$selector}\" not found."); |
||
| 27 | } |
||
| 28 | |||
| 29 | foreach ($elements as $element) { |
||
| 30 | VarDumper::dump($element); |
||
| 31 | } |
||
| 43 |