This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
It seems like $request->getUri() targeting GuzzleHttp\Psr7\Request::getUri() can also be of type object<Psr\Http\Message\UriInterface>; however, Guzzle\Http\Client::createRequest() does only seem to accept string|array|null, maybe add an additional type check?
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.
Loading history...
69
$request->getHeaders(),
70
$request->getBody()
71
);
72
73
$guzzleResponse = $guzzleRequest->send();
74
75
$response = new Response(
76
$guzzleResponse->getStatusCode(),
77
$guzzleResponse->getHeaders()->toArray(),
78
$guzzleResponse->getBody(true)
79
);
80
81
return $response;
82
}
83
84
/**
85
* use to mock client
86
*
87
* @param EventSubscriberInterface $subscriber
88
*/
89
public function addSubscriber(EventSubscriberInterface $subscriber)
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.