src/Widop/Twitter/Options/OptionBag.php
public function register($option, $type = OptionInterface::TYPE_GET)
    {
        if (is_string($option)) {
            $option = $this->factory->create($option, $type);
        }

        if (!$option instanceof OptionInterface) {
            throw new \InvalidArgumentException(
                'The option should be either a string or a "Widop\Twitter\Options\OptionInterface".'
            );
        }

        $this->options[$option->getName()] = $option;

        return $this;
    }
public function register($option, $type = OptionInterface::TYPE_GET)
    {
        if (is_string($option)) {
            $option = $this->factory->create($option, $type);
        }

        if (!$option instanceof OptionInterface) {
            throw new \InvalidArgumentException(
                'The option should be either a string or a "Widop\Twitter\Options\OptionInterface".'
            );
        }

        $this->options[$option->getName()] = $option;

        return $this;
    }
Registers an option.

@param string|\Widop\Twitter\Options\OptionInterface $option The option.
@param string                                        $type   The option type.

@throws \InvalidArgumentException If the option is not valid.

@return \Widop\Twitter\Options\OptionBag The option bag.