Skip to content

Commit a287fc0

Browse files
authored
Merge pull request #168 from jsor-labs/cancellation-queue-object-check
Backport "Add check whether $cancellable is an object" to 2.x
2 parents f0430ac + 8feffb8 commit a287fc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CancellationQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __invoke()
1919

2020
public function enqueue($cancellable)
2121
{
22-
if (!\method_exists($cancellable, 'then') || !\method_exists($cancellable, 'cancel')) {
22+
if (!\is_object($cancellable) || !\method_exists($cancellable, 'then') || !\method_exists($cancellable, 'cancel')) {
2323
return;
2424
}
2525

0 commit comments

Comments
 (0)