DoctrineDebug.php in Devel 8
File
src/Plugin/Devel/Dumper/DoctrineDebug.php
View source
<?php
namespace Drupal\devel\Plugin\Devel\Dumper;
use Doctrine\Common\Util\Debug;
use Drupal\Component\Utility\Xss;
use Drupal\devel\DevelDumperBase;
class DoctrineDebug extends DevelDumperBase {
public function export($input, $name = NULL) {
$name = $name ? $name . ' => ' : '';
$variable = Debug::export($input, 6);
ob_start();
print_r($variable);
$dump = ob_get_contents();
ob_end_clean();
$dump = Xss::filterAdmin($dump);
$dump = '<pre>' . $name . $dump . '</pre>';
return $this
->setSafeMarkup($dump);
}
public function exportAsRenderable($input, $name = NULL) {
$output['container'] = [
'#type' => 'details',
'#title' => $name ?: $this
->t('Variable'),
'#attached' => [
'library' => [
'devel/devel',
],
],
'#attributes' => [
'class' => [
'container-inline',
'devel-dumper',
'devel-selectable',
],
],
'export' => [
'#markup' => $this
->export($input),
],
];
return $output;
}
public static function checkRequirements() {
return TRUE;
}
}