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/Aws/HandlerList.php +15 -2 1.0.2 → 1.4.1 View file →
@@ -49,9 +49,9 @@
49 49 private $steps = [self::ATTEMPT => [], self::SIGN => [], self::BUILD => [], self::VALIDATE => [], self::INIT => []];
50 50 /**
51 51 * @param callable $handler HTTP handler.
52 52 */
53 - public function __construct(callable $handler = null)
53 + public function __construct(?callable $handler = null)
54 54 {
55 55 $this->handler = $handler;
56 56 }
57 57 /**
@@ -97,8 +97,21 @@
97 97 {
98 98 return (bool) $this->handler;
99 99 }
100 100 /**
101 + * Checks if a middleware exists. The middleware
102 + * should have been added with a name in order to
103 + * use this method.
104 + *
105 + * @param string $name
106 + *
107 + * @return bool
108 + */
109 + public function hasMiddleware(string $name) : bool
110 + {
111 + return isset($this->named[$name]);
112 + }
113 + /**
101 114 * Append a middleware to the init step.
102 115 *
103 116 * @param callable $middleware Middleware function to add.
104 117 * @param string $name Name of the middleware.
@@ -245,9 +258,9 @@
245 258 * object.
246 259 *
247 260 * @param callable|null $fn Pass null to remove any previously set function
248 261 */
249 - public function interpose(callable $fn = null)
262 + public function interpose(?callable $fn = null)
250 263 {
251 264 $this->sorted = null;
252 265 $this->interposeFn = $fn;
253 266 }