summaryrefslogtreecommitdiff
path: root/vendor/guzzlehttp/promises/src/RejectionException.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/guzzlehttp/promises/src/RejectionException.php')
-rw-r--r--vendor/guzzlehttp/promises/src/RejectionException.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/vendor/guzzlehttp/promises/src/RejectionException.php b/vendor/guzzlehttp/promises/src/RejectionException.php
index e2f1377..47dca86 100644
--- a/vendor/guzzlehttp/promises/src/RejectionException.php
+++ b/vendor/guzzlehttp/promises/src/RejectionException.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace GuzzleHttp\Promise;
/**
@@ -13,24 +15,23 @@ class RejectionException extends \RuntimeException
private $reason;
/**
- * @param mixed $reason Rejection reason.
- * @param string $description Optional description
+ * @param mixed $reason Rejection reason.
+ * @param string|null $description Optional description.
*/
- public function __construct($reason, $description = null)
+ public function __construct($reason, ?string $description = null)
{
$this->reason = $reason;
$message = 'The promise was rejected';
if ($description) {
- $message .= ' with reason: ' . $description;
+ $message .= ' with reason: '.$description;
} elseif (is_string($reason)
|| (is_object($reason) && method_exists($reason, '__toString'))
) {
- $message .= ' with reason: ' . $this->reason;
+ $message .= ' with reason: '.$this->reason;
} elseif ($reason instanceof \JsonSerializable) {
- $message .= ' with reason: '
- . json_encode($this->reason, JSON_PRETTY_PRINT);
+ $message .= ' with reason: '.json_encode($this->reason, JSON_PRETTY_PRINT);
}
parent::__construct($message);