PluginProbe
Media Cloud Sync / 1.4.1
Media Cloud Sync v1.4.1
1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 All 35 releases
← All changes | includes/sdk/s3/GuzzleHttp/Promise/Create.php +6 -13 1.2.71.4.1 View file →
@@ -1,6 +1,7 @@
1 1 <?php
2 2
3 +declare (strict_types=1);
3 4 namespace Dudlewebs\WPMCS\s3\GuzzleHttp\Promise;
4 5
5 6 final class Create
6 7 {
@@ -7,12 +8,10 @@
7 8 /**
8 9 * Creates a promise for a value if the value is not a promise.
9 10 *
10 11 * @param mixed $value Promise or value.
11 - *
12 - * @return PromiseInterface
13 12 */
14 - public static function promiseFor($value)
13 + public static function promiseFor($value) : PromiseInterface
15 14 {
16 15 if ($value instanceof PromiseInterface) {
17 16 return $value;
18 17 }
@@ -30,12 +29,10 @@
30 29 * Creates a rejected promise for a reason if the reason is not a promise.
31 30 * If the provided reason is a promise, then it is returned as-is.
32 31 *
33 32 * @param mixed $reason Promise or reason.
34 - *
35 - * @return PromiseInterface
36 33 */
37 - public static function rejectionFor($reason)
34 + public static function rejectionFor($reason) : PromiseInterface
38 35 {
39 36 if ($reason instanceof PromiseInterface) {
40 37 return $reason;
41 38 }
@@ -44,14 +41,12 @@
44 41 /**
45 42 * Create an exception for a rejected promise value.
46 43 *
47 44 * @param mixed $reason
48 - *
49 - * @return \Exception|\Throwable
50 45 */
51 - public static function exceptionFor($reason)
46 + public static function exceptionFor($reason) : \Throwable
52 47 {
53 - if ($reason instanceof \Exception || $reason instanceof \Throwable) {
48 + if ($reason instanceof \Throwable) {
54 49 return $reason;
55 50 }
56 51 return new RejectionException($reason);
57 52 }
@@ -58,12 +53,10 @@
58 53 /**
59 54 * Returns an iterator for the given value.
60 55 *
61 56 * @param mixed $value
62 - *
63 - * @return \Iterator
64 57 */
65 - public static function iterFor($value)
58 + public static function iterFor($value) : \Iterator
66 59 {
67 60 if ($value instanceof \Iterator) {
68 61 return $value;
69 62 }