Origin: upstream, commit:aea79d6a014fd747badfa630e9ed6b3dab64737d
Author: Pavel Shavshukov <smart_screen@outlook.com>
Description: Add check whether $cancellable is an object

--- a/src/CancellationQueue.php
+++ b/src/CancellationQueue.php
@@ -19,7 +19,7 @@ class CancellationQueue
 
     public function enqueue($cancellable)
     {
-        if (!method_exists($cancellable, 'then') || !method_exists($cancellable, 'cancel')) {
+        if (!\is_object($cancellable) || !\method_exists($cancellable, 'then') || !\method_exists($cancellable, 'cancel')) {
             return;
         }
 
