reason = $reason; } } public function connect($uri) { $reason = $this->reason; if (!is_string($reason)) { try { $reason = $reason($uri); } catch (\Exception $e) { $reason = $e; } } if (!$reason instanceof \Exception) { $reason = new Exception($reason); } return Promise\reject($reason); } }