li3_access\extensions\adapter\security\access\AuthRbac::_parseClosures PHP Method

_parseClosures() protected static method

_parseClosures Iterates over an array and runs any anonymous functions it finds. Returns true if all of the closures it runs evaluate to true. $match is passed by refference and any closures found are removed from it before the method is complete.
protected static _parseClosures ( array &$data, object $request, array &$roleOptions = [] ) : boolean
$data array dereferenced Array
$request object The Lithium `Request` object
$roleOptions array dereferenced Array
return boolean
    protected static function _parseClosures(array &$data, $request, array &$roleOptions = array())
    {
        $return = true;
        foreach ($data as $key => $item) {
            if (is_callable($item)) {
                if ($return === true) {
                    $return = (bool) $item($request, $roleOptions);
                }
                unset($data[$key]);
            }
        }
        return $return;
    }