public function hasLength($length, $failMessage = null) { if (strlen($this->valueIsSet()->value) == $length) { $this->pass(); } else { $this->fail($failMessage ?: $this->_('length of %s is not %d', $this, $length)); } return $this; }