1 | <?php namespace Ntholenaar\MultiSafepayClient\Request; |
||
9 | class Request implements RequestInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var MessageFactory |
||
13 | */ |
||
14 | protected $messageFactory; |
||
15 | |||
16 | /** |
||
17 | * @var UriFactory |
||
18 | */ |
||
19 | protected $uriFactory; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $baseUrl = ''; |
||
25 | |||
26 | /** |
||
27 | * @param MessageFactory|null $messageFactory |
||
28 | * @param UriFactory|null $uriFactory |
||
29 | */ |
||
30 | public function __construct(MessageFactory $messageFactory = null, UriFactory $uriFactory = null) |
||
44 | |||
45 | /** |
||
46 | * Get the MessageFactory. |
||
47 | * |
||
48 | * @return MessageFactory |
||
49 | */ |
||
50 | protected function getMessageFactory() |
||
54 | |||
55 | /** |
||
56 | * Set the MessageFactory. |
||
57 | * |
||
58 | * @param MessageFactory $messageFactory |
||
59 | * @return $this |
||
60 | */ |
||
61 | protected function setMessageFactory(MessageFactory $messageFactory) |
||
67 | |||
68 | /** |
||
69 | * Get the UriFactory. |
||
70 | * |
||
71 | * @return UriFactory |
||
72 | */ |
||
73 | protected function getUriFactory() |
||
77 | |||
78 | /** |
||
79 | * Set the UriFactory. |
||
80 | * |
||
81 | * @param UriFactory $uriFactory |
||
82 | * @return $this |
||
83 | */ |
||
84 | protected function setUriFactory(UriFactory $uriFactory) |
||
90 | |||
91 | /** |
||
92 | * Get the base url. |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | protected function getBaseUrl() |
||
100 | |||
101 | /** |
||
102 | * Set the base url. |
||
103 | * |
||
104 | * @param $baseUrl |
||
105 | * @return $this |
||
106 | */ |
||
107 | protected function setBaseUrl($baseUrl) |
||
113 | |||
114 | /** |
||
115 | * Create GET request. |
||
116 | * |
||
117 | * |
||
118 | * @param UriInterface $uri |
||
119 | * @param array $query |
||
120 | * @return \Psr\Http\Message\RequestInterface |
||
121 | */ |
||
122 | protected function get(UriInterface $uri, array $query = array()) |
||
128 | |||
129 | /** |
||
130 | * Create POST request. |
||
131 | * |
||
132 | * @param UriInterface $uri |
||
133 | * @param array $query |
||
134 | * @param array $body |
||
135 | * @return \Psr\Http\Message\RequestInterface |
||
136 | */ |
||
137 | protected function post(UriInterface $uri, array $query = array(), array $body = array()) |
||
145 | } |
||
146 |