public static function serialize()

in src/Serializer/CsvSerializer.php [32:49]


    public static function serialize($data, array $options = []): string
    {
        if (!is_iterable($data)) {
            throw new InvalidIterableException(
                sprintf("The parameter %s is not iterable", serialize($data))
            );
        }
        $result = '';
        foreach ($data as $row) {
            if (is_array($row) || is_object($row)) {
                $result .= implode(',', (array) $row);
            } else {
                $result .= (string) $row;
            }
            $result .= "\n";
        }
        return empty($result) ? $result : substr($result, 0, -1);
    }