-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathValidator.php
More file actions
50 lines (40 loc) · 1.14 KB
/
Validator.php
File metadata and controls
50 lines (40 loc) · 1.14 KB
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
<?php
declare(strict_types=1);
namespace PHPModelGenerator\Model;
use PHPModelGenerator\Model\Validator\PropertyValidatorInterface;
/**
* Class Validator
*
* @package PHPModelGenerator\Model
*/
class Validator
{
private ?string $sourceKey = null;
public function __construct(protected PropertyValidatorInterface $validator, protected int $priority)
{}
public function getValidator(): PropertyValidatorInterface
{
return $this->validator;
}
public function getPriority(): int
{
return $this->priority;
}
public function setPriority(int $priority): void
{
$this->priority = $priority;
}
/**
* The schema keyword (e.g. 'pattern', 'minimum') that caused this validator to be added,
* as determined by the Draft modifier registry. Null for validators not produced by a
* Draft AbstractValidatorFactory (e.g. TypeCheckValidator, RequiredPropertyValidator).
*/
public function getSourceKey(): ?string
{
return $this->sourceKey;
}
public function setSourceKey(?string $sourceKey): void
{
$this->sourceKey = $sourceKey;
}
}