/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/ObjectMapper/Condition/ClassRuleList.php
35 строк
989 B
Nicolas Grekas
[ObjectMapper] Various fixes and hardenings
19 май 2026, 10:22
19 май 2026, 10:22
e71cad0
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\ObjectMapper\Condition; use Symfony\Component\ObjectMapper\Exception\InvalidArgumentException; /** * @implements ClassRuleConditionCallableInterface<object, object> */ final class ClassRuleList implements ClassRuleConditionCallableInterface { /** * @param non-empty-array<ClassRule|SourceClass|TargetClass> $rules */ public function __construct(private array $rules) { if (!$this->rules) { throw new InvalidArgumentException('A ClassRuleList needs at least one rule.'); } } public function __invoke(mixed $value, object $source, ?object $target): bool { return array_any($this->rules, static fn ($rule) => $rule($value, $source, $target)); } }