Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Use logic operators instead of dual methods #211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use logic operators instead of dual methods #211

wants to merge 1 commit into from

Commits on Jul 11, 2017

  1. Use logic operators instead of dual methods

    Instead of using mutable functions (one / all) the best solution is to use logical operators ( & | ).
    That way we get an extra function mixing both... can do things like that:
    ```php
    if (Auth::user()->hasRole('admin|employee&manager|employee&advanced')) {
        //do something if:
        //- user is admin
        //- user is an employee manager
        //- user is an employee with advanced role
    }
    ```
    Like in normal coding, the and operator has priority.
    
    Removed: getMethodName, getArrayFrom
    Included: matchOperator, mapOrAnd
    wffranco authored Jul 11, 2017
    Configuration menu
    Copy the full SHA
    9ff28dd View commit details
    Browse the repository at this point in the history