Files
Plenario/src/Captcha/CaptchaInterface.php
T
gnilebeinandClaude Opus 5.5 121097f7a7
CI / Deploy / test (push) Successful in 52s
CI / Deploy / deploy (push) Skipped
Remove dead code and validate new polls only once
- Drop the unused polls.show_results_to_participants column (idempotent migration).
- Remove CaptchaInterface::getType(), the unused AjaxView with its layout,
  the empty cell template folder and a redundant setNew() call.
- PollsTable::newPoll() normalises and validates once; the create form used
  to validate the raw input first, so an e-mail address with surrounding
  spaces was rejected although it would have been trimmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 22:12:35 +01:00

30 lines
815 B
PHP

<?php
declare(strict_types=1);
namespace App\Captcha;
use Cake\Http\ServerRequest;
/**
* A captcha protects the public forms (create poll, recover links).
*
* Lifecycle: the controller calls challenge() when rendering the form and passes
* the returned array to the `captcha` element; on submit it calls verify().
*/
interface CaptchaInterface
{
/**
* Prepares a challenge and returns the data the view element needs.
*
* @param \Cake\Http\ServerRequest $request Current request (session access)
* @return array<string, mixed> Always contains 'type'
*/
public function challenge(ServerRequest $request): array;
/**
* @param \Cake\Http\ServerRequest $request Submitted request
* @return bool
*/
public function verify(ServerRequest $request): bool;
}