class DumpListener in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/EventListener/DumpListener.php \Symfony\Component\HttpKernel\EventListener\DumpListener
Configures dump() handler.
@author Nicolas Grekas <p@tchwork.com>
Hierarchy
- class \Symfony\Component\HttpKernel\EventListener\DumpListener implements EventSubscriberInterface
Expanded class hierarchy of DumpListener
1 file declares its use of DumpListener
- DumpListenerTest.php in vendor/
symfony/ http-kernel/ Tests/ EventListener/ DumpListenerTest.php
File
- vendor/
symfony/ http-kernel/ EventListener/ DumpListener.php, line 25
Namespace
Symfony\Component\HttpKernel\EventListenerView source
class DumpListener implements EventSubscriberInterface {
private $cloner;
private $dumper;
/**
* @param ClonerInterface $cloner Cloner service.
* @param DataDumperInterface $dumper Dumper service.
*/
public function __construct(ClonerInterface $cloner, DataDumperInterface $dumper) {
$this->cloner = $cloner;
$this->dumper = $dumper;
}
public function configure() {
$cloner = $this->cloner;
$dumper = $this->dumper;
VarDumper::setHandler(function ($var) use ($cloner, $dumper) {
$dumper
->dump($cloner
->cloneVar($var));
});
}
public static function getSubscribedEvents() {
// Register early to have a working dump() as early as possible
return array(
KernelEvents::REQUEST => array(
'configure',
1024,
),
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DumpListener:: |
private | property | ||
DumpListener:: |
private | property | ||
DumpListener:: |
public | function | ||
DumpListener:: |
public static | function |
Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface:: |
|
DumpListener:: |
public | function |