code: public function setStatus(?int $status)
      {
          if (null !== $status && $this->getStatuses() && !in_array($status, $this->getStatuses(), true)) {
              throw new DomainException('Status "'.$status.'" does not exist.');
          }
  
          $this->status = $status;
  
          return $this;
      }
docs: Set status
  
  @param integer $status
  @return object
  @throws \DomainException