<commit_before><?php
/**
 * 
 * This file is part of the Aura project for PHP.
 * 
 * @package Aura.Filter
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
namespace Aura\Filter\Rule;

use Aura\Filter\AbstractRule;

/**
 * 
 * Rule to call a method on the value object; the method should return a
 * boolean to indicate if the filter passed or failed.
 * 
 * @package Aura.Filter
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
class Method extends AbstractRule
{
    /**
     * 
     * Messages to use when validate or sanitize fails.
     *
     * @var array
     * 
     */
    protected $message_map = [
        'failure_is'            => 'FILTER_RULE_FAILURE_IS_METHOD',
        'failure_is_not'        => 'FILTER_RULE_FAILURE_IS_NOT_METHOD',
        'failure_is_blank_or'   => 'FILTER_RULE_FAILURE_IS_BLANK_OR_METHOD',
        'failure_fix'           => 'FILTER_RULE_FAILURE_FIX_METHOD',
        'failure_fix_blank_or'  => 'FILTER_RULE_FAILURE_FIX_BLANK_OR_METHOD',
    ];

    /**
     * 
     * Calls a method on the value object to validate itself; the method 
     * should return a boolean to indicate if the filter passed or failed.
     * 
     * @param string $method The method to call on the value object.
     * 
     * @return bool True if valid, false if not.
     * 
     */
    public function validate($method)
    {
        $this->setParams(get_defined_vars());
        return (bool) $this->call(func_get_args());
    }

    /**
     * 
     * Calls a method on the value object to sanitize itself; the method 
     * should return a boolean to indicate if the filter passed or failed.
     * 
     * @return bool True if the value was fixed, false if not.
     * <commit_msg>docblock updates<commit_after><?php
/**
 * 
 * This file is part of the Aura project for PHP.
 * 
 * @package Aura.Filter
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
namespace Aura\Filter\Rule;

use Aura\Filter\AbstractRule;

/**
 * 
 * Rule to call a method on the value object; the method should return a
 * boolean to indicate if the filter passed or failed.
 * 
 * @package Aura.Filter
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
class Method extends AbstractRule
{
    /**
     * 
     * Messages to use when validate or sanitize fails.
     *
     * @var array
     * 
     */
    protected $message_map = [
        'failure_is'            => 'FILTER_RULE_FAILURE_IS_METHOD',
        'failure_is_not'        => 'FILTER_RULE_FAILURE_IS_NOT_METHOD',
        'failure_is_blank_or'   => 'FILTER_RULE_FAILURE_IS_BLANK_OR_METHOD',
        'failure_fix'           => 'FILTER_RULE_FAILURE_FIX_METHOD',
        'failure_fix_blank_or'  => 'FILTER_RULE_FAILURE_FIX_BLANK_OR_METHOD',
    ];

    /**
     * 
     * Calls a method on the value object to validate itself; the method 
     * should return a boolean to indicate if the filter passed or failed.
     * 
     * @param string $method The method to call on the value object.
     * 
     * @return bool True if valid, false if not.
     * 
     */
    public function validate($method)
    {
        $this->setParams(get_defined_vars());
        return (bool) $this->call(func_get_args());
    }

    /**
     * 
     * Calls a method on the value object to sanitize itself; the method 
     * should return a boolean to indicate if the filter passed or failed.
     * 
     * @param string $method The method to call on the value object.
     * 
     * @return bool True if the value was fixed, false if not.
     * 
{'fraction_non_alphanumeric': 0.09737723214285714, 'fraction_numerical': 0.0, 'mean_word_length': 2.391674550614948, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '6696049', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1081, 'n_words': 330}