Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion framework/helpers/BaseArrayHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
if (is_array($object)) {
if ($recursive) {
foreach ($object as $key => $value) {
if (is_array($value) || is_object($value)) {
if ($value instanceof \UnitEnum) {

Check failure on line 67 in framework/helpers/BaseArrayHelper.php

View workflow job for this annotation

GitHub Actions / phpstan-7x / PHP 7.4-ubuntu-latest

Class UnitEnum not found.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
$object[$key] = $value->value;

Check failure on line 68 in framework/helpers/BaseArrayHelper.php

View workflow job for this annotation

GitHub Actions / phpstan / PHP 8.5-ubuntu-latest

Access to an undefined property UnitEnum::$value.

Check failure on line 68 in framework/helpers/BaseArrayHelper.php

View workflow job for this annotation

GitHub Actions / phpstan-7x / PHP 7.4-ubuntu-latest

Access to property $value on an unknown class UnitEnum.
} elseif (is_array($value) || is_object($value)) {
$object[$key] = static::toArray($value, $properties, true);
}
}
Expand Down
Loading