mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-08 01:26:31 +02:00
refactor: less reliance on super globals (#4228)
This commit is contained in:
@@ -16,15 +16,8 @@ final class RssBridge
|
||||
self::$httpClient = $httpClient;
|
||||
}
|
||||
|
||||
public function main(array $argv = []): Response
|
||||
public function main(Request $request): Response
|
||||
{
|
||||
if ($argv) {
|
||||
parse_str(implode('&', array_slice($argv, 1)), $cliArgs);
|
||||
$request = Request::fromCli($cliArgs);
|
||||
} else {
|
||||
$request = Request::fromGlobals();
|
||||
}
|
||||
|
||||
foreach ($request->toArray() as $key => $value) {
|
||||
if (!is_string($value)) {
|
||||
return new Response(render(__DIR__ . '/../templates/error.html.php', [
|
||||
|
Reference in New Issue
Block a user