Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
17 | public function renderBlock(FieldInterface $field, DOMElement $element): DOMElement |
||
18 | { |
||
19 | if (!$field instanceof Captcha) { |
||
20 | throw new InvalidArgumentException('Must be a Del\Form\Field\Captcha'); |
||
21 | } |
||
22 | |||
23 | $dom = $this->getDom(); |
||
24 | $captcha = $dom->createDocumentFragment(); |
||
25 | $captcha->appendXML($field->getCaptchAdapter()->render()); |
||
26 | |||
27 | $div = $this->getDom()->createElement('div'); |
||
28 | $div->appendChild($captcha); |
||
29 | $div->appendChild($element); |
||
30 | |||
31 | return $div; |
||
32 | } |
||
33 | } |
||
34 |