File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ abstract class AbstractClient
1818 */
1919 protected $ logger ;
2020
21+ /**
22+ * @var array
23+ */
24+ protected $ config ;
25+
2126 /**
2227 * @var \GuzzleHttp\Client
2328 */
@@ -28,11 +33,13 @@ abstract class AbstractClient
2833 *
2934 * @param LoopInterface $loop
3035 * @param LoggerInterface $logger
36+ * @param array $config
3137 */
32- public function __construct (LoopInterface $ loop , LoggerInterface $ logger )
38+ public function __construct (LoopInterface $ loop , LoggerInterface $ logger, array $ config = [] )
3339 {
3440 $ this ->loop = $ loop ;
3541 $ this ->logger = $ logger ;
42+ $ this ->config = $ config ;
3643 $ this ->client = $ this ->createClient ();
3744 }
3845
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ protected function createClient()
2020 $ stack = HandlerStack::create ($ handler );
2121 $ stack ->push (Middleware::userAgent ());
2222
23- return new GuzzleClient ([
24- ' handler ' => $ stack ,
25- ] );
23+ $ config = array_merge ( $ this -> config , [ ' handler ' => $ stack ]);
24+
25+ return new GuzzleClient ( $ config );
2626 }
2727}
You can’t perform that action at this time.
0 commit comments