Skip to content

Commit

Permalink
Removed return types for O::assoc and O::dissoc, since it can return …
Browse files Browse the repository at this point in the history
…both objects and assoc arrays
  • Loading branch information
meszaros-lajos-gyorgy committed Jul 28, 2021
1 parent 273a85d commit 4d16277
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/O.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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});
}
Expand Down

0 comments on commit 4d16277

Please sign in to comment.