| Total Complexity | 5 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class Captcha extends Element implements Ruleable, Descriptionable |
||
| 15 | { |
||
| 16 | use Traits\Description; |
||
| 17 | use Traits\Rules; |
||
| 18 | |||
| 19 | |||
| 20 | /** |
||
| 21 | * @param CaptchaInterface $captcha |
||
| 22 | * @param string|null $message |
||
| 23 | * @noinspection PhpMissingParentConstructorInspection |
||
| 24 | */ |
||
| 25 | 6 | public function __construct(private CaptchaInterface $captcha, string $message = null) |
|
| 29 | } |
||
| 30 | |||
| 31 | 1 | public function prepare() |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | 1 | public function validate(): bool |
|
| 42 | { |
||
| 43 | 1 | return $this->captcha->validate($this); |
|
| 44 | } |
||
| 45 | |||
| 46 | |||
| 47 | 1 | public function baseHtml(): string |
|
| 48 | { |
||
| 49 | 1 | return $this->captcha->renderHtml($this); |
|
| 50 | } |
||
| 51 | |||
| 52 | 1 | public function getCaptcha(): CaptchaInterface |
|
| 55 | } |
||
| 56 | } |
||
| 57 |