vendor/theofidry/psysh-bundle/src/PsyshBundle.php line 25

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the PsyshBundle package.
  4.  *
  5.  * (c) Théo FIDRY <theo.fidry@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 Fidry\PsyshBundle;
  11. use Fidry\PsyshBundle\DependencyInjection\Compiler\AddPsyshCommandPass;
  12. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  13. use Symfony\Component\DependencyInjection\ContainerBuilder;
  14. use Symfony\Component\HttpKernel\Bundle\Bundle;
  15. /**
  16.  * @author Adrian PALMER <navitronic@gmail.com>
  17.  * @author Théo FIDRY    <theo.fidry@gmail.com>
  18.  *
  19.  * @private
  20.  */
  21. final class PsyshBundle extends Bundle
  22. {
  23.     public function boot(): void
  24.     {
  25.         parent::boot();
  26.         $this->container->get('psysh.facade');
  27.     }
  28.     public function build(ContainerBuilder $container): void
  29.     {
  30.         parent::build($container);
  31.         // Ensures that AddPsyshCommandPass runs before AddConsoleCommandPass to avoid
  32.         // autoconfiguration conflicts.
  33.         $container->addCompilerPass(
  34.             new AddPsyshCommandPass(),
  35.             PassConfig::TYPE_BEFORE_OPTIMIZATION,
  36.             10,
  37.         );
  38.     }
  39. }