Skip to content

Commit d222955

Browse files
committed
Merge pull request #11 from hikouki/master
Fix Arr::wrap.
2 parents c8df69e + 3384c31 commit d222955

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Arr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ public static function wrap($object)
430430
{
431431
if (is_null($object)) {
432432
return array();
433-
} elseif (is_array($object)) {
433+
} elseif (is_array($object) && !self::isAssoc($object)) {
434434
return $object;
435435
}
436436

tests/ArrayTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,5 +399,6 @@ public function testWrap()
399399
is(array(), Arr::wrap(null));
400400
is(array(1, 2, 3), Arr::wrap(array(1, 2, 3)));
401401
is(array(0), Arr::wrap(0));
402+
is(array(array('key' => 'value')), Arr::wrap(array('key' => 'value')));
402403
}
403404
}

0 commit comments

Comments
 (0)