<commit_before><?php
/**
 * This file is part of stubbles.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package  stubbles\input
 */
namespace stubbles\input\filter;
use stubbles\input\Filter;
use stubbles\input\Param;
/**
 * Basic class for filters on request variables of type array.
 *
 * When input param is null return value is null, if input param is an empty
 * string return value is an empty array. For all other values the given param
 * will be split using the separator (defaults to ',') and each array element
 * will be trimmed to remove superfluous whitespace.
 *
 * @since  2.0.0
 */
class ArrayFilter implements Filter
{
    /**
     * default separator to be used to split string
     */
    const SEPARATOR_DEFAULT = ',';
    /**
     * separator to be used to split parameter value
     *
     * @type  string
     */
    private $separator      = self::SEPARATOR_DEFAULT;

    /**
     * constructor
     *
     * @param  string  $separator  optional  separator to be used to split parameter value
     */
    public function __construct($separator = self::SEPARATOR_DEFAULT)
    {
        $this->separator = $separator;
    }

    /**
     * sets separator to be used<commit_msg>refactor<commit_after><?php
/**
 * This file is part of stubbles.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package  stubbles\input
 */
namespace stubbles\input\filter;
use stubbles\input\Filter;
use stubbles\input\Param;
/**
 * Basic class for filters on request variables of type array.
 *
 * When input param is null return value is null, if input param is an empty
 * string return value is an empty array. For all other values the given param
 * will be split using the separator (defaults to ',') and each array element
 * will be trimmed to remove superfluous whitespace.
 *
 * @since  2.0.0
 */
class ArrayFilter implements Filter
{
    /**
     * default separator to be used to split string
     */
    const SEPARATOR_DEFAULT = ',';
    /**
     * separator to be used to split parameter value
     *
     * @type  string
     */
    private $separator      = self::SEPARATOR_DEFAULT;

    /**
     * constructor
     *
     * @param  string  $separator  optional  separator to be used to split parameter value
     */
    public function __construct($separator = self::SEPARATOR_DEFAULT)
    {
        $this->setSeparator($separator);
    }

    /**
     * sets separator to be used
{'fraction_non_alphanumeric': 0.08485083301046106, 'fraction_numerical': 0.002324680356450988, 'mean_word_length': 2.7914831130690163, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3205724', 'n_tokens_mistral': 707, 'n_tokens_neox': 688, 'n_words': 288}