vendor/symfony/security-bundle/Debug/WrappedListener.php line 32

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Bundle\SecurityBundle\Debug;
  11. use Symfony\Component\HttpKernel\Event\RequestEvent;
  12. /**
  13.  * Wraps a security listener for calls record.
  14.  *
  15.  * @author Robin Chalas <robin.chalas@gmail.com>
  16.  *
  17.  * @internal
  18.  */
  19. final class WrappedListener
  20. {
  21.     use TraceableListenerTrait;
  22.     public function __construct(callable $listener)
  23.     {
  24.         $this->listener $listener;
  25.     }
  26.     public function __invoke(RequestEvent $event)
  27.     {
  28.         $startTime microtime(true);
  29.         ($this->listener)($event);
  30.         $this->time microtime(true) - $startTime;
  31.         $this->response $event->getResponse();
  32.     }
  33. }