mirror of
https://github.com/Respect/Validation.git
synced 2026-03-15 06:45:44 +01:00
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.
38 lines
1.1 KiB
PHP
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);
|
|
}
|
|
}
|