X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/059e66ae24b995fc9071e287647e20c007fc92f8..9b650f902e0941b0cae842af67f62801ec3ed32a:/Command/CalendarCommand.php

diff --git a/Command/CalendarCommand.php b/Command/CalendarCommand.php
index 2488f51..5e25c77 100644
--- a/Command/CalendarCommand.php
+++ b/Command/CalendarCommand.php
@@ -1,10 +1,18 @@
-<?php
+<?php declare(strict_types=1);
+
+/*
+ * This file is part of the Rapsys AirBundle package.
+ *
+ * (c) Raphaël Gertz <symfony@rapsys.eu>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
 
 namespace Rapsys\AirBundle\Command;
 
 use Doctrine\Persistence\ManagerRegistry;
 use Symfony\Component\Cache\Adapter\FilesystemAdapter;
-use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -13,45 +21,12 @@ use Symfony\Component\Routing\RouterInterface;
 use Symfony\Contracts\Translation\TranslatorInterface;
 use Twig\Extra\Markdown\DefaultMarkdown;
 
+use Rapsys\AirBundle\Command;
 use Rapsys\AirBundle\Entity\Session;
 
 use Rapsys\PackBundle\Util\SluggerUtil;
 
 class CalendarCommand extends Command {
-	//Set failure constant
-	const FAILURE = 1;
-
-	///Set success constant
-	const SUCCESS = 0;
-
-	/**
-	 * Doctrine instance
-	 *
-	 * @var ManagerRegistry
-	 */
-	protected ManagerRegistry $doctrine;
-
-	///Router
-	protected RouterInterface $router;
-
-	///Slugger
-	protected SluggerUtil $slugger;
-
-	///Translator instance
-	protected TranslatorInterface $translator;
-
-	///Locale
-	protected $locale;
-
-	///Lifetime string
-	protected $lifetime;
-
-	///Namespace string
-	protected $namespace;
-
-	///Path string
-	protected $path;
-
 	/**
 	 * Creates new calendar command
 	 *
@@ -64,39 +39,9 @@ class CalendarCommand extends Command {
 	 * @param string $path The cache path
 	 * @param string $locale The default locale
 	 */
-	public function __construct(ManagerRegistry $doctrine, RouterInterface $router, SluggerUtil $slugger, TranslatorInterface $translator, string $namespace, int $lifetime, string $path, string $locale) {
+	public function __construct(protected ManagerRegistry $doctrine, protected RouterInterface $router, protected SluggerUtil $slugger, protected TranslatorInterface $translator, protected string $namespace, protected int $lifetime, protected string $path, protected string $locale) {
 		//Call parent constructor
-		parent::__construct();
-
-		//Store doctrine
-		$this->doctrine = $doctrine;
-
-		//Set lifetime
-		$this->lifetime = $lifetime;
-
-		//Set namespace
-		$this->namespace = $namespace;
-
-		//Set path
-		$this->path = $path;
-
-		//Store router
-		$this->router = $router;
-
-		//Retrieve slugger
-		$this->slugger = $slugger;
-
-		//Get router context
-		$context = $this->router->getContext();
-
-		//Set host
-		$context->setHost('airlibre.eu');
-
-		//Set scheme
-		$context->setScheme('https');
-
-		//Set the translator
-		$this->translator = $translator;
+		parent::__construct($this->doctrine, $this->router, $this->slugger, $this->translator, $this->locale);
 	}
 
 	///Configure attribute command