<commit_before><?php

namespace Intervention\Validation;

use Intervention\Validation\AbstractRule;

class Validator
{
    /**
     * Current rule
     *
     * @var Rules\AbstractRule
     */
    protected $rule;

    /**
     * Create new instance
     *
     * @param mixed $value
     */
    public function __construct(AbstractRule $rule)
    {
        $this->rule = $rule;
    }

    /**
     * Overwrite current rule
     *
     * @param AbstractRule $rule
     */
    public function setRule(AbstractRule $rule): Validator
    {
        $this->rule = $rule;

        return $this;
    }

    /**
     * Return current rule
     *
     * @return AbstractRule
     */
    public function getRule(): AbstractRule
    {
        return $this->rule;
    }

    /**
     * Static constructor
     *
     * @param  AbstractRule $classname
     * @param  mixed        $value
     * @return self
     */
    public static function make(AbstractRule $rule): Validator
    {
        return new self($rule);
    }

    /**
     * Validate given value against current rule
     *
     * @param  mixed $value
     * @return boolean
     */
    public function validate($value)
    {
        return $this->rule->isValid($value);
    }

    /**
     * Magic method for static calls
     *
     * @param  string $name
     * @param  array  $arguments
     * @return boolean
     */
    public static function __callStatic($name, $arguments)
    {
        $value = isset($arguments[0]) ? $arguments[0] : null;

        return self::getRuleByCall($name)->setValue($value)->isValid();
    }
<commit_msg>Bugfix<commit_after><?php

namespace Intervention\Validation;

use Intervention\Validation\AbstractRule;

class Validator
{
    /**
     * Current rule
     *
     * @var Rules\AbstractRule
     */
    protected $rule;

    /**
     * Create new instance
     *
     * @param mixed $value
     */
    public function __construct(AbstractRule $rule)
    {
        $this->rule = $rule;
    }

    /**
     * Overwrite current rule
     *
     * @param AbstractRule $rule
     */
    public function setRule(AbstractRule $rule): Validator
    {
        $this->rule = $rule;

        return $this;
    }

    /**
     * Return current rule
     *
     * @return AbstractRule
     */
    public function getRule(): AbstractRule
    {
        return $this->rule;
    }

    /**
     * Static constructor
     *
     * @param  AbstractRule $classname
     * @param  mixed        $value
     * @return self
     */
    public static function make(AbstractRule $rule): Validator
    {
        return new self($rule);
    }

    /**
     * Validate given value against current rule
     *
     * @param  mixed $value
     * @return boolean
     */
    public function validate($value)
    {
        return $this->rule->setValue($value)->isValid();
    }

    /**
     * Magic method for static calls
     *
     * @param  string $name
     * @param  array  $arguments
     * @return boolean
     */
    public static function __callStatic($name, $arguments)
    {
        $value = isset($arguments[0]) ? $arguments[0] : null;

        return self::getRuleByCall($name)->setValue($value)->isValid();
    }

{'fraction_non_alphanumeric': 0.11868131868131868, 'fraction_numerical': 0.0012558869701726845, 'mean_word_length': 1.8911070780399275, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '1828361', 'n_tokens_mistral': 923, 'n_tokens_neox': 916, 'n_words': 220}