From bc09f893682007017bdc0f9b1389cb6adf0eff39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Fri, 21 Nov 2025 09:36:32 +0100 Subject: [PATCH] Add support for PHP 8.5 --- .github/workflows/check.yml | 4 ++-- CHANGELOG.md | 4 ++++ composer.json | 8 ++++---- src/AngryBytes/DomainObject.php | 10 ++++++---- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 416b649..bcd01c5 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -14,11 +14,11 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.2', '8.3', '8.4'] + php: ['8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index f3171c9..3600c78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 4.0.1 + +- Added support for PHP `8.5`. + ## 4.0.0 ### PHP support diff --git a/composer.json b/composer.json index 60fce77..5608ef9 100644 --- a/composer.json +++ b/composer.json @@ -22,12 +22,12 @@ } }, "require": { - "php": "8.2 - 8.4" + "php": "8.2 - 8.5" }, "require-dev": { - "phpstan/phpstan": "2.0.3", - "phpunit/phpunit": "11.5.1", - "squizlabs/php_codesniffer": "3.11.2", + "phpstan/phpstan": "2.1.32", + "phpunit/phpunit": "11.5.44", + "squizlabs/php_codesniffer": "4.0.1", "friendsofphp/php-cs-fixer": "^3.65" } } diff --git a/src/AngryBytes/DomainObject.php b/src/AngryBytes/DomainObject.php index 0488e83..1ab6452 100644 --- a/src/AngryBytes/DomainObject.php +++ b/src/AngryBytes/DomainObject.php @@ -132,10 +132,12 @@ public function getPropertyValueAsSimple(string $property) // Traverse the foreach ($value as $childKey => $childValue) { - if ($childValue instanceof DomainObject) { - $newValue[$childKey] = $childValue->toArray(); - } else { - $newValue[$childKey] = $childValue; + if (is_string($childKey) || is_int($childKey)) { + if ($childValue instanceof DomainObject) { + $newValue[$childKey] = $childValue->toArray(); + } else { + $newValue[$childKey] = $childValue; + } } }