generated from ergebnis/php-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ValidationError.php
53 lines (44 loc) 路 1.05 KB
/
ValidationError.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
declare(strict_types=1);
/**
* Copyright (c) 2021-2022 Andreas M枚ller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/json-schema-validator
*/
namespace Ergebnis\Json\SchemaValidator;
use Ergebnis\Json\Pointer;
/**
* @psalm-immutable
*/
final class ValidationError
{
private Pointer\JsonPointer $jsonPointer;
private Message $message;
private function __construct(
Pointer\JsonPointer $jsonPointer,
Message $message
) {
$this->jsonPointer = $jsonPointer;
$this->message = $message;
}
public static function create(
Pointer\JsonPointer $jsonPointer,
Message $message
): self {
return new self(
$jsonPointer,
$message,
);
}
public function jsonPointer(): Pointer\JsonPointer
{
return $this->jsonPointer;
}
public function message(): Message
{
return $this->message;
}
}