Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d024c82

Browse files
committed
minor #23117 [EventDispatcher] Remove dead code in WrappedListener (chalasr)
This PR was merged into the 3.3 branch. Discussion ---------- [EventDispatcher] Remove dead code in WrappedListener | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a The static `$cloner` property is unused since ab716c6 Commits ------- 8b7de02 [EventDispatcher] Remove dead code in WrappedListener
2 parents e1bc7a8 + 8b7de02 commit d024c82

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\EventDispatcher\Event;
1616
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1717
use Symfony\Component\VarDumper\Caster\ClassStub;
18-
use Symfony\Component\VarDumper\Cloner\VarCloner;
1918

2019
/**
2120
* @author Fabien Potencier <[email protected]>
@@ -30,8 +29,7 @@ class WrappedListener
3029
private $dispatcher;
3130
private $pretty;
3231
private $stub;
33-
34-
private static $cloner;
32+
private static $hasClassStub;
3533

3634
public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
3735
{
@@ -58,8 +56,8 @@ public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatc
5856
$this->name = $name;
5957
}
6058

61-
if (null === self::$cloner) {
62-
self::$cloner = class_exists(ClassStub::class) ? new VarCloner() : false;
59+
if (null === self::$hasClassStub) {
60+
self::$hasClassStub = class_exists(ClassStub::class);
6361
}
6462
}
6563

@@ -86,7 +84,7 @@ public function getPretty()
8684
public function getInfo($eventName)
8785
{
8886
if (null === $this->stub) {
89-
$this->stub = false === self::$cloner ? $this->pretty.'()' : new ClassStub($this->pretty.'()', $this->listener);
87+
$this->stub = self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->listener) : $this->pretty.'()';
9088
}
9189

9290
return array(

0 commit comments

Comments
 (0)