<commit_before><?php

namespace Edge\Filter;

use Zend\Filter\AbstractFilter;

class CsvToArray extends AbstractFilter
{
    /**
     * Convert comma separated string to array
     *
     * @param  string $value
     * @return array
     */
    public function filter($value)
    {
        if (is_string($value)) {
            return explode(',', $value);
        }
        return $value;
    }
}<commit_msg>Don't convert empty values to array<commit_after><?php

namespace Edge\Filter;

use Zend\Filter\AbstractFilter;

class CsvToArray extends AbstractFilter
{
    /**
     * Convert comma separated string to array
     *
     * @param  string $value
     * @return array
     */
    public function filter($value)
    {
        if ($value === '' || $value === null) {
            return $value;
        }

        if (is_string($value)) {
            return explode(',', $value);
        }

        return $value;
    }
}
{'fraction_non_alphanumeric': 0.12, 'fraction_numerical': 0.0, 'mean_word_length': 2.066225165562914, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7533273', 'n_tokens_mistral': 271, 'n_tokens_neox': 264, 'n_words': 71}