Skip to content

Commit 91e7089

Browse files
committed
Changed treatFields returned type
1 parent 83555ea commit 91e7089

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Command/Markdown/Generator.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
3939
$helper = $this->getHelper('question');
4040
$io = new SymfonyStyle($input, $output);
4141

42-
if ($data = $this->treatFields($input, $output)) {
42+
$data = $this->treatFields($input, $output);
4343

44+
if (is_array($data)) {
4445
if ($this->finalConfirmation($helper, $input, $output)) {
4546
$path = $helper->ask($input, $output, $this->promptDestinationFile());
4647
$path = is_string($path) && strlen($path) > 2 ? realpath($path) : ROOT_DIR . '/tmp';
@@ -70,7 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7071
return Command::FAILURE;
7172
}
7273

73-
private function treatFields(InputInterface $input, OutputInterface $output): ?array
74+
private function treatFields(InputInterface $input, OutputInterface $output): array|int
7475
{
7576
$helper = $this->getHelper('question');
7677
$io = new SymfonyStyle($input, $output);
@@ -91,9 +92,9 @@ private function treatFields(InputInterface $input, OutputInterface $output): ?a
9192
'license' => $license
9293
];
9394
} catch (EmptyFieldException $e) {
94-
$io->error($e->getMessage());
95+
$io->warning($e->getMessage());
9596

96-
return null;
97+
return Command::INVALID;;
9798
}
9899
}
99100

0 commit comments

Comments
 (0)