Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
StartCaptchaEndpoint | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
configure | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
handle | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Olz\Captcha\Endpoints; |
4 | |
5 | use Olz\Api\OlzTypedEndpoint; |
6 | use Olz\Captcha\Utils\CaptchaUtils; |
7 | |
8 | /** |
9 | * @phpstan-import-type OlzCaptchaConfig from CaptchaUtils |
10 | * |
11 | * @extends OlzTypedEndpoint< |
12 | * array{}, |
13 | * array{ |
14 | * config: OlzCaptchaConfig, |
15 | * } |
16 | * > |
17 | */ |
18 | class StartCaptchaEndpoint extends OlzTypedEndpoint { |
19 | public function configure(): void { |
20 | parent::configure(); |
21 | $this->phpStanUtils->registerTypeImport(CaptchaUtils::class); |
22 | } |
23 | |
24 | protected function handle(mixed $input): mixed { |
25 | $config = $this->captchaUtils()->generateOlzCaptchaConfig(3); |
26 | return [ |
27 | 'config' => $config, |
28 | ]; |
29 | } |
30 | } |