1 | <?php |
||
28 | class ThriftTransportRequest implements TransportRequestInterface |
||
29 | { |
||
30 | /** |
||
31 | * @var RestRequest |
||
32 | */ |
||
33 | private $request; |
||
34 | |||
35 | /** |
||
36 | * @param string $method The http method to use. |
||
37 | * @param array $vals |
||
38 | */ |
||
39 | 2 | function __construct($method, $vals = null) |
|
|
|||
40 | { |
||
41 | 2 | $this->request = new RestRequest($vals); |
|
42 | 2 | $this->request->method = array_flip(Method::$__names)[$method]; |
|
43 | 2 | } |
|
44 | |||
45 | /** |
||
46 | * @param string $body The raw request body. |
||
47 | * |
||
48 | * @return void |
||
49 | * @author Mario Mueller |
||
50 | */ |
||
51 | 1 | public function setBody($body) |
|
55 | |||
56 | /** |
||
57 | * @param string $path The path according to the Elasticsearch http interface. |
||
58 | * |
||
59 | * @return void |
||
60 | * @author Mario Mueller |
||
61 | */ |
||
62 | 1 | public function setPath($path) |
|
66 | |||
67 | /** |
||
68 | * @return RestRequest |
||
69 | * @author Mario Mueller |
||
70 | */ |
||
71 | 1 | public function getWrappedRequest() |
|
75 | |||
76 | /** |
||
77 | * @param array $params |
||
78 | * |
||
79 | * @return void |
||
80 | * @author Mario Mueller |
||
81 | */ |
||
82 | 1 | public function setQueryParams(array $params) |
|
86 | |||
87 | } |
||
88 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.