1 | <?php |
||
10 | class GuzzleRequest implements RequestInterface |
||
11 | { |
||
12 | /** @var \GuzzleHttp\Client */ |
||
13 | protected $client; |
||
14 | |||
15 | /** @var \GuzzleHttp\Psr7\Request */ |
||
16 | protected $request; |
||
17 | |||
18 | /** @var array */ |
||
19 | protected $requestOptions = []; |
||
20 | |||
21 | /** @var \GuzzleHttp\Psr7\Response */ |
||
22 | protected $response; |
||
23 | |||
24 | /** @var int */ |
||
25 | protected $port; |
||
26 | |||
27 | /** @var string */ |
||
28 | protected $url; |
||
29 | |||
30 | public function __construct() |
||
37 | |||
38 | public function setUserAgent(string $userAgentString) |
||
46 | |||
47 | public function setTimeout(float $timeout) |
||
51 | |||
52 | public function setVerifySsl(bool $verify) |
||
56 | |||
57 | public function setProxy(string $proxy, int $port) |
||
61 | |||
62 | public function setProxyAuth(string $username, string $password) |
||
69 | |||
70 | public function setUrl(string $url) |
||
74 | |||
75 | public function setPort(int $port) |
||
79 | |||
80 | public function setBody(array $body) |
||
84 | |||
85 | public function setOutputDestination($output_destination) |
||
89 | |||
90 | public function execute() |
||
96 | |||
97 | public function getHttpStatusCode(): int |
||
101 | |||
102 | public function getErrorMessage() |
||
110 | |||
111 | public function getErrorNumber() |
||
115 | } |
||
116 |
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return
,die
orexit
statements that have been added for debug purposes.In the above example, the last
return false
will never be executed, because a return statement has already been met in every possible execution path.