mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-09-19 18:16:13 +02:00

[TASK] use assert to state data restrictions

Related #1120
This commit is contained in:
Karsten Nowak 2024-07-30 11:24:13 +02:00
parent 153c79b053
commit 1262cfbb7b

View file

@ -53,10 +53,10 @@ final class CreateTestDataCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output): int
{
/** @var int $pageUid */
$pageUid = $input->getArgument('pageUid') ?? 0;
/** @var bool $deleteDataBefore */
$pageUid = (int)$input->getArgument('pageUid') ?? 0;
\assert(\is_int($pageUid));
$deleteDataBefore = $input->getOption('delete-data-before') ?? false;
\assert(\is_bool($deleteDataBefore));
$table = 'tx_tea_domain_model_tea';
$connectionForTable = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($table);