<commit_before>***REMOVED***

namespace FormAl\Validators;

use FormAl\ElementBase;
use FormAl\ValidatorBase;

/**
 * Class MaxLength
 *
 * @package FormAl\Validators
 */
class MaxLength extends ValidatorBase
{
    public $maxLength = 0;

    /**
     * @param int $length
     */
    public function __construct($length)
    {
        $this->maxLength = $length;
    ***REMOVED***

    /**
     * @param string      $data
     * @param ElementBase $element
     *
     * @return bool
     */
    public function validateInput($data, ElementBase $element)
    {
        if (is_string($data)) {
            if (strlen($data) <= $this->maxLength) {
                return true;
            ***REMOVED*** else {
                $element->error(
                    trans("Error"),
                    trans(
                        "This text is too long. The maximum length is %s character.",<commit_msg>Update MaxLength.php<commit_after>***REMOVED***

namespace FormAl\Validators;

use FormAl\ElementBase;
use FormAl\ValidatorBase;

/**
 * Class MaxLength
 *
 * @package FormAl\Validators
 */
class MaxLength extends ValidatorBase
{
    public $maxLength = 0;

    /**
     * @param int $length
     */
    public function __construct($length)
    {
        $this->maxLength = $length;
    ***REMOVED***

    /**
     * @param string      $data
     * @param ElementBase $element
     *
     * @return bool
     */
    public function validateInput($data, ElementBase $element)
    {
        if(empty($this->maxLength)) {
            return true;
        ***REMOVED***
        if (is_string($data)) {
            if (strlen($data) <= $this->maxLength) {
                return true;
            ***REMOVED*** else {
                $element->error(
                    trans("Error"),
                    trans(
                        "This text is too long. The maximum length is %s character.",
{'fraction_non_alphanumeric': 0.12869198312236288, 'fraction_numerical': 0.0010548523206751054, 'mean_word_length': 1.827123695976155, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '7132013', 'n_tokens_mistral': 541, 'n_tokens_neox': 526, 'n_words': 130}