3 namespace Drupal\devel\Plugin\Devel\Dumper;
5 use Doctrine\Common\Util\Debug;
6 use Drupal\Component\Utility\Xss;
7 use Drupal\devel\DevelDumperBase;
10 * Provides a DoctrineDebug dumper plugin.
14 * label = @Translation("Default"),
15 * description = @Translation("Wrapper for <a href='http://www.doctrine-project.org/api/common/2.3/class-Doctrine.Common.Util.Debug.html'>Doctrine</a> debugging tool.")
18 class DoctrineDebug extends DevelDumperBase {
23 public function export($input, $name = NULL) {
24 $name = $name ? $name . ' => ' : '';
25 $variable = Debug::export($input, 6);
29 $dump = ob_get_contents();
32 // Run Xss::filterAdmin on the resulting string to prevent
33 // cross-site-scripting (XSS) vulnerabilities.
34 $dump = Xss::filterAdmin($dump);
36 $dump = '<pre>' . $name . $dump . '</pre>';
38 return $this->setSafeMarkup($dump);
44 public function exportAsRenderable($input, $name = NULL) {
45 $output['container'] = [
47 '#title' => $name ? : $this->t('Variable'),
49 'library' => ['devel/devel']
52 'class' => ['container-inline', 'devel-dumper', 'devel-selectable'],
55 '#markup' => $this->export($input),
65 public static function checkRequirements() {