<commit_before><?php
declare(strict_types=1);

namespace WScore\Validation\Validators;

use WScore\Validation\Interfaces\ResultInterface;

/**
 * validates a list of input, like form input.
 *
 * @package WScore\Validation\Validators
 */
class ValidationList extends AbstractValidation
{
    /**
     * @param string $name
     * @param ValidationList $form
     * @return $this
     */
    public function addRepeatedForm(string $name, ValidationList $form)
    {
        $repeat = new ValidationRepeat($this->message);
        $repeat->add('0', $form);
        $this->add($name, $repeat);
        return $this;
    }

    /**
     * @param array $inputs
     * @param string|null $name
     * @return ResultList|ResultInterface
     */
    private function initialize($inputs, $name = null)
    {
        $results = new ResultList($inputs, $name);
        // apply pre-filters.
        foreach ($this->preFilters as $filter) {
            if ($returned = $filter->apply($results)) {<commit_msg>use interface, instead of a class.<commit_after><?php
declare(strict_types=1);

namespace WScore\Validation\Validators;

use WScore\Validation\Interfaces\ResultInterface;
use WScore\Validation\Interfaces\ValidationInterface;

/**
 * validates a list of input, like form input.
 *
 * @package WScore\Validation\Validators
 */
class ValidationList extends AbstractValidation
{
    /**
     * @param string $name
     * @param ValidationList $form
     * @return $this
     */
    public function addRepeatedForm(string $name, ValidationInterface $form)
    {
        $repeat = new ValidationRepeat($this->message);
        $repeat->add('0', $form);
        $this->add($name, $repeat);
        return $this;
    }

    /**
     * @param array $inputs
     * @param string|null $name
     * @return ResultList|ResultInterface
     */
    private function initialize($inputs, $name = null)
    {
        $results = new ResultList($inputs, $name);
        // apply pre-filters.
        foreach ($this->preFilters as $filter) {
            if ($returned = $filter->apply($results)) {
{'fraction_non_alphanumeric': 0.1303088803088803, 'fraction_numerical': 0.0019305019305019305, 'mean_word_length': 2.8820224719101124, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '5088222', 'n_tokens_mistral': 594, 'n_tokens_neox': 585, 'n_words': 145}