mirror of
https://github.com/Respect/Validation.git
synced 2024-06-07 08:12:16 +02:00
Make all rules inclusive by default
This commit is contained in:
parent
bbf9c2505e
commit
62761ffe18
|
@ -29,6 +29,9 @@ All notable changes of the Respect\Validation releases are documented in this fi
|
|||
### Changed
|
||||
|
||||
- Add country code to the message of "PostalCode" exception rule (#413)
|
||||
- Make "Between" rule inclusive (#445)
|
||||
- Make "Max" rule inclusive (#445)
|
||||
- Make "Min" rule inclusive (#445)
|
||||
- New generic top-level domains (#368)
|
||||
- On `AbstractRelated` (`Attribute`, `Call` and `Key`) define names for child rules (#365)
|
||||
- On exceptions, convert `Array` to string (#387)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Between
|
||||
|
||||
- `v::between(mixed $start, mixed $end)`
|
||||
- `v::between(mixed $start, mixed $end, boolean $inclusive = false)`
|
||||
- `v::between(mixed $start, mixed $end, boolean $inclusive = true)`
|
||||
|
||||
Validates ranges. Most simple example:
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Max
|
||||
|
||||
- `v::max(mixed $maxValue)`
|
||||
- `v::max(mixed $maxValue, boolean $inclusive = false)`
|
||||
- `v::max(mixed $maxValue, boolean $inclusive = true)`
|
||||
|
||||
Validates if the input doesn't exceed the maximum value.
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Min
|
||||
|
||||
- `v::min(mixed $minValue)`
|
||||
- `v::min(mixed $minValue, boolean $inclusive = false)`
|
||||
- `v::min(mixed $minValue, boolean $inclusive = true)`
|
||||
|
||||
Validates if the input is greater than the minimum value.
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ abstract class AbstractInterval extends AbstractRule
|
|||
public $interval;
|
||||
public $inclusive;
|
||||
|
||||
public function __construct($interval, $inclusive = false)
|
||||
public function __construct($interval, $inclusive = true)
|
||||
{
|
||||
$this->interval = $interval;
|
||||
$this->inclusive = $inclusive;
|
||||
|
|
|
@ -18,7 +18,7 @@ class Between extends AllOf
|
|||
public $minValue;
|
||||
public $maxValue;
|
||||
|
||||
public function __construct($min = null, $max = null, $inclusive = false)
|
||||
public function __construct($min = null, $max = null, $inclusive = true)
|
||||
{
|
||||
$this->minValue = $min;
|
||||
$this->maxValue = $max;
|
||||
|
|
|
@ -29,7 +29,7 @@ use Respect\Validation\Rules\Key;
|
|||
* @method static Validator bank(string $countryCode)
|
||||
* @method static Validator bankAccount(string $countryCode)
|
||||
* @method static Validator base()
|
||||
* @method static Validator between(mixed $min = null, mixed $max = null, bool $inclusive = false)
|
||||
* @method static Validator between(mixed $min = null, mixed $max = null, bool $inclusive = true)
|
||||
* @method static Validator bic(string $countryCode)
|
||||
* @method static Validator boolType()
|
||||
* @method static Validator call()
|
||||
|
@ -78,9 +78,9 @@ use Respect\Validation\Rules\Key;
|
|||
* @method static Validator length(int $min = null, int $max = null, bool $inclusive = true)
|
||||
* @method static Validator lowercase()
|
||||
* @method static Validator macAddress()
|
||||
* @method static Validator max(mixed $maxValue, bool $inclusive = false)
|
||||
* @method static Validator max(mixed $maxValue, bool $inclusive = true)
|
||||
* @method static Validator mimetype(string $mimetype)
|
||||
* @method static Validator min(mixed $minValue, bool $inclusive = false)
|
||||
* @method static Validator min(mixed $minValue, bool $inclusive = true)
|
||||
* @method static Validator minimumAge(int $age)
|
||||
* @method static Validator multiple(int $multipleOf)
|
||||
* @method static Validator negative()
|
||||
|
|
|
@ -15,4 +15,4 @@ try {
|
|||
?>
|
||||
--EXPECTF--
|
||||
\-"something" is not tasty
|
||||
\-"something" must be greater than 1
|
||||
\-"something" must be greater than or equals 1
|
||||
|
|
Loading…
Reference in a new issue