public function eachPermission(array $permissions, callable $callback)
    {
        $permissions = array_flatten($permissions);

        foreach ($permissions as $permission) {
            if ($permission = $this->preparePermission($permission)) {
                $callback($permission);    
            }
        }
    }
public function eachPermission(array $permissions, callable $callback)
    {
        $permissions = array_flatten($permissions);

        foreach ($permissions as $permission) {
            if ($permission = $this->preparePermission($permission)) {
                $callback($permission);    
            }
        }
    }
public function eachPermission ( array $ permissions , callable $ callback ) { $ permissions = array_flatten ( $ permissions ) ; foreach ( $ permissions as $ permission ) { if ( $ permission = $ this -> preparePermission ( $ permission ) ) { $ callback ( $ permission ) ; } } }
Calc each permission

@param array $permissions
@param callable $callback
Calc each permission