public static function mapList(callable $callback, array $data): array
    {
        if (!isset($data[0])) {
            $data = [$data];
        }

        return array_map($callback, $data);
    }
public static function mapList(callable $callback, array $data): array
    {
        if (!isset($data[0])) {
            $data = [$data];
        }

        return array_map($callback, $data);
    }
public static function mapList ( callable $ callback , array $ data ) : array { if ( ! isset ( $ data [ 0 ] ) ) { $ data = [ $ data ] ; } return array_map ( $ callback , $ data ) ; }
Cleans the api response, so that you always get a list of elements.

@param callable $callback
@param array    $data

@return array
Cleans the api response so that you always get a list of elements .