respect-validation/library/Rules/Core/Composite.php
Henrique Moody 0066786fa7
Remove deprecated methods check() and validate()
We want to release version 3.0 as fresh as possible, without having to
maintain backward compatibility with the previous versions.

Acked-by: Alexandre Gomes Gaigalas <alganet@gmail.com>
2025-12-18 17:29:02 +01:00

31 lines
624 B
PHP

<?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
*/
declare(strict_types=1);
namespace Respect\Validation\Rules\Core;
use Respect\Validation\Rule;
use function array_merge;
abstract class Composite implements Rule
{
/** @var non-empty-array<Rule> */
protected readonly array $rules;
public function __construct(Rule $rule1, Rule $rule2, Rule ...$rules)
{
$this->rules = array_merge([$rule1, $rule2], $rules);
}
/** @return non-empty-array<Rule> */
public function getRules(): array
{
return $this->rules;
}
}