[SecurityBundle] Drop duplicated code
This commit is contained in:
parent
8e0f0cc990
commit
ffbf31d8c6
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Bundle\SecurityBundle\Debug;
|
||||
|
||||
use Symfony\Component\Security\Http\Firewall\LegacyListenerTrait;
|
||||
use Symfony\Component\VarDumper\Caster\ClassStub;
|
||||
|
||||
/**
|
||||
* @author Robin Chalas <robin.chalas@gmail.com>
|
||||
@ -39,4 +40,13 @@ trait TraceableListenerTrait
|
||||
{
|
||||
return $this->listener;
|
||||
}
|
||||
|
||||
public function getInfo(): array
|
||||
{
|
||||
return [
|
||||
'response' => $this->response,
|
||||
'time' => $this->time,
|
||||
'stub' => $this->stub ?? $this->stub = ClassStub::wrapCallable($this->listener),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||
use Symfony\Component\Security\Core\Exception\LazyResponseException;
|
||||
use Symfony\Component\Security\Http\Firewall\AbstractListener;
|
||||
use Symfony\Component\Security\Http\Firewall\ListenerInterface;
|
||||
use Symfony\Component\VarDumper\Caster\ClassStub;
|
||||
|
||||
/**
|
||||
* Wraps a lazy security listener.
|
||||
@ -60,13 +59,4 @@ final class WrappedLazyListener extends AbstractListener implements ListenerInte
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function getInfo(): array
|
||||
{
|
||||
return [
|
||||
'response' => $this->response,
|
||||
'time' => $this->time,
|
||||
'stub' => $this->stub ?? $this->stub = ClassStub::wrapCallable($this->listener),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ namespace Symfony\Bundle\SecurityBundle\Debug;
|
||||
|
||||
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||
use Symfony\Component\Security\Http\Firewall\ListenerInterface;
|
||||
use Symfony\Component\VarDumper\Caster\ClassStub;
|
||||
|
||||
/**
|
||||
* Wraps a security listener for calls record.
|
||||
@ -49,13 +48,4 @@ final class WrappedListener implements ListenerInterface
|
||||
$this->time = microtime(true) - $startTime;
|
||||
$this->response = $event->getResponse();
|
||||
}
|
||||
|
||||
public function getInfo(): array
|
||||
{
|
||||
return [
|
||||
'response' => $this->response,
|
||||
'time' => $this->time,
|
||||
'stub' => $this->stub ?? $this->stub = ClassStub::wrapCallable($this->listener),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user