PhpCss\Ast\Selector\Group::offsetSet PHP Method

offsetSet() public method

Set/Add and sequence at the given position or top the end
See also: ArrayAccess::offsetSet()
public offsetSet ( integer | null $offset, Sequence $sequence )
$offset integer | null
$sequence Sequence
    public function offsetSet($offset, $sequence)
    {
        if (!$sequence instanceof Sequence) {
            throw new \InvalidArgumentException(sprintf('$sequence is not an instance of %s but %s.', Sequence::CLASS, is_object($sequence) ? get_class($sequence) : gettype($sequence)));
        }
        if (is_null($offset)) {
            $this->_sequences[] = $sequence;
        } else {
            $this->_sequences[(int) $offset] = $sequence;
            $this->_sequences = array_values($this->_sequences);
        }
    }