refactor: susun semula struktur folder — Laravel source ke src/

This commit is contained in:
Saufi
2026-05-19 15:58:35 +08:00
parent f052251b94
commit bf53c71b45
10806 changed files with 1385379 additions and 121 deletions

View File

@@ -0,0 +1,53 @@
<?php declare(strict_types=1);
/**
* This file is part of the Nette Framework (https://nette.org)
* Copyright (c) 2004 David Grudl (https://davidgrudl.com)
*/
namespace Nette\Schema;
use function count;
final class Context
{
public bool $skipDefaults = false;
/** @var list<int|string> */
public array $path = [];
public bool $isKey = false;
/** @var list<Message> */
public array $errors = [];
/** @var list<Message> */
public array $warnings = [];
/** @var list<array{DynamicParameter, string, list<int|string>}> */
public array $dynamics = [];
/** @param array<string, mixed> $variables */
public function addError(string $message, string $code, array $variables = []): Message
{
$variables['isKey'] = $this->isKey;
return $this->errors[] = new Message($message, $code, $this->path, $variables);
}
/** @param array<string, mixed> $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);
}
}