src/Data/FormatAbleObject.php
protected function loop($data, Closure $callable)
    {
        if (!is_array($data) && !is_object($data)) {
            return;
        }

        foreach ($data as $key => $value) {
            call_user_func_array($callable, [$key, $value]);
        }
    }
protected function loop($data, Closure $callable)
    {
        if (!is_array($data) && !is_object($data)) {
            return;
        }

        foreach ($data as $key => $value) {
            call_user_func_array($callable, [$key, $value]);
        }
    }
protected function loop ( $ data , Closure $ callable ) { if ( ! is_array ( $ data ) && ! is_object ( $ data ) ) { return ; } foreach ( $ data as $ key => $ value ) { call_user_func_array ( $ callable , [ $ key , $ value ] ) ; } }
Loop through the given data and call the given function.

@param array|object $data
@param Closure      $callable
Loop through the given data and call the given function .