From 148de8991b25fe28e30f788b765a1570f35d595b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 10:17:31 +0000 Subject: [PATCH 1/3] Initial plan From 87a2868279d1c12148c842e0837edb7f5458f050 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 10:18:17 +0000 Subject: [PATCH 2/3] plan: initial checklist Co-authored-by: overclokk <4604932+overclokk@users.noreply.github.com> --- .github/workflows/lint.yml | 70 +++++++++++++-------------- .github/workflows/static-analysis.yml | 58 +++++++++++----------- LICENSE | 42 ++++++++-------- 3 files changed, 85 insertions(+), 85 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 356007f..21dd0de 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,36 +1,36 @@ -name: CS - File lint and file validation - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - lint: - name: ✔️ CS check al files - - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '--skip ci') && !github.event.pull_request.draft" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP with PECL extension - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Validate php files - run: find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l - - - uses: ramsey/composer-install@v3 - - - name: Coding standard +name: CS - File lint and file validation + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + lint: + name: ✔️ CS check al files + + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '--skip ci') && !github.event.pull_request.draft" + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP with PECL extension + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Validate php files + run: find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l + + - uses: ramsey/composer-install@v3 + + - name: Coding standard run: composer run cs \ No newline at end of file diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 3cdf6ea..8b8f266 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,30 +1,30 @@ -name: Static Analysis - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - tests: - name: Static Analysis for PHP - - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '--skip ci') && !github.event.pull_request.draft" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 7.4 - - - uses: ramsey/composer-install@v3 - - - name: Psalm +name: Static Analysis + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + tests: + name: Static Analysis for PHP + + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '--skip ci') && !github.event.pull_request.draft" + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + + - uses: ramsey/composer-install@v3 + + - name: Psalm run: vendor/bin/psalm \ No newline at end of file diff --git a/LICENSE b/LICENSE index fd89f9a..640da3c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2015 Enea Scerba - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2015 Enea Scerba + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From be07163c77f52df8270948a42977a424b36eafe4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 10:36:03 +0000 Subject: [PATCH 3/3] add tests for scalar coercion and delimiter literal paths Co-authored-by: overclokk <4604932+overclokk@users.noreply.github.com> --- tests/unit/ConfigTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/unit/ConfigTest.php b/tests/unit/ConfigTest.php index d41f4a6..2b4057a 100644 --- a/tests/unit/ConfigTest.php +++ b/tests/unit/ConfigTest.php @@ -672,6 +672,28 @@ public function itShouldReturnDefaultIfValFetchedIsNull(): void $this->assertSame('default-value', $sut->get('test2.test1.sub', 'default-value'), ''); } + public function testScalarToArrayCoercionReturnsDefaultAndLeavesScalarUntouched(): void + { + $sut = $this->makeInstance(['flag' => 'value']); + + $this->assertSame('value', $sut->get('flag')); + $this->assertFalse($sut->has('flag.sub')); // scalar gets cast to array during lookup + $this->assertSame('fallback', $sut->get('flag.sub', 'fallback')); + $this->assertSame('value', $sut->get('flag')); // original scalar preserved + } + + public function testLiteralKeyContainingDelimiterMustUseArrayPath(): void + { + $sut = $this->makeInstance(); + $sut->set(['foo.bar'], 'literal'); + + $this->assertFalse($sut->has('foo.bar')); // interpreted as nested path + $this->assertSame('default', $sut->get('foo.bar', 'default')); + + $this->assertTrue($sut->has(['foo.bar'])); + $this->assertSame('literal', $sut->get(['foo.bar'])); + } + /** * @test */