vendor/ibexa/admin-ui/src/lib/UniversalDiscovery/Event/Subscriber/AddLocation.php line 23

Open in your IDE?
  1. <?php
  2. /**
  3.  * @copyright Copyright (C) Ibexa AS. All rights reserved.
  4.  * @license For full copyright and license information view LICENSE file distributed with this source code.
  5.  */
  6. declare(strict_types=1);
  7. namespace Ibexa\AdminUi\UniversalDiscovery\Event\Subscriber;
  8. use Ibexa\AdminUi\UniversalDiscovery\Event\ConfigResolveEvent;
  9. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  10. final class AddLocation implements EventSubscriberInterface
  11. {
  12.     public static function getSubscribedEvents(): array
  13.     {
  14.         return [
  15.             ConfigResolveEvent::NAME => ['onUdwConfigResolve', -10],
  16.         ];
  17.     }
  18.     public function onUdwConfigResolve(ConfigResolveEvent $event): void
  19.     {
  20.         if ($event->getConfigName() !== 'add_location') {
  21.             return;
  22.         }
  23.         $config $event->getConfig();
  24.         $config['allowed_content_types'] = null;
  25.         $event->setConfig($config);
  26.     }
  27. }
  28. class_alias(AddLocation::class, 'EzSystems\EzPlatformAdminUi\UniversalDiscovery\Event\Subscriber\AddLocation');