public function add(GroupObject $object) : Group
    {
        if (count($this->objects) < 2)
        {
            $this->objects[] = $object;
        }
        else
        {
            throw new Exception(
                "An XORGroup may not contain more than two objects."
            );
        }

        return $this;
    }
public function add(GroupObject $object) : Group
    {
        if (count($this->objects) < 2)
        {
            $this->objects[] = $object;
        }
        else
        {
            throw new Exception(
                "An XORGroup may not contain more than two objects."
            );
        }

        return $this;
    }
public function add ( GroupObject $ object ) : Group { if ( count ( $ this -> objects ) < 2 ) { $ this -> objects [ ] = $ object ; } else { throw new Exception ( "An XORGroup may not contain more than two objects." ) ; } return $ this ; }
Add an object to the group

@param GroupObject &$object the object to add

@return Group return the current group instance
Add an object to the group