From 819734b9dd3a9fadbd8533ca29b0c08c78671a45 Mon Sep 17 00:00:00 2001 From: Piet Bosch Date: Fri, 11 Feb 2022 08:55:41 +0200 Subject: [PATCH] Fixed Symfony 6 doctrine:decrypt:database 'Cannot use object of type App\Entity\* as array' exception --- src/Command/DoctrineDecryptDatabaseCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/DoctrineDecryptDatabaseCommand.php b/src/Command/DoctrineDecryptDatabaseCommand.php index 52fd45dd..d9a004c3 100644 --- a/src/Command/DoctrineDecryptDatabaseCommand.php +++ b/src/Command/DoctrineDecryptDatabaseCommand.php @@ -99,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln(sprintf('Processing %s', $metaData->name)); $progressBar = new ProgressBar($output, $totalCount); foreach ($iterator as $row) { - $entity = $row[0]; + $entity = (is_array($row) ? $row[0] : $row); // Create reflectionClass for each entity $entityReflectionClass = new \ReflectionClass($entity);