<commit_before><?php
namespace CfdiUtils\Validate;

use CfdiUtils\Validate\Cfdi33\Xml\XmlFollowSchema;

class MultiValidatorFactory
{
    /** @var Discoverer */
    private $discoverer;

    public function __construct(Discoverer $discoverer = null)
    {
        $this->discoverer = $discoverer ? : new Discoverer();
    }

    public function getDiscoverer(): Discoverer
    {
        return $this->discoverer;
    }

    public function newCreated33(): MultiValidator
    {
        $multiValidator = new MultiValidator('3.3');
        $multiValidator->add(new XmlFollowSchema());
        $this->addDiscovered($multiValidator, __NAMESPACE__ . '\Cfdi33\Standard', __DIR__ . '/Cfdi33/Standard');
        return $multiValidator;
    }

    public function newReceived33(): MultiValidator
    {
        $multiValidator = $this->newCreated33();
        $this->addDiscovered($multiValidator, __NAMESPACE__ . '\Cfdi33\Timbre', __DIR__ . '/Cfdi33/Timbre');
        return $multiValidator;
    }

    public function addDiscovered(MultiValidator $multiValidator, string $namespacePrefix, string $directory)
    {
        return $multiValidator->addMulti(
            ...$this->discoverer->discoverInFolder($namespacePrefix, $directory)
        );
    }
}<commit_msg>addDiscovered does not return anything<commit_after><?php
namespace CfdiUtils\Validate;

use CfdiUtils\Validate\Cfdi33\Xml\XmlFollowSchema;

class MultiValidatorFactory
{
    /** @var Discoverer */
    private $discoverer;

    public function __construct(Discoverer $discoverer = null)
    {
        $this->discoverer = $discoverer ? : new Discoverer();
    }

    public function getDiscoverer(): Discoverer
    {
        return $this->discoverer;
    }

    public function newCreated33(): MultiValidator
    {
        $multiValidator = new MultiValidator('3.3');
        $multiValidator->add(new XmlFollowSchema());
        $this->addDiscovered($multiValidator, __NAMESPACE__ . '\Cfdi33\Standard', __DIR__ . '/Cfdi33/Standard');
        return $multiValidator;
    }

    public function newReceived33(): MultiValidator
    {
        $multiValidator = $this->newCreated33();
        $this->addDiscovered($multiValidator, __NAMESPACE__ . '\Cfdi33\Timbre', __DIR__ . '/Cfdi33/Timbre');
        return $multiValidator;
    }

    public function addDiscovered(MultiValidator $multiValidator, string $namespacePrefix, string $directory)
    {
        $multiValidator->addMulti(
            ...$this->discoverer->discoverInFolder($namespacePrefix, $directory)
        );
    }
}
{'fraction_non_alphanumeric': 0.11908517350157728, 'fraction_numerical': 0.014195583596214511, 'mean_word_length': 3.2283333333333335, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '1555259', 'n_tokens_mistral': 758, 'n_tokens_neox': 734, 'n_words': 137}