vendor/nijens/openapi-bundle/src/NijensOpenapiBundle.php line 25

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the OpenapiBundle package.
  4.  *
  5.  * (c) Niels Nijens <nijens.niels@gmail.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Nijens\OpenapiBundle;
  11. use Symfony\Component\Config\Loader\LoaderInterface;
  12. use Symfony\Component\DependencyInjection\ContainerBuilder;
  13. use Symfony\Component\HttpKernel\Bundle\Bundle;
  14. use Symfony\Component\HttpKernel\Kernel;
  15. use Symfony\Component\Serializer\DependencyInjection\SerializerPass;
  16. /**
  17.  * OpenapiBundle.
  18.  *
  19.  * @author Niels Nijens <nijens.niels@gmail.com>
  20.  */
  21. class NijensOpenapiBundle extends Bundle
  22. {
  23.     public function build(ContainerBuilder $container): void
  24.     {
  25.         parent::build($container);
  26.         $container->addCompilerPass(
  27.             new SerializerPass('nijens_openapi.serializer''nijens_openapi.serializer.normalizer')
  28.         );
  29.     }
  30.     public static function getSymfonyVersion(): int
  31.     {
  32.         $kernel = new class('symfony_version'false) extends Kernel {
  33.             public function registerBundles(): iterable
  34.             {
  35.                 return [];
  36.             }
  37.             public function registerContainerConfiguration(LoaderInterface $loader): void
  38.             {
  39.             }
  40.         };
  41.         return $kernel::VERSION_ID;
  42.     }
  43. }