<commit_before><?php

namespace Psecio\Validation;

abstract class Check
{
    protected $addl = [];

    public function __construct(array $addl = [])
    {
        $this->setAdditional($addl);
    }

    public function setAdditional(array $addl = [])
    {
        $this->addl = $addl;
    }
    public function get($name = null)
    {
        if ($name !== null) {
            return (isset($this->addl[$name])) ? $this->addl[$name] : null;
        } else {
            return $this->addl;
        }
    }

    public abstract function execute($input);
}<commit_msg>adding docblocks and "params" handling on Check base class<commit_after><?php

namespace Psecio\Validation;

abstract class Check
{
    /**
     * Additional paramters
     * @var array
     */
    protected $addl = [];

    /**
     * Parameter names for additional values
     * @var array
     */
    public $params = [];

    /**
     * Init the object and set additional values if provided
     *
     * @param array $addl Set of additional values
     */
    public function __construct(array $addl = [])
    {
        $this->setAdditional($addl);
    }

    /**
     * Set the current additional values
     *
     * @param array $addl Set of additional values
     */
    public function setAdditional(array $addl)
    {
        $this->addl = $addl;
    }

    /**
     * Get a value from the additional value set
     * If the "name" value is given, it tries to locate the value, returns null if not found
     * If no "name" is given, returns all values
     *
     * @param string $name Name of value to locate [optional]
     * @return mixed Either all values, the value if found or null if not found
     */
    public function get($name = null)
    {
        if ($name !== null) {
            return (isset($this->addl[$name])) ? $this->addl[$name] : null;
        } else {
            return $this->addl;
        }
    }

    /**
     * Get the current "parameters" values
     *
     * @return array Set of parameters
     */
    public function getParams()
    {
        return $this->params;
    }

    /**
     * Execute method to be overridden by the child "check" class
     *
     * @param mixed $input Input under evaluation
     * @return boolean Pass/fail of the evaluation
     */
    public abstract function execute($input);
}
{'fraction_non_alphanumeric': 0.11617900172117039, 'fraction_numerical': 0.0, 'mean_word_length': 2.0632411067193677, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '3044165', 'n_tokens_mistral': 672, 'n_tokens_neox': 658, 'n_words': 216}