mirror of
https://github.com/Respect/Validation.git
synced 2024-06-08 08:42:15 +02:00
eeaea466ac
Because some rules work more as a prefix, it makes sense to prefix their result ID. That will allow for a more intuitive templating, especially when using those rules as prefixes. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
22 lines
435 B
PHP
22 lines
435 B
PHP
<?php
|
|
|
|
/*
|
|
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Respect\Validation\Rules;
|
|
|
|
use Respect\Validation\Result;
|
|
use Respect\Validation\Rules\Core\Wrapper;
|
|
|
|
final class Not extends Wrapper
|
|
{
|
|
public function evaluate(mixed $input): Result
|
|
{
|
|
return $this->rule->evaluate($input)->withInvertedMode()->withPrefixedId('not');
|
|
}
|
|
}
|