public function setInputLayout($layout)
    {
        if ($layout === null) {
            $this->inputLayout = null;

            return $this;
        }

        if (!is_string($layout)) {
            throw new InvalidArgumentException(sprintf(
                'Layout must be a string, received %s',
                (is_object($layout) ? get_class($layout) : gettype($layout))
            ));
        }

        $supportedLayouts = $this->supportedInputLayouts();
        if (!in_array($layout, $supportedLayouts)) {
            throw new OutOfBoundsException(sprintf(
                'Unsupported layout [%s]; must be one of %s',
                $layout,
                implode(', ', $supportedLayouts)
            ));
        }

        $this->inputLayout = $layout;

        return $this;
    }