vendor/symfony/webpack-encore-bundle/src/EventListener/ResetAssetsEventListener.php line 36

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of the Symfony WebpackEncoreBundle package.
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  * For the full copyright and license information, please view the LICENSE
  7.  * file that was distributed with this source code.
  8.  */
  9. namespace Symfony\WebpackEncoreBundle\EventListener;
  10. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  11. use Symfony\Component\HttpKernel\KernelEvents;
  12. use Symfony\WebpackEncoreBundle\Asset\EntrypointLookupCollection;
  13. class ResetAssetsEventListener implements EventSubscriberInterface
  14. {
  15.     private $entrypointLookupCollection;
  16.     private $buildNames;
  17.     public function __construct(EntrypointLookupCollection $entrypointLookupCollection, array $buildNames)
  18.     {
  19.         $this->entrypointLookupCollection $entrypointLookupCollection;
  20.         $this->buildNames $buildNames;
  21.     }
  22.     public static function getSubscribedEvents()
  23.     {
  24.         return [
  25.             KernelEvents::FINISH_REQUEST => 'resetAssets',
  26.         ];
  27.     }
  28.     public function resetAssets()
  29.     {
  30.         foreach ($this->buildNames as $name) {
  31.             $this->entrypointLookupCollection->getEntrypointLookup($name)->reset();
  32.         }
  33.     }
  34. }