PluginProbe
Packeta / 1.6.1
Packeta v1.6.1
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / deps / nette / schema / src / Schema / Context.php

Context.php in Packeta 1.6.1, at deps/nette/schema/src/Schema/Context.php

36 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 declare (strict_types=1);
8 namespace Packetery\Nette\Schema;
9
10 use Packetery\Nette;
11 final class Context
12 {
13 use \Packetery\Nette\SmartObject;
14 /** @var bool */
15 public $skipDefaults = \false;
16 /** @var string[] */
17 public $path = [];
18 /** @var bool */
19 public $isKey = \false;
20 /** @var Message[] */
21 public $errors = [];
22 /** @var Message[] */
23 public $warnings = [];
24 /** @var array[] */
25 public $dynamics = [];
26 public function addError(string $message, string $code, array $variables = []) : Message
27 {
28 $variables['isKey'] = $this->isKey;
29 return $this->errors[] = new Message($message, $code, $this->path, $variables);
30 }
31 public function addWarning(string $message, string $code, array $variables = []) : Message
32 {
33 return $this->warnings[] = new Message($message, $code, $this->path, $variables);
34 }
35 }
36