Version 1
[yaffs-website] / web / modules / contrib / devel / src / Plugin / Devel / Dumper / ChromePhp.php
1 <?php
2
3 namespace Drupal\devel\Plugin\Devel\Dumper;
4
5 use Drupal\devel\DevelDumperBase;
6
7 /**
8  * Provides a ChromePhp dumper plugin.
9  *
10  * @DevelDumper(
11  *   id = "chromephp",
12  *   label = @Translation("ChromePhp"),
13  *   description = @Translation("Wrapper for <a href='https://craig.is/writing/chrome-logger'>ChromePhp</a> debugging tool.")
14  * )
15  */
16 class ChromePhp extends DevelDumperBase {
17
18   /**
19    * {@inheritdoc}
20    */
21   public function dump($input, $name = NULL) {
22     \ChromePhp::log($input);
23   }
24
25   /**
26    * {@inheritdoc}
27    */
28   public function export($input, $name = NULL) {
29     $this->dump($input);
30     return $this->t('Dump was redirected to the console.');
31   }
32
33   /**
34    * {@inheritdoc}
35    */
36   public static function checkRequirements() {
37     return class_exists('ChromePhp', TRUE);
38   }
39
40 }