From b9ba019f36d4713c7c8ff6a2e296997977b91a6c Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Thu, 2 Jun 2022 13:54:56 +0200 Subject: [PATCH] Fix deprecation using Symfony 6.1 Overriding "$defaultName" is deprecated since Symfony 6.1 --- .../Command/Doctrine/DoctrineOrmLoadDataFixturesCommand.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Console/Command/Doctrine/DoctrineOrmLoadDataFixturesCommand.php b/src/Console/Command/Doctrine/DoctrineOrmLoadDataFixturesCommand.php index f4342fa..8ccc70b 100644 --- a/src/Console/Command/Doctrine/DoctrineOrmLoadDataFixturesCommand.php +++ b/src/Console/Command/Doctrine/DoctrineOrmLoadDataFixturesCommand.php @@ -21,6 +21,7 @@ use function sprintf; use Symfony\Bundle\FrameworkBundle\Console\Application as FrameworkBundleConsoleApplication; use Symfony\Component\Console\Application as ConsoleApplication; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; @@ -32,10 +33,9 @@ /** * Command used to load the fixtures. */ +#[AsCommand(name: 'hautelook:fixtures:load')] class DoctrineOrmLoadDataFixturesCommand extends Command { - protected static $defaultName = 'hautelook:fixtures:load'; - private ManagerRegistry $doctrine; private AliceBundleLoaderInterface $loader; @@ -53,7 +53,6 @@ public function __construct( protected function configure(): void { $this - ->setAliases([self::$defaultName]) ->setDescription('Load data fixtures to your database.') ->addOption( 'bundle',