Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/**
4
 * This file is part of the Nette Framework (https://nette.org)
5
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
 */
7
 
8
declare(strict_types=1);
9
 
10
namespace Nette\Schema;
11
 
12
use Nette;
13
 
14
 
15
final class Context
16
{
17
	use Nette\SmartObject;
18
 
19
	/** @var bool */
20
	public $skipDefaults = false;
21
 
22
	/** @var string[] */
23
	public $path = [];
24
 
25
	/** @var bool */
26
	public $isKey = false;
27
 
28
	/** @var Message[] */
29
	public $errors = [];
30
 
31
	/** @var Message[] */
32
	public $warnings = [];
33
 
34
	/** @var array[] */
35
	public $dynamics = [];
36
 
37
 
38
	public function addError(string $message, string $code, array $variables = []): Message
39
	{
40
		$variables['isKey'] = $this->isKey;
41
		return $this->errors[] = new Message($message, $code, $this->path, $variables);
42
	}
43
 
44
 
45
	public function addWarning(string $message, string $code, array $variables = []): Message
46
	{
47
		return $this->warnings[] = new Message($message, $code, $this->path, $variables);
48
	}
49
}