code: public function setScope(?string $scope)
      {
          if (null !== $scope && $this->getScopes() && !in_array($scope, $this->getScopes(), true)) {
              throw new DomainException('Scope does not exist.');
          }
  
          $this->scope = $scope;
  
          return $this;
      }
docs: Set scope
  
  @param string $scope
  @return object
  @throws \DomainException