/** * @inheritdoc * @return string */ public function filter($value) { if (is_null($value)) { $value = $this->default; } $value = StringHelper::toStr($value); return StringHelper::strCrop(StringHelper::strPad($value, $this->minLength, $this->padString, $this->padType), $this->maxLength, $this->cropType); }
public function __construct($attributeName, $filter, $previous = null) { $filter = StringHelper::strCrop(StringHelper::printVar($filter), 50); parent::__construct('Filter \'' . $filter . '\' for attribute \'' . $attributeName . '\' is wrong.', 1016, $previous); }