1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ValidationChecker.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
9use ReflectionParameter;
10
12{
13 public function __construct(
14 private readonly ReflectionParameter $parameter,
15 private readonly mixed $desiredValue
16 )
17 {
18 }
19
20 public function check(): void
21 {
22 $validationService = ServiceLocator::getInstance()->get('main.validation.service');
23
24 $result = $validationService->validateParameter($this->parameter, $this->desiredValue);
25
26 $error = $result->getError();
27 if ($error !== null)
28 {
30 "Invalid value to match parameter: [{$error->getCode()}] {$error->getMessage()}.",
31 $this->parameter->getName()
32 );
33 }
34 }
35}
__construct(private readonly ReflectionParameter $parameter, private readonly mixed $desiredValue)
Определения ValidationChecker.php:13
$result
Определения get_property_values.php:14
$error
Определения subscription_card_product.php:20