1 <?php 
declare(strict_types
=1); 
   4  * This file is part of the Rapsys AirBundle package. 
   6  * (c) Raphaël Gertz <symfony@rapsys.eu> 
   8  * For the full copyright and license information, please view the LICENSE 
   9  * file that was distributed with this source code. 
  12 namespace Rapsys\AirBundle\Command
; 
  14 use Doctrine\Persistence\ManagerRegistry
; 
  15 use Symfony\Component\Console\Command\Command 
as BaseCommand
; 
  16 use Symfony\Component\Routing\RouterInterface
; 
  17 use Symfony\Contracts\Translation\TranslatorInterface
; 
  19 use Rapsys\AirBundle\RapsysAirBundle
; 
  21 use Rapsys\PackBundle\Util\SluggerUtil
; 
  23 class Command 
extends BaseCommand 
{ 
  27          * @var ManagerRegistry 
  29         protected ManagerRegistry 
$doctrine; 
  34          * @var RouterInterface 
  36         protected RouterInterface 
$router; 
  43         protected SluggerUtil 
$slugger; 
  48          * @var TranslatorInterface 
  50         protected TranslatorInterface 
$translator; 
  57         protected string $locale; 
  62          * @param ManagerRegistry $doctrine The doctrine instance 
  63          * @param RouterInterface $router The router instance 
  64          * @param SluggerUtil $slugger The slugger instance 
  65          * @param TranslatorInterface $translator The translator instance 
  66          * @param string $locale The default locale 
  68         public function __construct(ManagerRegistry 
$doctrine, RouterInterface 
$router, SluggerUtil 
$slugger, TranslatorInterface 
$translator, string $locale) { 
  69                 //Call parent constructor 
  70                 parent
::__construct(); 
  73                 $this->doctrine 
= $doctrine; 
  76                 $this->router 
= $router; 
  79                 $this->slugger 
= $slugger; 
  82                 $context = $this->router
->getContext(); 
  85                 $context->setHost('airlibre.eu'); 
  88                 $context->setScheme('https'); 
  91                 $this->translator 
= $translator; 
  94                 $this->locale 
= $locale; 
  97                 //TODO: XXX: see how to make it works 
  98                 /*if (isset(self::$defaultName)) { 
  99                         $this->name = self::$defaultName; 
 102                 //With default description 
 103                 if (isset(self::$defaultDescription)) { 
 104                         $this->name = self::$defaultDescription; 
 109          * Return the bundle alias 
 113         public function getAlias(): string { 
 114                 return RapsysAirBundle
::getAlias();