<commit_before><?php
namespace Thunder\Monotype;

/**
 * @author <NAME> <<EMAIL>>
 */
final class Monotype
    {
    /** @var StrategyInterface */
    private $strategy;

    /** @var TypeInterface[] */
    private $types = array();

    /**
     * @param StrategyInterface $strategy
     * @param TypeInterface[] $tests
     */
    public function __construct(StrategyInterface $strategy, array $tests)
        {
        if(empty($tests))
            {
            $msg = 'I am really sorry, but you did not provide any tests...';
            throw new \InvalidArgumentException($msg);
            }

        $this->strategy = $strategy;

        array_map(function(TypeInterface $test) {
            $this->addType($test);
            }, $tests);
        }

    /**
     * Validates given variable against already registered tests referenced by
     * array of their aliases.
     *
     * @param mixed $value
     * @param string[] $tests
     *
     * @return bool<commit_msg>another try at PHP 5.3 compatibility<commit_after><?php
namespace Thunder\Monotype;

/**
 * @author <NAME> <<EMAIL>>
 */
final class Monotype
    {
    /** @var StrategyInterface */
    private $strategy;

    /** @var TypeInterface[] */
    private $types = array();

    /**
     * @param StrategyInterface $strategy
     * @param TypeInterface[] $tests
     */
    public function __construct(StrategyInterface $strategy, array $tests)
        {
        if(empty($tests))
            {
            $msg = 'I am really sorry, but you did not provide any tests...';
            throw new \InvalidArgumentException($msg);
            }

        $this->strategy = $strategy;
        $that = $this;

        array_map(function(TypeInterface $test) use($that) {
            $that->addType($test);
            }, $tests);
        }

    /**
     * Validates given variable against already registered tests referenced by
     * array of their aliases.
     *
     * @param mixed $value
     * @param string[] $tests
     *
     * @return bool
{'fraction_non_alphanumeric': 0.12692117005453643, 'fraction_numerical': 0.0009915716410510659, 'mean_word_length': 2.0622154779969653, 'pattern_counts': {'":': 0, '<': 11, '<?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': '7439616', 'n_tokens_mistral': 564, 'n_tokens_neox': 543, 'n_words': 153}