vendor/ibexa/measurement/src/bundle/EventSubscriber/BuildSchemaSubscriber.php line 27

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\Bundle\Measurement\EventSubscriber;
  8. use Ibexa\Contracts\DoctrineSchema\Event\SchemaBuilderEvent;
  9. use Ibexa\Contracts\DoctrineSchema\SchemaBuilderEvents;
  10. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  11. /**
  12. * @internal
  13. */
  14. final class BuildSchemaSubscriber implements EventSubscriberInterface
  15. {
  16. public static function getSubscribedEvents(): array
  17. {
  18. return [
  19. SchemaBuilderEvents::BUILD_SCHEMA => ['onBuildSchema', 200],
  20. ];
  21. }
  22. public function onBuildSchema(SchemaBuilderEvent $event): void
  23. {
  24. $event->getSchemaBuilder()->importSchemaFromFile(__DIR__ . '/../../bundle/Resources/config/schema.yaml');
  25. }
  26. }