mirror of
https://github.com/Respect/Validation.git
synced 2024-06-03 06:12:17 +02:00
97b243daa1
Although helpful, the changes in the Min, Max, and Length rules made using those rules more verbose. This commit will simplify their use by allowing users to use them as prefixes. Because I was creating prefixes for those rules, I made other cool prefixes. Doing that is scary because it will generate more code to support, and I would have liked to avoid that. However, that's a valuable addition, and it's worth the risk. I might reconsider that in the future, but for now, that looks like a good idea. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
54 lines
1.6 KiB
PHP
54 lines
1.6 KiB
PHP
<?php
|
|
|
|
/*
|
|
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Respect\Validation\Mixins;
|
|
|
|
interface StaticMax
|
|
{
|
|
public static function maxBetween(mixed $minValue, mixed $maxValue): ChainedValidator;
|
|
|
|
public static function maxBetweenExclusive(mixed $minimum, mixed $maximum): ChainedValidator;
|
|
|
|
public static function maxEquals(mixed $compareTo): ChainedValidator;
|
|
|
|
public static function maxEquivalent(mixed $compareTo): ChainedValidator;
|
|
|
|
public static function maxEven(): ChainedValidator;
|
|
|
|
public static function maxFactor(int $dividend): ChainedValidator;
|
|
|
|
public static function maxFibonacci(): ChainedValidator;
|
|
|
|
public static function maxFinite(): ChainedValidator;
|
|
|
|
public static function maxGreaterThan(mixed $compareTo): ChainedValidator;
|
|
|
|
public static function maxGreaterThanOrEqual(mixed $compareTo): ChainedValidator;
|
|
|
|
public static function maxIdentical(mixed $compareTo): ChainedValidator;
|
|
|
|
public static function maxIn(mixed $haystack, bool $compareIdentical = false): ChainedValidator;
|
|
|
|
public static function maxInfinite(): ChainedValidator;
|
|
|
|
public static function maxLessThan(mixed $compareTo): ChainedValidator;
|
|
|
|
public static function maxLessThanOrEqual(mixed $compareTo): ChainedValidator;
|
|
|
|
public static function maxMultiple(int $multipleOf): ChainedValidator;
|
|
|
|
public static function maxOdd(): ChainedValidator;
|
|
|
|
public static function maxPerfectSquare(): ChainedValidator;
|
|
|
|
public static function maxPositive(): ChainedValidator;
|
|
|
|
public static function maxPrimeNumber(): ChainedValidator;
|
|
}
|