luky/conditions

Maintainers

Details

gitlab.com/Luky/conditions

0.1 2020-06-01 08:51 UTC

This package is auto-updated.

Last update: 2022-06-08 13:17:35 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
}