src/Components/AbstractSegment.php
public function offsetSet($offset, $value)
    {
        $data = $this->data;
        if (is_null($offset)) {
            $data[] = $value;
            $this->set($data);

            return;
        }
        $offset = filter_var($offset, FILTER_VALIDATE_INT, array('min_range' => 0));
        if (false === $offset) {
            throw new InvalidArgumentException('Offset must be an integer');
        }
        $data[$offset] = $value;
        $this->set($data);
    }
public function offsetSet($offset, $value)
    {
        $data = $this->data;
        if (is_null($offset)) {
            $data[] = $value;
            $this->set($data);

            return;
        }
        $offset = filter_var($offset, FILTER_VALIDATE_INT, array('min_range' => 0));
        if (false === $offset) {
            throw new InvalidArgumentException('Offset must be an integer');
        }
        $data[$offset] = $value;
        $this->set($data);
    }
public function offsetSet ( $ offset , $ value ) { $ data = $ this -> data ; if ( is_null ( $ offset ) ) { $ data [ ] = $ value ; $ this -> set ( $ data ) ; return ; } $ offset = filter_var ( $ offset , FILTER_VALIDATE_INT , array ( 'min_range' => 0 ) ) ; if ( false === $ offset ) { throw new InvalidArgumentException ( 'Offset must be an integer' ) ; } $ data [ $ offset ] = $ value ; $ this -> set ( $ data ) ; }
ArrayAccess Interface method

@param int|string $offset
@param mixed      $value
ArrayAccess Interface method