Skip to content

Commit

Permalink
Merge pull request #7 from mingyoung/master
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
overtrue authored Dec 30, 2018
2 parents ba4d598 + e1cc810 commit 3651c54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ public function dotGet($array, $key, $default = null)
if (is_null($key)) {
return $array;
}
if (array_key_exists($array, $key)) {
if (array_key_exists($key, $array)) {
return $array[$key];
}
foreach (explode('.', $key) as $segment) {
if (array_key_exists($array, $segment)) {
if (array_key_exists($segment, $array)) {
$array = $array[$segment];
} else {
return $default;
Expand Down Expand Up @@ -245,7 +245,7 @@ public function dotRemove(array &$array, $keys)
}

foreach ($keys as $key) {
if (array_key_exists($array, $key)) {
if (array_key_exists($key, $array)) {
unset($array[$key]);
continue;
}
Expand Down

0 comments on commit 3651c54

Please sign in to comment.