summaryrefslogtreecommitdiff
path: root/server/vendor/guzzlehttp/guzzle/src/Middleware.php
diff options
context:
space:
mode:
authorEoleDev <EoleDev@outlook.fr>2016-03-23 15:30:47 +0100
committerEoleDev <EoleDev@outlook.fr>2016-03-23 15:30:47 +0100
commit54ec6723deb44e325782afd366eeec01ee29ac55 (patch)
tree5431400d307754a02e6c40b35a40e6761d7dac0c /server/vendor/guzzlehttp/guzzle/src/Middleware.php
parent0dc17aa9efb987dcdf6f864f4110450bcc0c9003 (diff)
Maj Library
Diffstat (limited to 'server/vendor/guzzlehttp/guzzle/src/Middleware.php')
-rw-r--r--server/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 100644
--- 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(