PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.9
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.9
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / vendor_prefixed / guzzlehttp / promises / src / RejectionException.php

RejectionException.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.9, at vendor_prefixed/guzzlehttp/promises/src/RejectionException.php

41 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YoastSEO_Vendor\GuzzleHttp\Promise;
4
5 /**
6 * A special exception that is thrown when waiting on a rejected promise.
7 *
8 * The reason value is available via the getReason() method.
9 */
10 class RejectionException extends \RuntimeException
11 {
12 /** @var mixed Rejection reason. */
13 private $reason;
14 /**
15 * @param mixed $reason Rejection reason.
16 * @param string $description Optional description
17 */
18 public function __construct($reason, $description = null)
19 {
20 $this->reason = $reason;
21 $message = 'The promise was rejected';
22 if ($description) {
23 $message .= ' with reason: ' . $description;
24 } elseif (\is_string($reason) || \is_object($reason) && \method_exists($reason, '__toString')) {
25 $message .= ' with reason: ' . $this->reason;
26 } elseif ($reason instanceof \JsonSerializable) {
27 $message .= ' with reason: ' . \json_encode($this->reason, \JSON_PRETTY_PRINT);
28 }
29 parent::__construct($message);
30 }
31 /**
32 * Returns the rejection reason.
33 *
34 * @return mixed
35 */
36 public function getReason()
37 {
38 return $this->reason;
39 }
40 }
41