src/Refinery.php
protected function getItemsUsingCallback($raw, $class, callable $callback)
    {
        if ($class->hasFilter()) {
            $query = $class->getFilter();
            $items = $callback($raw);

            return call_user_func_array($query, [$items]);
        } else {
            return $callback($raw);
        }
    }
protected function getItemsUsingCallback($raw, $class, callable $callback)
    {
        if ($class->hasFilter()) {
            $query = $class->getFilter();
            $items = $callback($raw);

            return call_user_func_array($query, [$items]);
        } else {
            return $callback($raw);
        }
    }
Run a callback on the raw item(s) and then return the items.

@param mixed    $raw
@param mixed    $class
@param callable $callback
@return mixed