1 | <?php |
||
17 | class CompletePurchaseRequest extends AbstractRequest |
||
18 | { |
||
19 | /** |
||
20 | * @return array |
||
21 | */ |
||
22 | 3 | public function getData() |
|
26 | |||
27 | /** |
||
28 | * @return ResponseInterface |
||
29 | */ |
||
30 | 3 | public function send() |
|
34 | |||
35 | /** |
||
36 | * Send the request with specified data |
||
37 | * |
||
38 | * @param mixed $data The data to send |
||
39 | * @return ResponseInterface |
||
40 | */ |
||
41 | 3 | public function sendData($data) |
|
45 | } |
||
46 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: