mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-19 06:42:14 +02:00
refactor (#4037)
This commit is contained in:
@@ -51,7 +51,6 @@ class DisplayAction implements ActionInterface
|
||||
return new Response(render(__DIR__ . '/../templates/error.html.php', ['message' => 'This bridge is not whitelisted']), 400);
|
||||
}
|
||||
|
||||
|
||||
if (
|
||||
Configuration::getConfig('proxy', 'url')
|
||||
&& Configuration::getConfig('proxy', 'by_bridge')
|
||||
@@ -62,8 +61,6 @@ class DisplayAction implements ActionInterface
|
||||
}
|
||||
|
||||
$bridge = $bridgeFactory->create($bridgeClassName);
|
||||
$formatFactory = new FormatFactory();
|
||||
$format = $formatFactory->create($format);
|
||||
|
||||
$response = $this->createResponse($request, $bridge, $format);
|
||||
|
||||
@@ -93,7 +90,7 @@ class DisplayAction implements ActionInterface
|
||||
return $response;
|
||||
}
|
||||
|
||||
private function createResponse(Request $request, BridgeAbstract $bridge, FormatAbstract $format)
|
||||
private function createResponse(Request $request, BridgeAbstract $bridge, string $format)
|
||||
{
|
||||
$items = [];
|
||||
$feed = [];
|
||||
@@ -157,6 +154,9 @@ class DisplayAction implements ActionInterface
|
||||
}
|
||||
}
|
||||
|
||||
$formatFactory = new FormatFactory();
|
||||
$format = $formatFactory->create($format);
|
||||
|
||||
$format->setItems($items);
|
||||
$format->setFeed($feed);
|
||||
$now = time();
|
||||
|
Reference in New Issue
Block a user