From 7314a6dcb9b7cf7ec0c0bdc865514a32a0707118 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Tue, 27 Feb 2024 16:32:22 +0100 Subject: [PATCH] Inject container and hasher Cleanup --- DataFixtures/AirFixtures.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/DataFixtures/AirFixtures.php b/DataFixtures/AirFixtures.php index 7b3e3a3..18fda1b 100644 --- a/DataFixtures/AirFixtures.php +++ b/DataFixtures/AirFixtures.php @@ -4,7 +4,6 @@ namespace Rapsys\AirBundle\DataFixtures; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Persistence\ObjectManager; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; @@ -14,20 +13,11 @@ use Rapsys\AirBundle\Entity\User; use Rapsys\AirBundle\Entity\Location; use Rapsys\AirBundle\Entity\Slot; -class AirFixtures extends Fixture implements ContainerAwareInterface { +class AirFixtures extends Fixture { /** - * @var ContainerInterface + * Air fixtures constructor */ - private $container; - - /** - * @var UserPasswordHasherInterface - */ - private $hasher; - - public function setContainer(ContainerInterface $container = null) { - $this->container = $container; - $this->hasher = $this->container->get('security.password_hasher_factory'); + public function __construct(protected ContainerInterface $container, protected UserPasswordHasherInterface $hasher) { } /** -- 2.41.0