From 4d16277d2411bade7febebfa511829bbf03d4bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Lajos?= Date: Wed, 28 Jul 2021 10:43:41 +0200 Subject: [PATCH] Removed return types for O::assoc and O::dissoc, since it can return both objects and assoc arrays --- src/O.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/O.php b/src/O.php index ddd6410..3b84536 100644 --- a/src/O.php +++ b/src/O.php @@ -45,7 +45,8 @@ function ($result, $key) use ($data) { } // O::assoc('foo', 'bar', {}) -> {foo: 'bar'} - public static function assoc(string $key, $value, $data): object { + public static function assoc(string $key, $value, $data) + { if (self::isObject($data)) { $data->{$key} = $value; } @@ -58,7 +59,8 @@ public static function assoc(string $key, $value, $data): object { } // O::dissoc('foo', {foo: 'bar', fizz: 'buzz'}) -> {fizz: 'buzz'} - public static function dissoc(string $key, $data): object { + public static function dissoc(string $key, $data) + { if (self::isObject($data)) { unset($data->{$key}); }