summaryrefslogtreecommitdiff
path: root/server/vendor/guzzlehttp/guzzle/src/Middleware.php
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-28 12:17:43 +0200
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-28 12:17:43 +0200
commit53f65de9d4163c9c095f2b8e87baca648c3645bd (patch)
tree37f167f38b25aa50bd7dd1429438c0245a280a28 /server/vendor/guzzlehttp/guzzle/src/Middleware.php
parent60cfe3ebc039df8d6a468a43a59e7fd8c2a16956 (diff)
parent804fa322d841d73ee7592885ec500dc94e91b9e6 (diff)
Test
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(