public function setLength($length)
    {
        if (intval($length) < 0) {
            throw new \LengthException(sprintf('Invalid length: %d', $length));
        }

        $this->length = intval($length);

        return $this;
    }