22/**
33 * This file is licensed under MIT License.
44 *
5- * Copyright (c) 2019 WebFiori Framework
5+ * Copyright (c) 2019-present WebFiori Framework
66 *
77 * For more information on the license, please visit:
88 * https://github.com/WebFiori/http/blob/master/LICENSE
@@ -128,13 +128,13 @@ public function addFile(string $fileIdx, string $filePath, bool $reset = false)
128128 * to mimic HTTP request headers. The keys of the array are names of headers
129129 * and the value of each key represents the value of the header.
130130 *
131- * @param UserInterface |null $user Optional user to authenticate the request with.
131+ * @param SecurityPrincipal |null $user Optional user to authenticate the request with.
132132 * to mimic HTTP request headers. The keys of the array are names of headers
133133 * and the value of each key represents the value of the header.
134134 *
135135 * @return string The method will return the output of the endpoint.
136136 */
137- public function callEndpoint (WebServicesManager $ manager , string $ requestMethod , string $ apiEndpointName , array $ parameters = [], array $ httpHeaders = [], ?UserInterface $ user = null ) : string {
137+ public function callEndpoint (WebServicesManager $ manager , string $ requestMethod , string $ apiEndpointName , array $ parameters = [], array $ httpHeaders = [], ?SecurityPrincipal $ user = null ) : string {
138138 $ method = strtoupper ($ requestMethod );
139139 $ serviceName = $ this ->resolveServiceName ($ apiEndpointName );
140140
@@ -188,7 +188,7 @@ private function resolveServiceName(string $nameOrClass): string {
188188 * to mimic HTTP request headers. The keys of the array are names of headers
189189 * and the value of each key represents the value of the header.
190190 *
191- * @param UserInterface |null $user Optional user to authenticate the request with.
191+ * @param SecurityPrincipal |null $user Optional user to authenticate the request with.
192192 */
193193 private function setupRequest (string $ method , string $ serviceName , array $ parameters , array $ httpHeaders ) {
194194 putenv ('REQUEST_METHOD= ' . $ method );
@@ -267,14 +267,14 @@ public function format(string $output) {
267267 * to mimic HTTP request headers. The keys of the array are names of headers
268268 * and the value of each key represents the value of the header.
269269 *
270- * @param UserInterface |null $user Optional user to authenticate the request with.
270+ * @param SecurityPrincipal |null $user Optional user to authenticate the request with.
271271 * to mimic HTTP request headers. The keys of the array are names of headers
272272 * and the value of each key represents the value of the header.
273273 *
274274 * @return string The method will return the output that was produced by
275275 * the endpoint as string.
276276 */
277- public function deleteRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?UserInterface $ user = null ) : string {
277+ public function deleteRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?SecurityPrincipal $ user = null ) : string {
278278 return $ this ->callEndpoint ($ manager , RequestMethod::DELETE , $ endpoint , $ parameters , $ httpHeaders , $ user );
279279 }
280280 /**
@@ -290,7 +290,7 @@ public function deleteRequest(WebServicesManager $manager, string $endpoint, arr
290290 * @return string The method will return the output that was produced by
291291 * the endpoint as string.
292292 */
293- public function getRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?UserInterface $ user = null ) : string {
293+ public function getRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?SecurityPrincipal $ user = null ) : string {
294294 return $ this ->callEndpoint ($ manager , RequestMethod::GET , $ endpoint , $ parameters , $ httpHeaders , $ user );
295295 }
296296 /**
@@ -307,14 +307,14 @@ public function getRequest(WebServicesManager $manager, string $endpoint, array
307307 * to mimic HTTP request headers. The keys of the array are names of headers
308308 * and the value of each key represents the value of the header.
309309 *
310- * @param UserInterface |null $user Optional user to authenticate the request with.
310+ * @param SecurityPrincipal |null $user Optional user to authenticate the request with.
311311 * to mimic HTTP request headers. The keys of the array are names of headers
312312 * and the value of each key represents the value of the header.
313313 *
314314 * @return string The method will return the output that was produced by
315315 * the endpoint as string.
316316 */
317- public function postRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?UserInterface $ user = null ) : string {
317+ public function postRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?SecurityPrincipal $ user = null ) : string {
318318 return $ this ->callEndpoint ($ manager , RequestMethod::POST , $ endpoint , $ parameters , $ httpHeaders , $ user );
319319 }
320320 /**
@@ -331,14 +331,14 @@ public function postRequest(WebServicesManager $manager, string $endpoint, array
331331 * to mimic HTTP request headers. The keys of the array are names of headers
332332 * and the value of each key represents the value of the header.
333333 *
334- * @param UserInterface |null $user Optional user to authenticate the request with.
334+ * @param SecurityPrincipal |null $user Optional user to authenticate the request with.
335335 * to mimic HTTP request headers. The keys of the array are names of headers
336336 * and the value of each key represents the value of the header.
337337 *
338338 * @return string The method will return the output that was produced by
339339 * the endpoint as string.
340340 */
341- public function putRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?UserInterface $ user = null ) : string {
341+ public function putRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?SecurityPrincipal $ user = null ) : string {
342342 return $ this ->callEndpoint ($ manager , RequestMethod::PUT , $ endpoint , $ parameters , $ httpHeaders , $ user );
343343 }
344344 /**
@@ -355,14 +355,14 @@ public function putRequest(WebServicesManager $manager, string $endpoint, array
355355 * to mimic HTTP request headers. The keys of the array are names of headers
356356 * and the value of each key represents the value of the header.
357357 *
358- * @param UserInterface |null $user Optional user to authenticate the request with.
358+ * @param SecurityPrincipal |null $user Optional user to authenticate the request with.
359359 * to mimic HTTP request headers. The keys of the array are names of headers
360360 * and the value of each key represents the value of the header.
361361 *
362362 * @return string The method will return the output that was produced by
363363 * the endpoint as string.
364364 */
365- public function patchRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?UserInterface $ user = null ) : string {
365+ public function patchRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?SecurityPrincipal $ user = null ) : string {
366366 return $ this ->callEndpoint ($ manager , RequestMethod::PATCH , $ endpoint , $ parameters , $ httpHeaders , $ user );
367367 }
368368 /**
@@ -379,14 +379,14 @@ public function patchRequest(WebServicesManager $manager, string $endpoint, arra
379379 * to mimic HTTP request headers. The keys of the array are names of headers
380380 * and the value of each key represents the value of the header.
381381 *
382- * @param UserInterface |null $user Optional user to authenticate the request with.
382+ * @param SecurityPrincipal |null $user Optional user to authenticate the request with.
383383 * to mimic HTTP request headers. The keys of the array are names of headers
384384 * and the value of each key represents the value of the header.
385385 *
386386 * @return string The method will return the output that was produced by
387387 * the endpoint as string.
388388 */
389- public function optionsRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?UserInterface $ user = null ) : string {
389+ public function optionsRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?SecurityPrincipal $ user = null ) : string {
390390 return $ this ->callEndpoint ($ manager , RequestMethod::OPTIONS , $ endpoint , $ parameters , $ httpHeaders , $ user );
391391 }
392392 /**
@@ -403,14 +403,14 @@ public function optionsRequest(WebServicesManager $manager, string $endpoint, ar
403403 * to mimic HTTP request headers. The keys of the array are names of headers
404404 * and the value of each key represents the value of the header.
405405 *
406- * @param UserInterface |null $user Optional user to authenticate the request with.
406+ * @param SecurityPrincipal |null $user Optional user to authenticate the request with.
407407 * to mimic HTTP request headers. The keys of the array are names of headers
408408 * and the value of each key represents the value of the header.
409409 *
410410 * @return string The method will return the output that was produced by
411411 * the endpoint as string.
412412 */
413- public function headRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?UserInterface $ user = null ) : string {
413+ public function headRequest (WebServicesManager $ manager , string $ endpoint , array $ parameters = [], array $ httpHeaders = [], ?SecurityPrincipal $ user = null ) : string {
414414 return $ this ->callEndpoint ($ manager , RequestMethod::HEAD , $ endpoint , $ parameters , $ httpHeaders , $ user );
415415 }
416416 private function extractPathAndName ($ absPath ): array {
0 commit comments