code: 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);
      }
docs: Ends content capturing and returns the captured content.
  
  @throws \RuntimeException if there's no capturing process running
  @return string
  @uses render()