summaryrefslogtreecommitdiff
path: root/server/vendor/guzzlehttp/guzzle/src/Middleware.php
diff options
context:
space:
mode:
Diffstat (limited to 'server/vendor/guzzlehttp/guzzle/src/Middleware.php')
-rwxr-xr-xserver/vendor/guzzlehttp/guzzle/src/Middleware.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/vendor/guzzlehttp/guzzle/src/Middleware.php b/server/vendor/guzzlehttp/guzzle/src/Middleware.php
index 85d3165..449ab4b 100755
--- a/server/vendor/guzzlehttp/guzzle/src/Middleware.php
+++ b/server/vendor/guzzlehttp/guzzle/src/Middleware.php
@@ -75,9 +75,14 @@ final class Middleware
* @param array $container Container to hold the history (by reference).
*
* @return callable Returns a function that accepts the next handler.
+ * @throws \InvalidArgumentException if container is not an array or ArrayAccess.
*/
- public static function history(array &$container)
+ public static function history(&$container)
{
+ if (!is_array($container) && !$container instanceof \ArrayAccess) {
+ throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
+ }
+
return function (callable $handler) use (&$container) {
return function ($request, array $options) use ($handler, &$container) {
return $handler($request, $options)->then(