src/Component/GenerateFeed/EventSubscriber/CleanupFeedSubscriber.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Component\GenerateFeed\EventSubscriber;
  4. use App\Component\GenerateFeed\Event\PreWriteFeedFile;
  5. use App\Util\StringUtil;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. class CleanupFeedSubscriber implements EventSubscriberInterface
  8. {
  9.     public static function getSubscribedEvents(): array
  10.     {
  11.         return [
  12.             PreWriteFeedFile::class => ['removeUnicode'],
  13.         ];
  14.     }
  15.     public function removeUnicode(PreWriteFeedFile $event): void
  16.     {
  17.         $event->setParsedContents(StringUtil::removeNonPrintableCharacters($event->getParsedContents()));
  18.     }
  19. }