public function setMode($mode)
    {
        if (!in_array($mode, $this->acceptedModes)) {
            throw new \InvalidArgumentException(sprintf('Invalid mode: [%s]', $mode));
        }

        $this->mode = $mode;
    }