We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a3a7e2 commit f44967fCopy full SHA for f44967f
src/Helper/IOHelper.php
@@ -2,6 +2,8 @@
2
3
namespace AlexWestergaard\PhpGa4\Helper;
4
5
+use AlexWestergaard\PhpGa4\Item;
6
+use AlexWestergaard\PhpGa4\Facade\Type\ItemType;
7
use AlexWestergaard\PhpGa4\Facade\Type\IOType;
8
use AlexWestergaard\PhpGa4\Exception\Ga4IOException;
9
@@ -303,6 +305,10 @@ public static function fromArray(IOType|array $importable): static
303
305
foreach ($importable as $key => $val) {
304
306
if (is_array($val)) {
307
foreach ($val as $single) {
308
+ if (in_array($key, ['item', 'items']) && !($importable instanceof ItemType)) {
309
+ $single = Item::fromArray($single);
310
+ }
311
+
312
$static[$key] = $single;
313
}
314
} else {
0 commit comments