From e11e8fcceda74eb730e4f4f87fce73eddb8a8910 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Wed, 4 Dec 2024 08:06:32 +0000 Subject: [PATCH] prepare minor bugfix release 4.1.2 --- .changes/4.1.2.md | 8 ++++++++ CHANGELOG.md | 8 ++++++++ src/Helper/BoxConfigurationHelper.php | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .changes/4.1.2.md diff --git a/.changes/4.1.2.md b/.changes/4.1.2.md new file mode 100644 index 0000000..014da43 --- /dev/null +++ b/.changes/4.1.2.md @@ -0,0 +1,8 @@ + +## 4.1.2 - 2024-12-04 + +### Fixed + +- invalid `$firstBin` argument type provided on `BoxConfigurationHelper::retrieveMainScriptPath()` when project source code does not have a Composer `bin` declaration + +**Full Changelog**: [4.1.1...4.1.2](https://github.com/llaville/box-manifest/compare/4.1.1...4.1.2) diff --git a/CHANGELOG.md b/CHANGELOG.md index 940f3d9..d572b09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## 4.1.2 - 2024-12-04 + +### Fixed + +- invalid `$firstBin` argument type provided on `BoxConfigurationHelper::retrieveMainScriptPath()` when project source code does not have a Composer `bin` declaration + +**Full Changelog**: [4.1.1...4.1.2](https://github.com/llaville/box-manifest/compare/4.1.1...4.1.2) + ## 4.1.1 - 2024-12-02 ### Fixed diff --git a/src/Helper/BoxConfigurationHelper.php b/src/Helper/BoxConfigurationHelper.php index 5e0c335..cda7c13 100644 --- a/src/Helper/BoxConfigurationHelper.php +++ b/src/Helper/BoxConfigurationHelper.php @@ -95,7 +95,8 @@ public function __construct( if (file_exists($composerJsonPath)) { /** @var array $decodedComposerJson */ $decodedComposerJson = $json->decodeFile($composerJsonPath, true); - $firstBin = current((array) ($decodedComposerJson['bin'] ?? [])); + $bin = $decodedComposerJson['bin'] ?? []; + $firstBin = current((array) $bin) ?: null; } $main = $assocConfig[self::MAIN_KEY] ?? null;