respect-validation/tests/benchmark/ValidatorBench.php
Alexandre Gomes Gaigalas 47f8f82d7f Remove mathematical, niche and deprecated validators
This commit removes validators described in #1642, refactoring
to clean up after their removal.

 - Url was refactored to use the function `filter_var` instead.
 - tests/bootstrap.php is no longer needed and was removed.
 - Updated migration guide with recommendations for replacements.
2026-01-30 16:08:27 +00:00

38 lines
1.1 KiB
PHP

<?php
/*
* SPDX-License-Identifier: MIT
* SPDX-FileCopyrightText: (c) Respect Project Contributors
* SPDX-FileContributor: Alexandre Gomes Gaigalas <alganet@gmail.com>
*/
declare(strict_types=1);
namespace Respect\Validation\Benchmarks;
use PhpBench\Attributes as Bench;
use Respect\Validation\Test\SmokeTestProvider;
use Respect\Validation\Validator;
class ValidatorBench
{
use SmokeTestProvider;
/** @param array<Validator, mixed> $params */
#[Bench\ParamProviders(['provideValidatorInput'])]
#[Bench\Iterations(10)]
#[Bench\RetryThreshold(5)]
#[Bench\Revs(5)]
#[Bench\Warmup(1)]
#[Bench\Assert('mode(variant.time.avg) < mode(baseline.time.avg) +/- 10%')]
#[Bench\Assert('mode(variant.time.net) < mode(baseline.time.net) +/- 10%')]
#[Bench\Assert('mode(variant.mem.peak) < mode(baseline.mem.peak) +/- 10%')]
#[Bench\Assert('mode(variant.mem.real) < mode(baseline.mem.real) +/- 10%')]
#[Bench\Assert('mode(variant.mem.final) < mode(baseline.mem.final) +/- 10%')]
#[Bench\Subject]
public function evaluate(array $params): void
{
[$v, $input] = $params;
$v->evaluate($input);
}
}