1 | <?php |
||
11 | abstract class AbstractRequest implements RequestInterface, ArrayAccess, IteratorAggregate, JsonSerializable |
||
12 | { |
||
13 | use Parametrizable; |
||
14 | |||
15 | /** |
||
16 | * The gateway |
||
17 | * |
||
18 | * @var \Gregoriohc\Protean\Common\AbstractGateway |
||
19 | */ |
||
20 | protected $gateway; |
||
21 | |||
22 | /** |
||
23 | * The response to this request (if the request has been sent) |
||
24 | * |
||
25 | * @var ResponseInterface |
||
26 | */ |
||
27 | protected $response; |
||
28 | |||
29 | /** |
||
30 | * AbstractRequest constructor. |
||
31 | * @param \Gregoriohc\Protean\Common\AbstractGateway $gateway |
||
32 | * @param array $parameters |
||
33 | */ |
||
34 | 24 | public function __construct($gateway, $parameters = []) |
|
39 | |||
40 | /** |
||
41 | * @param array $data |
||
42 | * @return ResponseInterface |
||
43 | */ |
||
44 | 9 | protected function createResponse($data) |
|
50 | |||
51 | /** |
||
52 | * Get the response to this request (if the request has been sent) |
||
53 | * |
||
54 | * @return ResponseInterface |
||
55 | */ |
||
56 | 6 | public function response() |
|
64 | |||
65 | /** |
||
66 | * Send the request |
||
67 | * |
||
68 | * @return ResponseInterface |
||
69 | */ |
||
70 | 15 | public function send() |
|
78 | |||
79 | /** |
||
80 | * @return \Gregoriohc\Protean\Common\AbstractGateway |
||
81 | */ |
||
82 | 3 | public function gateway() |
|
86 | } |
||
87 |