Conditions | 2 |
Paths | 2 |
Total Lines | 28 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function call() |
||
27 | { |
||
28 | $parameters = [ |
||
29 | 'jsonrpc' => '2.0', |
||
30 | 'id' => uniqid($this->getMethod() . '_'), |
||
31 | 'params' => $this->getParameters(), |
||
32 | 'method' => $this->getMethod(), |
||
33 | ]; |
||
34 | |||
35 | $response = false; |
||
36 | |||
37 | try { |
||
38 | $response = $this->getHttpClient()->sendRequest( |
||
39 | $this->getMessageFactory()->createRequest( |
||
40 | 'POST', |
||
41 | $this->getEndpoint(), |
||
42 | [], |
||
43 | json_encode( |
||
44 | $parameters |
||
45 | ) |
||
46 | ) |
||
47 | ); |
||
48 | } catch (\Exception $exception) { |
||
49 | // @todo: log this. |
||
50 | } |
||
51 | |||
52 | return $response; |
||
53 | } |
||
54 | |||
114 |