public function end()
    {
        if (!$this->captureLock) {
            throw new \RuntimeException('Cannot end capture, there is no capture running.');
        }

        $type                 = $this->captureType;
        $content              = ob_get_clean();
        $options              = $this->captureOptions;
        $this->captureLock    = false;
        $this->captureType    = null;
        $this->captureOptions = null;

        return $this->render($type, $content, $options);
    }