src/Kernel.php line 18

Open in your IDE?
  1. <?php
  2. namespace PaperKite;
  3. use Csoft\AutoInvoker\AutoInvokeRule\AutoRegisterRule;
  4. use Lightbulb\Symfony\Loader\AutoInvokerFactory;
  5. use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
  6. use Symfony\Component\HttpKernel\Kernel as BaseKernel;
  7. class Kernel extends BaseKernel
  8. {
  9.     use MicroKernelTrait;
  10.     public function __construct(string $environmentbool $debug)
  11.     {
  12.         parent::__construct($environment$debug);
  13.         $this->initializeAutoInvoker($environment);
  14.     }
  15.     protected function initializeAutoInvoker(string $environment): void
  16.     {
  17.         $autoInvoker AutoInvokerFactory::getInstance(
  18.             in_array($environment, ['dev''staging''stagingv2']) ? 'dev' $environment,
  19.             __DIR__ '/../var/cache'
  20.         );
  21.         $autoInvoker->addInvokeRule(new AutoRegisterRule([__DIR__ '/../src']));
  22.         $autoInvoker->invoke();
  23.     }
  24. }