Skip to content

Commit 65c43e6

Browse files
committed
Fix object:isInstanceOf
1 parent 1182c4d commit 65c43e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ObjectEnsurance.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public function __construct($object)
4141
*/
4242
public function isInstanceOf($object) : ObjectEnsurance
4343
{
44-
$this->enforce($this->object instanceof $object)->orThrow('"%s" is not an instance of "%s"', get_class($this->object), get_class($object));
44+
$class = is_object($object) ? get_class($object) : $object;
45+
$this->enforce($this->object instanceof $object)->orThrow('"%s" is not an instance of "%s"', get_class($this->object), $class);
4546

4647
return $this;
4748
}

0 commit comments

Comments
 (0)