isKey; return $this->errors[] = new Message($message, $code, $this->path, $variables); } public function addWarning(string $message, string $code, array $variables = []): Message { 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); } }