File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,15 @@ class GuzzleClient extends HTTPClientAbstract{
2424 /**
2525 * GuzzleClient constructor.
2626 *
27- * @param \chillerlan\Traits\ContainerInterface|null $options
28- * @param \GuzzleHttp\Client|null $http
27+ * @param \chillerlan\Traits\ContainerInterface $options
28+ * @param \GuzzleHttp\Client|null $http
2929 */
30- public function __construct (ContainerInterface $ options = null , Client $ http = null ){
30+ public function __construct (ContainerInterface $ options , Client $ http = null ){
3131 parent ::__construct ($ options );
3232
33- $ this ->setClient ($ http );
33+ if ($ http instanceof Client){
34+ $ this ->setClient ($ http );
35+ }
3436 }
3537
3638 /** @inheritdoc */
Original file line number Diff line number Diff line change @@ -24,11 +24,11 @@ interface HTTPClientInterface{
2424 public function __construct (ContainerInterface $ options );
2525
2626 /**
27- * @param string $url
28- * @param array $params
29- * @param string $method
30- * @param mixed $body
31- * @param array $headers
27+ * @param string $url
28+ * @param array|null $params
29+ * @param string|null $method
30+ * @param mixed|null $body
31+ * @param array|null $headers
3232 *
3333 * @return \chillerlan\HTTP\HTTPResponseInterface
3434 * @throws \chillerlan\HTTP\HTTPClientException
Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ class TinyCurlClient extends HTTPClientAbstract{
2424 * TinyCurlClient constructor.
2525 *
2626 * @param \chillerlan\Traits\ContainerInterface $options
27- * @param \chillerlan\TinyCurl\Request $http
27+ * @param \chillerlan\TinyCurl\Request|null $http
2828 */
2929 public function __construct (ContainerInterface $ options , Request $ http = null ){
3030 parent ::__construct ($ options );
3131
32- $ this ->setClient ($ http );
32+ if ($ http instanceof Request){
33+ $ this ->setClient ($ http );
34+ }
3335 }
3436
3537 /** @inheritdoc */
You can’t perform that action at this time.
0 commit comments