original_string: public function setGroupSequence($groupSequence)
      {
          if ($this->isGroupSequenceProvider()) {
              throw new GroupDefinitionException('Defining a static group sequence is not allowed with a group sequence provider');
          }
  
          if (\is_array($groupSequence)) {
              $groupSequence = new GroupSequence($groupSequence);
          }
  
          if (\in_array(Constraint::DEFAULT_GROUP, $groupSequence->groups, true)) {
              throw new GroupDefinitionException(sprintf('The group "%s" is not allowed in group sequences', Constraint::DEFAULT_GROUP));
          }
  
          if (!\in_array($this->getDefaultGroup(), $groupSequence->groups, true)) {
              throw new GroupDefinitionException(sprintf('The group "%s" is missing in the group sequence', $this->getDefaultGroup()));
          }
  
          $this->groupSequence = $groupSequence;
  
          return $this;
      }
code: public function setGroupSequence($groupSequence)
      {
          if ($this->isGroupSequenceProvider()) {
              throw new GroupDefinitionException('Defining a static group sequence is not allowed with a group sequence provider');
          }
  
          if (\is_array($groupSequence)) {
              $groupSequence = new GroupSequence($groupSequence);
          }
  
          if (\in_array(Constraint::DEFAULT_GROUP, $groupSequence->groups, true)) {
              throw new GroupDefinitionException(sprintf('The group "%s" is not allowed in group sequences', Constraint::DEFAULT_GROUP));
          }
  
          if (!\in_array($this->getDefaultGroup(), $groupSequence->groups, true)) {
              throw new GroupDefinitionException(sprintf('The group "%s" is missing in the group sequence', $this->getDefaultGroup()));
          }
  
          $this->groupSequence = $groupSequence;
  
          return $this;
      }
code_tokens: public function setGroupSequence ( $ groupSequence ) { if ( $ this -> isGroupSequenceProvider ( ) ) { throw new GroupDefinitionException ( 'Defining a static group sequence is not allowed with a group sequence provider' ) ; } if ( \ is_array ( $ groupSequence ) ) { $ groupSequence = new GroupSequence ( $ groupSequence ) ; } if ( \ in_array ( Constraint :: DEFAULT_GROUP , $ groupSequence -> groups , true ) ) { throw new GroupDefinitionException ( sprintf ( 'The group "%s" is not allowed in group sequences' , Constraint :: DEFAULT_GROUP ) ) ; } if ( ! \ in_array ( $ this -> getDefaultGroup ( ) , $ groupSequence -> groups , true ) ) { throw new GroupDefinitionException ( sprintf ( 'The group "%s" is missing in the group sequence' , $ this -> getDefaultGroup ( ) ) ) ; } $ this -> groupSequence = $ groupSequence ; return $ this ; }
docstring: Sets the default group sequence for this class.
  
  @param string[]|GroupSequence $groupSequence An array of group names
  
  @return $this
  
  @throws GroupDefinitionException
docstring_tokens: Sets the default group sequence for this class .