params) || !isset($this->params[$this->field])) { return $this->addError(':attribute not exists'); } switch (strtolower($this->method)) { case self::CAN_NOT_EMPTY: if (strlen($this->params[$this->field]) < 1) { return $this->addError('The :attribute can not empty.'); } break; case self::CAN_NOT_NULL: if ($this->params[$this->field] === null) { return $this->addError('The :attribute can not is null.'); } break; } return true; } }