From eaaf54db6b52ccdd4dc2b73d080eb0b5ce48e468 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Rapha=C3=ABl=20Gertz?= <git@rapsys.eu>
Date: Wed, 9 Dec 2020 21:39:45 +0100
Subject: [PATCH] Remove translator dependency

---
 Form/SessionEditType.php                  | 8 ++------
 Resources/config/packages/rapsys_air.yaml | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/Form/SessionEditType.php b/Form/SessionEditType.php
index 24a1544..f5b7317 100644
--- a/Form/SessionEditType.php
+++ b/Form/SessionEditType.php
@@ -19,15 +19,11 @@ class SessionEditType extends AbstractType {
 	//Doctrine instance
 	private $doctrine;
 
-	//Translator instance
-	protected $translator;
-
 	/**
 	 * {@inheritdoc}
 	 */
-	public function __construct(RegistryInterface $doctrine, TranslatorInterface $translator) {
+	public function __construct(RegistryInterface $doctrine) {
 		$this->doctrine = $doctrine;
-		$this->translator = $translator;
 	}
 
 	/**
@@ -61,7 +57,7 @@ class SessionEditType extends AbstractType {
 		//Is admin or senior owner
 		if (!empty($options['move'])) {
 			//Load locations
-			$locations = $this->doctrine->getRepository(Location::class)->findComplementBySessionId($this->translator, $options['session']);
+			$locations = $this->doctrine->getRepository(Location::class)->findComplementBySessionId($options['session']);
 			$builder
 				//TODO: class senior en orange ???
 				->add('location', ChoiceType::class, ['attr' => ['placeholder' => 'Your location'], 'constraints' => [new NotBlank(['message' => 'Please provide your location'])], 'choices' => $locations, 'choice_translation_domain' => true])
diff --git a/Resources/config/packages/rapsys_air.yaml b/Resources/config/packages/rapsys_air.yaml
index b567611..49658f5 100644
--- a/Resources/config/packages/rapsys_air.yaml
+++ b/Resources/config/packages/rapsys_air.yaml
@@ -272,7 +272,7 @@ services:
         arguments: [ '@doctrine', '@translator' ]
         tags: [ 'form.type' ]
     Rapsys\AirBundle\Form\SessionEditType:
-        arguments: [ '@doctrine', '@translator' ]
+        arguments: [ '@doctrine' ]
         tags: [ 'form.type' ]
     Rapsys\AirBundle\Command\AttributeCommand:
         arguments: [ '@doctrine' ]
-- 
2.41.3