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

_run() protected method

Itterates 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 reference and any closures found are removed from it before the method is complete.
protected _run ( array &$data, mixed $request = null, array &$options = [] ) : void
$data array
$request mixed
$options array
return void
    protected function _run(&$data, $request = null, array &$options = array())
    {
        if (is_bool($data)) {
            return $data;
        }
        if (!is_array($data)) {
            return false;
        }
        $allow = true;
        foreach ($data as $key => $item) {
            if (is_callable($item)) {
                if ($allow === true) {
                    $allow = (bool) $item($request, $options);
                }
                unset($data[$key]);
            }
        }
        return $allow;
    }