function lengthOf(int $value = null): self {
    if ($value === null) return $this->setFlag('length');

    if (is_string($this->target)) {
      $constraint = equalTo($value);
      $target = mb_strlen($this->target);
    }
    else {
      $constraint = countOf($value);
      $target = $this->target;
    }

    return $this->expect($target, $constraint);
  }