From 17b0d7098c6bf153d72a54f20ba77e8dababa317 Mon Sep 17 00:00:00 2001 From: Tristan Date: Mon, 6 Dec 2021 23:39:16 +0100 Subject: [PATCH] Several 'framework' fixes --- .github/workflows/ci.yaml | 2 +- aoc21 | 2 ++ composer.json | 3 ++- psalm.xml | 1 + src/AbstractCommand.php | 8 ++++---- src/Day2.php | 2 -- src/Puzzle.php | 3 +++ 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 87350c5..a6444a4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,4 +57,4 @@ jobs: uses: php-actions/composer@v5 - name: Run Psalm - run: ./vendor/bin/psalm --output-format=github + run: composer psalm -- --output-format=github diff --git a/aoc21 b/aoc21 index 2d8fcb3..9b7903d 100755 --- a/aoc21 +++ b/aoc21 @@ -5,6 +5,7 @@ require __DIR__.'/vendor/autoload.php'; use AdventOfCode21\Day1; use AdventOfCode21\Day2; use AdventOfCode21\Day3; +use AdventOfCode21\Day4; use AdventOfCode21\Puzzle; use Symfony\Component\Console\Application; @@ -14,5 +15,6 @@ $application->add(new Puzzle()); $application->add(new Day1()); $application->add(new Day2()); $application->add(new Day3()); +$application->add(new Day4()); $application->run(); diff --git a/composer.json b/composer.json index d67dd63..2102d74 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,7 @@ }, "scripts": { "test": "vendor/bin/phpunit ./tests --testdox", - "style": "vendor/bin/php-cs-fixer fix" + "style": "vendor/bin/php-cs-fixer fix", + "psalm": "vendor/bin/psalm" } } diff --git a/psalm.xml b/psalm.xml index b4378ab..8012637 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,7 @@ 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')));