chore: cleanup, add PHPStan type annotations
This commit is contained in:
@@ -200,6 +200,7 @@ class BpnXmlSyncCommand extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, int>
|
||||
* @throws FilesystemException
|
||||
*/
|
||||
private function syncFiles(SymfonyStyle $io): array
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Command;
|
||||
|
||||
use App\Repository\BookingEditDraftRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@@ -20,6 +21,7 @@ class DraftInspectCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
private readonly BookingEditDraftRepository $draftRepository,
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
@@ -102,11 +104,10 @@ class DraftInspectCommand extends Command
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
$em = $this->draftRepository->getEntityManager();
|
||||
foreach ($drafts as $draft) {
|
||||
$em->remove($draft);
|
||||
$this->entityManager->remove($draft);
|
||||
}
|
||||
$em->flush();
|
||||
$this->entityManager->flush();
|
||||
|
||||
$io->success(sprintf('Deleted %d draft(s).', \count($drafts)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user