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
;
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 * @param ManagerRegistry $doctrine The doctrine instance
28 * @param RouterInterface $router The router instance
29 * @param SluggerUtil $slugger The slugger instance
30 * @param TranslatorInterface $translator The translator instance
31 * @param string $locale The default locale
33 public function __construct(protected ManagerRegistry
$doctrine, protected RouterInterface
$router, protected SluggerUtil
$slugger, protected TranslatorInterface
$translator, protected string $locale) {
34 //Call parent constructor
35 parent
::__construct();
38 $context = $this->router
->getContext();
41 //TODO: set it in env RAPSYSAIR_HOST ?
42 $context->setHost('airlibre.eu');
45 //TODO: set it in env RAPSYSAIR_SCHEME ?
46 $context->setScheme('https');
49 //TODO: XXX: see how to make it works
50 /*if (isset(self::$defaultName)) {
51 $this->name = self::$defaultName;
54 //With default description
55 if (isset(self::$defaultDescription)) {
56 $this->name = self::$defaultDescription;
61 * Return the bundle alias
65 public function getAlias(): string {
66 return RapsysAirBundle
::getAlias();