use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\VarDumper\Caster\ClassStub;
-use Symfony\Component\VarDumper\Cloner\VarCloner;
/**
* @author Fabien Potencier <fabien@symfony.com>
private $stopwatch;
private $dispatcher;
private $pretty;
- private $data;
-
- private static $cloner;
+ private $stub;
+ private static $hasClassStub;
public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
{
$this->name = $name;
}
- if (null === self::$cloner) {
- self::$cloner = class_exists(ClassStub::class) ? new VarCloner() : false;
+ if (null === self::$hasClassStub) {
+ self::$hasClassStub = class_exists(ClassStub::class);
}
}
public function getInfo($eventName)
{
- if (null === $this->data) {
- $this->data = false !== self::$cloner ? self::$cloner->cloneVar(array(new ClassStub($this->pretty.'()', $this->listener)))->seek(0) : $this->pretty;
+ if (null === $this->stub) {
+ $this->stub = self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->listener) : $this->pretty.'()';
}
return array(
'event' => $eventName,
'priority' => null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null,
'pretty' => $this->pretty,
- 'data' => $this->data,
+ 'stub' => $this->stub,
);
}