Total Complexity | 3 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | class PermissionValidator extends AbstractValidator |
||
21 | { |
||
22 | /** |
||
23 | * The parameter instance |
||
24 | * @var PermissionParam<TEntity> |
||
25 | */ |
||
26 | protected PermissionParam $param; |
||
27 | |||
28 | /** |
||
29 | * Create new instance |
||
30 | * @param PermissionParam<TEntity> $param |
||
31 | * @param Lang $lang |
||
32 | */ |
||
33 | public function __construct(PermissionParam $param, Lang $lang) |
||
34 | { |
||
35 | parent::__construct($lang); |
||
36 | $this->param = $param; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public function setValidationData(): void |
||
43 | { |
||
44 | $this->addData('code', $this->param->getCode()); |
||
45 | $this->addData('description', $this->param->getDescription()); |
||
46 | $this->addData('depend', $this->param->getDepend()); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function setValidationRules(): void |
||
70 | ]); |
||
71 | } |
||
72 | } |
||
73 |