respect-validation/library/Rules
Henrique Moody 562d98d805
Refactor the NotEmpty rule
Since we have the ability to use `not` as a prefix, having rules that
validate negative behaviour makes them a bit inflexible, verbose, and
harder to understand.

This commit will refactor the `NotEmpty`, and rename it to `Falsy`. It
will no longer trim strings, because Blank does a much better job at it;
it only simulates the behaviour of PHP’s native `empty()` function.

Because `Falsy`, `Blank`, and `Undef` have similar behaviour, I created
a page to demonstrate the difference and show when the user should use
one or the other.

Assisted-by: Cursor (claude-4.5-opus-high)
2025-12-29 12:48:35 +01:00
..
Core Refactor the NotEmpty rule 2025-12-29 12:48:35 +01:00
AllOf.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Alnum.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Alpha.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
AlwaysInvalid.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
AlwaysValid.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
AnyOf.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
ArrayType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
ArrayVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Attributes.php Enable validating private properties of parent classes 2025-12-23 16:44:04 +01:00
Base.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Base64.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Between.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
BetweenExclusive.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Blank.php Invert the behaviour of NotBlank 2025-12-27 17:18:30 +01:00
BoolType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
BoolVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Bsn.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Call.php Bump respect/coding-standard from 4 to 5 2025-12-18 19:03:39 +01:00
CallableType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Callback.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Charset.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Circuit.php Rename Result->isValid method 2025-03-31 21:29:37 +02:00
Cnh.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Cnpj.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Consonant.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Contains.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
ContainsAny.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Control.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Countable.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
CountryCode.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Cpf.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
CreditCard.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
CurrencyCode.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Date.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
DateTime.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
DateTimeDiff.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Decimal.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Digit.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Directory.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Domain.php Invert the behaviour of NoWhitespace 2025-12-29 09:11:01 +01:00
Each.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Email.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Emoji.php Refactor the NotEmoji rule 2025-12-29 11:16:25 +01:00
EndsWith.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Equals.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Equivalent.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Even.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Executable.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Exists.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Extension.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Factor.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
FalseVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Falsy.php Refactor the NotEmpty rule 2025-12-29 12:48:35 +01:00
Fibonacci.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
File.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
FilterVar.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Finite.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
FloatType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
FloatVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Graph.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
GreaterThan.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
GreaterThanOrEqual.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Hetu.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
HexRgbColor.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Iban.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Identical.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Image.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Imei.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
In.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Infinite.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Instance.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
IntType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
IntVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Ip.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Isbn.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
IterableType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
IterableVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Json.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Key.php Move important value objects to the root namespace 2025-12-21 11:14:47 +01:00
KeyExists.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
KeyOptional.php Rename Result->isValid method 2025-03-31 21:29:37 +02:00
KeySet.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
LanguageCode.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Lazy.php Remove deprecated methods check() and validate() 2025-12-18 17:29:02 +01:00
LeapDate.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
LeapYear.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Length.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
LessThan.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
LessThanOrEqual.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Lowercase.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Luhn.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
MacAddress.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Max.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Mimetype.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Min.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Multiple.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Named.php Move important value objects to the root namespace 2025-12-21 11:14:47 +01:00
Negative.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
NfeAccessKey.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Nif.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Nip.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
No.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
NoneOf.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Not.php Change how we trace the path of results 2025-12-20 22:19:17 +01:00
NullOr.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
NullType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Number.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
NumericVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
ObjectType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Odd.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
OneOf.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
PerfectSquare.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Pesel.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Phone.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
PhpLabel.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Pis.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
PolishIdCard.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
PortugueseNif.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Positive.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
PostalCode.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
PrimeNumber.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Printable.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Property.php Enable validating private properties of parent classes 2025-12-23 16:44:04 +01:00
PropertyExists.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
PropertyOptional.php Rename Result->isValid method 2025-03-31 21:29:37 +02:00
PublicDomainSuffix.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Punct.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Readable.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Regex.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
ResourceType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Roman.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
ScalarVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Size.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Slug.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Sorted.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Space.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Spaced.php Invert the behaviour of NoWhitespace 2025-12-29 09:11:01 +01:00
StartsWith.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
StringType.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
StringVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
SubdivisionCode.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Subset.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
SymbolicLink.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Templated.php Bump respect/coding-standard from 4 to 5 2025-12-18 19:03:39 +01:00
Time.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Tld.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
TrueVal.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Undef.php Invert the behaviour of NotUndef 2025-12-27 18:49:46 +01:00
UndefOr.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Unique.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Uploaded.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Uppercase.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Url.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Uuid.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Version.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
VideoUrl.php Create named constructor to create Result 2025-12-26 22:34:43 +01:00
Vowel.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
When.php Bump respect/coding-standard from 4 to 5 2025-12-18 19:03:39 +01:00
Writable.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Xdigit.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00
Yes.php Replace placeholder "name" with "subject" 2025-12-26 21:30:01 +01:00