feat: Remove count parameter
This commit is contained in:
parent
5469ce7fec
commit
c7c1070f74
|
@ -8,7 +8,6 @@ use App\Service\AnkiService;
|
||||||
|
|
||||||
use Symfony\Component\Console\Attribute\AsCommand;
|
use Symfony\Component\Console\Attribute\AsCommand;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
|
@ -23,11 +22,11 @@ class CreateKoreanProductionCommand extends Command
|
||||||
|
|
||||||
protected function configure(): void
|
protected function configure(): void
|
||||||
{
|
{
|
||||||
$this->addArgument(
|
//$this->addArgument(
|
||||||
'count',
|
// 'count',
|
||||||
InputArgument::REQUIRED,
|
// InputArgument::REQUIRED,
|
||||||
'Amount of cards to make',
|
// 'Amount of cards to make',
|
||||||
);
|
//);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
|
@ -40,7 +39,8 @@ class CreateKoreanProductionCommand extends Command
|
||||||
$existentTerms[$productionNote->getTerm()->getKanji()] = null;
|
$existentTerms[$productionNote->getTerm()->getKanji()] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$newNotesCount = intval($input->getArgument('count'));
|
//$newNotesCount = intval($input->getArgument('count'));
|
||||||
|
|
||||||
$newProductionNotes = [];
|
$newProductionNotes = [];
|
||||||
foreach ($ksns as $sentenceNote) {
|
foreach ($ksns as $sentenceNote) {
|
||||||
foreach ($sentenceNote->getTerms() as $term) {
|
foreach ($sentenceNote->getTerms() as $term) {
|
||||||
|
@ -50,7 +50,7 @@ class CreateKoreanProductionCommand extends Command
|
||||||
|
|
||||||
$existentTerms[$term->getKanji()] = null;
|
$existentTerms[$term->getKanji()] = null;
|
||||||
$newProductionNotes[] = KoreanProductionNote::fromNote($sentenceNote, $term);
|
$newProductionNotes[] = KoreanProductionNote::fromNote($sentenceNote, $term);
|
||||||
if (count($newProductionNotes) >= $newNotesCount) break 2;
|
//if (count($newProductionNotes) >= $newNotesCount) break 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,6 @@ class CreateProductionCommand extends Command
|
||||||
$sNote = $this->ankiService->getNote($noteIds[array_key_last($noteIds)]);
|
$sNote = $this->ankiService->getNote($noteIds[array_key_last($noteIds)]);
|
||||||
|
|
||||||
$newSlNote = SentenceListeningNote::fromNote($sNote, $term);
|
$newSlNote = SentenceListeningNote::fromNote($sNote, $term);
|
||||||
dd($newSlNote);
|
|
||||||
if (!$this->ankiService->addNote($newSlNote)) {
|
if (!$this->ankiService->addNote($newSlNote)) {
|
||||||
throw new \Exception('Failed to add note!');
|
throw new \Exception('Failed to add note!');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue