| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | final public function dump(?string $selector = null): void |
||
| 27 | { |
||
| 28 | if (null === $selector) { |
||
| 29 | parent::dump(); |
||
| 30 | |||
| 31 | return; |
||
| 32 | } |
||
| 33 | |||
| 34 | $elements = $this->session()->getPage()->findAll('css', $selector); |
||
| 35 | $elements = \array_map(static fn(NodeElement $node) => $node->getHtml(), $elements); |
||
| 36 | |||
| 37 | if (empty($elements)) { |
||
| 38 | throw new \RuntimeException("Element \"{$selector}\" not found."); |
||
| 39 | } |
||
| 40 | |||
| 41 | foreach ($elements as $element) { |
||
| 42 | VarDumper::dump($element); |
||
| 43 | } |
||
| 46 |