Skip to content

Commit

Permalink
Fix __set_state param type
Browse files Browse the repository at this point in the history
  • Loading branch information
adbario committed Mar 25, 2022
1 parent af12dbd commit 8fcc9c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Dot.php
Expand Up @@ -498,12 +498,12 @@ public function toJson($key = null, $options = 0)
* Output or return a parsable string representation of the
* given array when exported by var_export()
*
* @param self $items
* @param array $items
* @return object
*/
public static function __set_state(self $dot): object
public static function __set_state(array $items): object
{
return (object) $dot->all();
return (object) $items;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion tests/DotTest.php
Expand Up @@ -674,7 +674,7 @@ public function testSetState()
{
$this->assertEquals(
(object) ['foo' => ['bar' => 'baz']],
Dot::__set_state(new Dot(['foo' => ['bar' => 'baz']]))
Dot::__set_state(['foo' => ['bar' => 'baz']])
);
}

Expand Down

0 comments on commit 8fcc9c6

Please sign in to comment.