src/Charcoal/Property/StringProperty.php
public function setMaxLength($maxLength)
    {
        if (!is_integer($maxLength)) {
            throw new InvalidArgumentException(
                'Max length must be an integer.'
            );
        }

        if ($maxLength < 0) {
            throw new InvalidArgumentException(
                'Max length must be a positive integer (>=0).'
            );
        }

        $this->maxLength = $maxLength;

        return $this;
    }
public function setMaxLength($maxLength)
    {
        if (!is_integer($maxLength)) {
            throw new InvalidArgumentException(
                'Max length must be an integer.'
            );
        }

        if ($maxLength < 0) {
            throw new InvalidArgumentException(
                'Max length must be a positive integer (>=0).'
            );
        }

        $this->maxLength = $maxLength;

        return $this;
    }
public function setMaxLength ( $ maxLength ) { if ( ! is_integer ( $ maxLength ) ) { throw new InvalidArgumentException ( 'Max length must be an integer.' ) ; } if ( $ maxLength < 0 ) { throw new InvalidArgumentException ( 'Max length must be a positive integer (>=0).' ) ; } $ this -> maxLength = $ maxLength ; return $ this ; }
Set the maximum number of characters allowed.

@param  integer $maxLength The max length allowed.
@throws InvalidArgumentException If the parameter is not an integer or < 0.
@return self
Set the maximum number of characters allowed .