From 5e09ed69446fd7b72f7d035410d4279a6553bfa1 Mon Sep 17 00:00:00 2001 From: "Nek (Maxime Veber)" Date: Tue, 13 Oct 2015 15:28:28 +0200 Subject: [PATCH] Added possibility to specify options for guzzle --- lib/Nekland/BaseApi/Http/AbstractHttpClient.php | 1 + lib/Nekland/BaseApi/Http/ClientAdapter/GuzzleAdapter.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Nekland/BaseApi/Http/AbstractHttpClient.php b/lib/Nekland/BaseApi/Http/AbstractHttpClient.php index a8d3360..fd648ee 100644 --- a/lib/Nekland/BaseApi/Http/AbstractHttpClient.php +++ b/lib/Nekland/BaseApi/Http/AbstractHttpClient.php @@ -75,6 +75,7 @@ public function send(Request $request, $withEvent = true) /** * @param string $option * @param mixed $default + * @return mixed */ public function getOption($option, $default = null) { diff --git a/lib/Nekland/BaseApi/Http/ClientAdapter/GuzzleAdapter.php b/lib/Nekland/BaseApi/Http/ClientAdapter/GuzzleAdapter.php index 9c5b2c6..39c7ad4 100644 --- a/lib/Nekland/BaseApi/Http/ClientAdapter/GuzzleAdapter.php +++ b/lib/Nekland/BaseApi/Http/ClientAdapter/GuzzleAdapter.php @@ -26,7 +26,9 @@ class GuzzleAdapter extends AbstractHttpClient public function __construct(EventDispatcher $dispatcher, array $options = [], Client $client = null) { parent::__construct($dispatcher, $options); - $this->guzzle = $client ?: new Client(); + + $guzzleOptions = isset($options['guzzle']) ? $options['guzzle'] : []; + $this->guzzle = $client ?: new Client($guzzleOptions); } protected function execute(Request $request)