From 23365649bfa5ec4f386bf6b352863fd01109f7cb Mon Sep 17 00:00:00 2001 From: jdrieghe Date: Mon, 3 Jan 2022 08:47:56 +0100 Subject: [PATCH 1/6] Use php 8.1 docker container for local development --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 12cde7a..a95a433 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8-cli-alpine +FROM php:8.1-cli-alpine ENV COMPOSER_HOME /composer ENV COMPOSER_ALLOW_SUPERUSER 1 From eaee76e68feb3aa0b81d637b0a6c7b43b06269ed Mon Sep 17 00:00:00 2001 From: jdrieghe Date: Mon, 3 Jan 2022 08:48:23 +0100 Subject: [PATCH 2/6] Use PHP 8.1 as the default in the CI pipeline --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bdd31c..b55f32b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@master - uses: shivammathur/setup-php@master with: - php-version: '8.0' + php-version: '8.1' - name: Install dependencies run: composer update - name: Run Psalm @@ -37,7 +37,7 @@ jobs: - uses: actions/checkout@master - uses: shivammathur/setup-php@master with: - php-version: '8.0' + php-version: '8.1' - name: Install dependencies run: composer update - name: Run PHP-CS-Fixer @@ -49,7 +49,7 @@ jobs: - uses: actions/checkout@master - uses: shivammathur/setup-php@master with: - php-version: '8.0' + php-version: '8.1' - name: Install dependencies run: composer update - name: Run License Checker From e390e8f9bf499513235d3e09f29179248d742050 Mon Sep 17 00:00:00 2001 From: jdrieghe Date: Mon, 3 Jan 2022 08:49:25 +0100 Subject: [PATCH 3/6] Explicitly check for the variable being set --- bin/license-checker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/license-checker b/bin/license-checker index be04182..2ad895f 100755 --- a/bin/license-checker +++ b/bin/license-checker @@ -26,7 +26,7 @@ foreach ($potentialAutoLoaderFiles as $potentialAutoLoaderFile) { } } -if (!$autoLoader) { +if (!isset($autoLoader)) { throw new RuntimeException('vendor/autoload.php could not be found. Did you run `composer install`?'); } From 66e95b34ae3fb2f037028f0cd4f48f71ff221f10 Mon Sep 17 00:00:00 2001 From: jdrieghe Date: Mon, 3 Jan 2022 08:50:42 +0100 Subject: [PATCH 4/6] Use correct upcoming version --- bin/license-checker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/license-checker b/bin/license-checker index 2ad895f..6b74b77 100755 --- a/bin/license-checker +++ b/bin/license-checker @@ -30,7 +30,7 @@ if (!isset($autoLoader)) { throw new RuntimeException('vendor/autoload.php could not be found. Did you run `composer install`?'); } -$application = new Application('License Checker', '0.0.1'); +$application = new Application('License Checker', '1.2.0'); $allowedLicensesParser = new AllowedLicensesParser(getcwd()); $usedLicensesParser = new UsedLicensesParser(new UsedLicensesRetriever()); From 9a21b86416f923d8718fcf9e09f5f9822fd48940 Mon Sep 17 00:00:00 2001 From: jdrieghe Date: Mon, 3 Jan 2022 08:55:14 +0100 Subject: [PATCH 5/6] Run PHP-CS-Fixer against php 8 due to lack of 8.1 compatibility for now --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b55f32b..beae321 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: - uses: actions/checkout@master - uses: shivammathur/setup-php@master with: - php-version: '8.1' + php-version: '8.0' - name: Install dependencies run: composer update - name: Run PHP-CS-Fixer From 15580f6a9ef36ba6beac0202a5a1b6e8c5fc3f89 Mon Sep 17 00:00:00 2001 From: jdrieghe Date: Mon, 3 Jan 2022 08:58:20 +0100 Subject: [PATCH 6/6] Remove unnecessary call to array_values --- src/Commands/GenerateConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/GenerateConfig.php b/src/Commands/GenerateConfig.php index 2b86295..3f3b42b 100644 --- a/src/Commands/GenerateConfig.php +++ b/src/Commands/GenerateConfig.php @@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int try { /** @var string|null $fileName */ $fileName = is_string($input->getOption('filename')) ? $input->getOption('filename') : null; - $this->allowedLicensesParser->writeConfiguration(array_values($usedLicenses), $fileName); + $this->allowedLicensesParser->writeConfiguration($usedLicenses, $fileName); $io->success('Configuration file successfully written'); } catch (ConfigurationExists $e) { $io->error('The configuration file already exists. Please remove it before generating a new one.');