Skip to content

Commit

Permalink
bug null value array
Browse files Browse the repository at this point in the history
  • Loading branch information
tanthammar committed Mar 22, 2021
1 parent ae06afd commit aa49d51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Traits/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static function unique_words(string $scentence): string
}

/**
* Returns only specified key/value pairs from the give array
* Returns only specified key/value pairs from the given array
* and has deeply nested array support using "dot" notation for keys.
* @param array $array
* @param mixed $keys
Expand All @@ -76,7 +76,8 @@ public function arrayDotOnly(array $array, $keys): array
{
$newArray = [];
foreach ((array)$keys as $key) {
if (($value = Arr::get($array, $key)) !== null) Arr::set($newArray, $key, $value);
$value = Arr::get($array, $key);
Arr::set($newArray, $key, $value);
}
return $newArray;
}
Expand Down

0 comments on commit aa49d51

Please sign in to comment.