code: public function setIdentity(?string $identity)
      {
          if (null !== $identity) {
              if (!preg_match('/^[a-z]+$/i', $identity)) {
                  throw new DomainException('Identity is not valid.');
              }
          }
  
          $this->identity = $identity;
  
          return $this;
      }
docs: Set identity
  
  @param string $identity
  @return object
  @throws \DomainException