Skip to content

Commit caaefe2

Browse files
committed
Add comment to elucidate is_object() check
1 parent aea79d6 commit caaefe2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/functions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ function resolve($promiseOrValue = null)
88
return $promiseOrValue;
99
}
1010

11+
// Check is_object() first to avoid method_exists() triggering
12+
// class autoloaders if $promiseOrValue is a string.
1113
if (is_object($promiseOrValue) && method_exists($promiseOrValue, 'then')) {
1214
$canceller = null;
1315

0 commit comments

Comments
 (0)