Sets the teams to track on the scoreboard.

@param array $teams the teams to track on the scoreboard.

@throws \InvalidArgumentException When invalid or no teams are provided.
180650
private function setTeams(array $teams)
    {
        if (empty($teams)) {
            throw new \InvalidArgumentException(
                'You must provide at least one team'
            );
        }

        foreach ($teams as $team) {
            if (!$team instanceof Team) {
                throw new \InvalidArgumentException(
                    'All teams must be an instance of NyanCat\\Team'
                );
            }

            $this->teams[$team->getName()] = $team;
        }
    }
780616
public function setItems(array $items) : self {
      foreach ($items as $item) {
        if (!($item instanceof Token)) {
          throw new \InvalidArgumentException('Expect array of tokens. Token[]');
        }
      }

      $this->items = $items;
      $this->rewind();
      return $this;
    }
69298
public function setRevisions(array $revisions)
    {
        $this->revisions = new ArrayCollection();

        /** @var \Rcm\Entity\Revision $revision */
        foreach ($revisions as $revision) {
            if (!$revision instanceof Revision) {
                throw new InvalidArgumentException(
                    "Invalid Revision passed in.  Unable to set array"
                );
            }

            $this->revisions->set($revision->getRevisionId(), $revision);
        }
    }
829983
public function setRoutes(array $routes) {

	    foreach($routes as $route) {

	        if(!$route instanceof Route) {
	            throw new \InvalidArgumentException(sprintf("'%s' is not a Route instance.", $route));
            }

            $this->addRoute($route);

        }

    }
924112
public function setBans($bans)
    {
        foreach ($bans as $key => $dtoData) {
            $this->bans[$key] = new TeamBansDto($dtoData);
        }
    
        return $this;
    }
348161
public function setTable($table)
    {
        if (is_array($table)) {
            if (!isset($table['name'])) {
                throw new \InvalidArgumentException('A name key is required when passing an array to setTable()');
            }
            $this->table = $table['name'];
        } else {
            $this->table = $table;
        }
    }
543350
public function attachRoles($roles = [], $team = null)
    {
        foreach ($roles as $role) {
            $this->attachRole($role, $team);
        }

        return $this;
    }
1087395
function setMaxPointsTeam($max, $multicall = false)
    {
        if (!is_int($max)) {
            throw new InvalidArgumentException('max = ' . print_r($max, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($max), $multicall);
    }
784107
public function setMaxPlays($maxPlays)
    {
        if (is_int($maxPlays) && $maxPlays >= 0) {
            $this->maxPlays = $maxPlays;
        } else {
            $msg = "The 'maxPlays' argument must be a positive (>= 0) integer, '" . gettype($maxPlays) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
640928
public function setGroups($groups=null) {
		if(!is_array($groups) && $groups !== null)
			$groups = [$groups];
		$this->groups = $groups;
		return $this;
	}
1234745
public function emptyTeams(array $teams)
    {
        $this->om->startFlushSuite();

        foreach ($teams as $team) {
            $users = $team->getRole()->getUsers()->toArray();
            $this->unregisterUsersFromTeam($team, $users);
        }
        $this->om->endFlushSuite();
    }
1099522
public function setMinPlays($minPlays)
    {
        if (is_int($minPlays) === true && $minPlays >= 0) {
            $this->minPlays = $minPlays;
        } else {
            $msg = "The 'minPlays' argument must be a positive (>= 0) integer, '" . gettype($minPlays) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
295176
function addPlayerInTeam($login, $teamId)
	{
		switch($teamId)
		{
			case 0:
				if(array_search($login, $this->team2))
				{
					throw new \InvalidArgumentException();
				}
				if(!array_search($login, $this->team1))
				{
					$this->team1[] = $login;
				}
				break;
			case 1:
				if(array_search($login, $this->team1))
				{
					throw new \InvalidArgumentException();
				}
				if(!array_search($login, $this->team2))
				{
					$this->team2[] = $login;
				}
				break;
			default:
				throw new \InvalidArgumentException();
		}
	}
657639
public function addGroupings( $groupings )
	{
		if( !is_array( $groupings ) )
			throw new InvalidArgumentException( 'An Array should be given.' );
		foreach( $groupings as $grouping )
			$this->addGrouping( $grouping );
	}
982714
function getTeamInfo($team, $multicall = false)
    {
        if (!is_int($team) || $team < 0 || $team > 2) {
            throw new InvalidArgumentException('team = ' . print_r($team, true));
        }

        if ($multicall) {
            return $this->execute(ucfirst(__FUNCTION__), array($team), $this->structHandler('Team'));
        }
        return Structures\Team::fromArray($this->execute(ucfirst(__FUNCTION__), array($team)));
    }
971060
public function setGroupName($groupName)
    {
        $group = posix_getgrnam($groupName);
        if (! isset($group['gid'])) {
            throw new InvalidArgumentException(sprintf('"%s" is not a valid group name', $groupName));
        }

        $this->setGroupId($group['gid']);
    }
266230
protected function setOptions(array $options)
    {
        $this->options = [];

        foreach ($options as $option => $value) {

            if (!in_array($option, (array)$this->availableOptions)) {
                throw new \InvalidArgumentException(
                    sprintf('filter %s has no option "%s"', get_class($this), $option)
                );
            }

            $this->options[$option] = $value;
        }
    }