mirror of
https://github.com/Respect/Validation.git
synced 2026-03-15 06:45:44 +01:00
31 lines
554 B
PHP
31 lines
554 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\Result;
|
|
use Respect\Validation\Rule;
|
|
|
|
abstract class Wrapper implements Rule
|
|
{
|
|
public function __construct(
|
|
protected readonly Rule $rule,
|
|
) {
|
|
}
|
|
|
|
public function evaluate(mixed $input): Result
|
|
{
|
|
return $this->rule->evaluate($input);
|
|
}
|
|
|
|
public function getRule(): Rule
|
|
{
|
|
return $this->rule;
|
|
}
|
|
}
|