|
@@ -16,7 +16,7 @@ discard block |
|
|
block discarded – undo |
|
16
|
16
|
*/ |
|
17
|
17
|
class Helper |
|
18
|
18
|
{ |
|
19
|
|
- protected static ?Interfaces\IRRTranslations $lang = null; // translations |
|
|
19
|
+ protected static ? Interfaces\IRRTranslations $lang = null; // translations |
|
20
|
20
|
protected string $link = ''; // target |
|
21
|
21
|
/** @var string|string[]|array<string|int, string|int> */ |
|
22
|
22
|
protected $postContent = ''; // what to say to the target |
|
@@ -114,7 +114,7 @@ discard block |
|
|
block discarded – undo |
|
114
|
114
|
if (false === $parsedLink) { |
|
115
|
115
|
throw new RequestException(static::getLang()->rrHelpInvalidLink($this->link)); |
|
116
|
116
|
} |
|
117
|
|
- $schema = !empty($parsedLink["scheme"]) ? strtolower($parsedLink["scheme"]) : '' ; |
|
|
117
|
+ $schema = !empty($parsedLink["scheme"]) ? strtolower($parsedLink["scheme"]) : ''; |
|
118
|
118
|
$libParams = $this->getFilledConnectionParams($schema, $parsedLink); |
|
119
|
119
|
$libQuery = $this->getLibRequest($schema, $parsedLink, $libParams); |
|
120
|
120
|
return $this->getLibResponseProcessor($schema)->setResponse( |
|
@@ -225,7 +225,7 @@ discard block |
|
|
block discarded – undo |
|
225
|
225
|
$query->maxLength = is_null($this->connectionParams['maxLength']) ? null : intval($this->connectionParams['maxLength']); |
|
226
|
226
|
return $query |
|
227
|
227
|
->setRequestSettings($settings) |
|
228
|
|
- ->setPath($parsed['path'] . (!empty($parsed['query']) ? '?' . $parsed['query'] : '' )) |
|
|
228
|
+ ->setPath($parsed['path'] . (!empty($parsed['query']) ? '?' . $parsed['query'] : '')) |
|
229
|
229
|
->setMethod($this->getMethod()) |
|
230
|
230
|
->setInline(boolval($this->connectionParams['multipart'])) |
|
231
|
231
|
->addValues(empty($this->postContent) ? [] : (array) $this->postContent) |
|
@@ -238,7 +238,7 @@ discard block |
|
|
block discarded – undo |
|
238
|
238
|
protected function getMethod(): string |
|
239
|
239
|
{ |
|
240
|
240
|
$method = strtoupper(strval($this->connectionParams['method'])); |
|
241
|
|
- return (in_array($method, ['GET', 'POST', 'PUT', 'DELETE'])) ? $method : 'GET' ; |
|
|
241
|
+ return (in_array($method, ['GET', 'POST', 'PUT', 'DELETE'])) ? $method : 'GET'; |
|
242
|
242
|
} |
|
243
|
243
|
|
|
244
|
244
|
/** |