99namespace LeanPHP \Behat \CodeCoverage \Driver ;
1010
1111use GuzzleHttp \Client ;
12- use GuzzleHttp \Message \Response ;
12+ use GuzzleHttp \Psr7 \Response ;
1313use SebastianBergmann \CodeCoverage \Driver \Driver as DriverInterface ;
1414
1515/**
@@ -80,7 +80,7 @@ public function start($determineUnusedAndDead = true)
8080 */
8181 public function stop ()
8282 {
83- $ response = $ this ->sendRequest ('read ' , ['Accept ' => 'application/json ' ]);
83+ $ response = $ this ->sendRequest ('read ' , ['headers ' => [ ' Accept ' => 'application/json ' ] ]);
8484
8585 if ($ response ->getStatusCode () !== 200 ) {
8686 throw new \Exception ('remote driver fetch failed: ' . $ response ->getReasonPhrase ());
@@ -97,7 +97,7 @@ public function stop()
9797 * @param string $endpoint
9898 * @param array $headers
9999 *
100- * @return GuzzleHttp\Message \Response
100+ * @return GuzzleHttp\Psr7 \Response
101101 */
102102 private function sendRequest ($ endpoint , $ headers = array ())
103103 {
@@ -108,14 +108,14 @@ private function sendRequest($endpoint, $headers = array())
108108 }
109109
110110 if (isset ($ this ->config ['auth ' ])) {
111- $ response = $ this ->client ->$ method(
111+ $ response = $ this ->client ->request ( $ method,
112112 $ this ->config [$ endpoint ]['path ' ], [
113113 'auth ' => [$ this ->config ['auth ' ]['user ' ], $ this ->config ['auth ' ]['password ' ]],
114114 'headers ' => $ headers ,
115115 ]
116116 );
117117 } else {
118- $ response = $ this ->client ->$ method(
118+ $ response = $ this ->client ->request ( $ method,
119119 $ this ->config [$ endpoint ]['path ' ], [
120120 'headers ' => $ headers
121121 ]
0 commit comments