New contact form with friendlycaptcha

This commit is contained in:
Jorit Tijsen
2026-02-24 14:04:04 +01:00
parent 6786ac7ce1
commit 3b4030113b
80 changed files with 2860 additions and 1918 deletions

View File

@@ -9,30 +9,26 @@ declare(strict_types=1);
namespace Nette\Schema;
use Nette;
use function count;
final class Context
{
use Nette\SmartObject;
/** @var bool */
public $skipDefaults = false;
public bool $skipDefaults = false;
/** @var string[] */
public $path = [];
public array $path = [];
/** @var bool */
public $isKey = false;
public bool $isKey = false;
/** @var Message[] */
public $errors = [];
public array $errors = [];
/** @var Message[] */
public $warnings = [];
public array $warnings = [];
/** @var array[] */
public $dynamics = [];
public array $dynamics = [];
public function addError(string $message, string $code, array $variables = []): Message
@@ -46,4 +42,12 @@ final class Context
{
return $this->warnings[] = new Message($message, $code, $this->path, $variables);
}
/** @return \Closure(): bool */
public function createChecker(): \Closure
{
$count = count($this->errors);
return fn(): bool => $count === count($this->errors);
}
}