luky / conditions
0.1
2020-06-01 08:51 UTC
Requires
- php: >=7.1
Requires (Dev)
- nette/tester: ^2.3
This package is auto-updated.
Last update: 2024-11-08 18:07:43 UTC
README
Micro library with usefull set of conditions without loose of readability
Installation
composer require luky/conditions
Usage
Any - check if ANY of item meets the condition
Use case examples:
- throw exception if any element is null
- show flash message if any validator return false
if (Any::isNull($companyName, $phone, $zip))
{
// do stuff
}
Every - check if EVERY elements meets the condition
Use case examples:
- do smth if every item validation returns true
if (Every::isTrue(
))
{
// do stuff
}
None - check if NONE elements meets the condition
if (Every::isTrue(
))
{
// do stuff
}