Several 'framework' fixes

This commit is contained in:
2021-12-06 23:39:16 +01:00
parent c1d5089d0a
commit 17b0d7098c
7 changed files with 13 additions and 8 deletions

View File

@ -17,13 +17,13 @@ abstract class AbstractCommand extends Command
* @var string[] The data to use.
* @psalm-suppress PropertyNotSetInConstructor
*/
protected array $data;
protected ?array $data = null;
/**
* @var string[] The example data.
* @psalm-suppress PropertyNotSetInConstructor
*/
protected array $exampleData;
protected ?array $exampleData = null;
/**
* @var string The title.
@ -102,7 +102,7 @@ abstract class AbstractCommand extends Command
/**
* Solve the given data for part one of the puzzle.
*
* @param array $data The data to process.
* @param string[] $data The data to process.
*
* @return int|string The result or null if not (yet?) implemented.
*/
@ -114,7 +114,7 @@ abstract class AbstractCommand extends Command
/**
* Solve the given data for part one of the puzzle.
*
* @param array $data The data to process.
* @param string[] $data The data to process.
*
* @return int|string The result or null if not (yet?) implemented.
*/

View File

@ -17,7 +17,6 @@ class Day2 extends AbstractCommand
$depth = 0;
$horizontal = 0;
/** @var string $current */
foreach ($data as $current) {
/**
* @var string $direction
@ -44,7 +43,6 @@ class Day2 extends AbstractCommand
$depth = 0;
$horizontal = 0;
/** @var string $current */
foreach ($data as $current) {
/**
* @var string $direction

View File

@ -17,6 +17,9 @@ class Puzzle extends Command
->addArgument('day', InputArgument::REQUIRED, 'The day number.');
}
/**
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$contents = file_get_contents(sprintf('%s/../data/day%s/puzzle.md', __DIR__, (int) $input->getArgument('day')));