1 | <?php |
||
16 | class HttpGuzzlClient implements HttpClientInterface |
||
17 | { |
||
18 | const DEFAULT_CONNECTION_TIMEOUT = 5; |
||
19 | const DEFAULT_TIMEOUT = 30; |
||
20 | |||
21 | /** |
||
22 | * @var ClientInterface |
||
23 | */ |
||
24 | private $oGuzzelClient; |
||
25 | |||
26 | /** |
||
27 | * @var AuthEntity |
||
28 | */ |
||
29 | private $oAuthEntity; |
||
30 | |||
31 | /** |
||
32 | * @param ClientInterface $oGuzzelClient |
||
33 | * @param AuthEntity $oAuthEntity |
||
34 | */ |
||
35 | 7 | public function __construct( |
|
43 | |||
44 | /** |
||
45 | * @param string $sUrl |
||
46 | * @return HttpClientResponseInterface |
||
47 | * @throws HttpConnectionException |
||
48 | */ |
||
49 | 3 | public function get($sUrl) |
|
67 | |||
68 | /** |
||
69 | * @param string $sUrl |
||
70 | * @param mixed $mPostData |
||
71 | * @return HttpGuzzlResponse |
||
72 | */ |
||
73 | 2 | public function postJsonData($sUrl, $mPostData) |
|
77 | |||
78 | /** |
||
79 | * @param string $sUrl |
||
80 | * @param mixed $mPutData |
||
81 | * @return HttpGuzzlResponse |
||
82 | */ |
||
83 | public function putJsonData($sUrl, $mPutData) |
||
87 | |||
88 | |||
89 | /** |
||
90 | * @param string $sUrl |
||
91 | * @return HttpGuzzlResponse |
||
92 | */ |
||
93 | 2 | public function delete($sUrl) |
|
99 | |||
100 | /** |
||
101 | * @param $sMethod |
||
102 | * @param $sUrl |
||
103 | * @param $mData |
||
104 | * @return HttpGuzzlResponse |
||
105 | */ |
||
106 | 2 | private function sendJsonDataWithMethod($sMethod, $sUrl, $mData) |
|
115 | |||
116 | /** |
||
117 | * Returns default options for the HTTP request. |
||
118 | * If an username and password is provided, auth |
||
119 | * header will be applied as well. |
||
120 | * |
||
121 | * @return array<string,integer|string> |
||
|
|||
122 | */ |
||
123 | 7 | private function getDefaultRequestOptions() |
|
142 | } |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.