_messageTemplates = ['HAS_COLON' => mt('graphite', 'The username must not contain colons.')]; } public function isValid($value) { $hasColon = false !== strpos($value, ':'); if ($hasColon) { $this->_error('HAS_COLON'); } return ! $hasColon; } }