New contact form with friendlycaptcha
This commit is contained in:
26
vendor/nette/schema/src/Schema/Context.php
vendored
26
vendor/nette/schema/src/Schema/Context.php
vendored
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user