vendor/shopware/platform/src/Core/Profiling/Checkout/SalesChannelContextServiceProfiler.php line 28

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Profiling\Checkout;
  3. use Shopware\Core\System\SalesChannel\Context\SalesChannelContextServiceInterface;
  4. use Shopware\Core\System\SalesChannel\Context\SalesChannelContextServiceParameters;
  5. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  6. use Symfony\Component\Stopwatch\Stopwatch;
  7. class SalesChannelContextServiceProfiler implements SalesChannelContextServiceInterface
  8. {
  9.     /**
  10.      * @var SalesChannelContextServiceInterface
  11.      */
  12.     private $decorated;
  13.     /**
  14.      * @var Stopwatch
  15.      */
  16.     private $stopwatch;
  17.     public function __construct(SalesChannelContextServiceInterface $decoratedStopwatch $stopwatch)
  18.     {
  19.         $this->decorated $decorated;
  20.         $this->stopwatch $stopwatch;
  21.     }
  22.     public function get(SalesChannelContextServiceParameters $parameters): SalesChannelContext
  23.     {
  24.         $this->stopwatch->start('context-generation');
  25.         $context $this->decorated->get($parameters);
  26.         $this->stopwatch->stop('context-generation');
  27.         return $context;
  28.     }
  29. }