1 | <?php |
||
24 | abstract class ResourceBase implements ResourceInterface, SerializableInterface |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * @var VippsInterface |
||
29 | */ |
||
30 | protected $app; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $headers = []; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $body = ''; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $id; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $path; |
||
51 | |||
52 | /** |
||
53 | * @var \zaporylie\Vipps\Resource\HttpMethod |
||
54 | */ |
||
55 | protected $method; |
||
56 | |||
57 | /** |
||
58 | * @var \JMS\Serializer\Serializer |
||
59 | */ |
||
60 | protected $serializer; |
||
61 | |||
62 | /** |
||
63 | * AbstractResource constructor. |
||
64 | * |
||
65 | * @param \zaporylie\Vipps\VippsInterface $vipps |
||
66 | * @param string $subscription_key |
||
67 | */ |
||
68 | public function __construct(VippsInterface $vipps, $subscription_key) |
||
79 | |||
80 | /** |
||
81 | * Gets serializer value. |
||
82 | * |
||
83 | * @return \JMS\Serializer\Serializer |
||
84 | */ |
||
85 | public function getSerializer() |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function getHeaders() |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function getMethod() |
||
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | * |
||
112 | * All occurrences of {id} pattern will be replaced with $this->id |
||
113 | */ |
||
114 | public function getPath() |
||
127 | |||
128 | /** |
||
129 | * Sets path variable. |
||
130 | * |
||
131 | * @param string $path |
||
132 | * |
||
133 | * @return $this |
||
134 | */ |
||
135 | public function setPath($path) |
||
140 | |||
141 | /** |
||
142 | * @return string |
||
143 | */ |
||
144 | public function getBody() |
||
148 | |||
149 | /** |
||
150 | * @param $path |
||
151 | * |
||
152 | * @return \Psr\Http\Message\UriInterface |
||
153 | */ |
||
154 | public function getUri($path) |
||
158 | |||
159 | /** |
||
160 | * @return \Psr\Http\Message\ResponseInterface |
||
161 | * |
||
162 | * @throws \zaporylie\Vipps\Exceptions\VippsException |
||
163 | */ |
||
164 | protected function makeCall() |
||
179 | |||
180 | /** |
||
181 | * @param \Psr\Http\Message\RequestInterface $request |
||
182 | * |
||
183 | * @return \Psr\Http\Message\ResponseInterface |
||
184 | */ |
||
185 | protected function handleRequest(RequestInterface $request) |
||
203 | |||
204 | /** |
||
205 | * @return \Psr\Http\Message\RequestInterface |
||
206 | */ |
||
207 | protected function getRequest() |
||
216 | |||
217 | /** |
||
218 | * @param \Psr\Http\Message\ResponseInterface $response |
||
219 | * |
||
220 | * @return \Psr\Http\Message\ResponseInterface |
||
221 | * |
||
222 | * @throws \zaporylie\Vipps\Exceptions\VippsException |
||
223 | */ |
||
224 | protected function handleResponse($response) |
||
241 | } |
||
242 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.