mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-09-03 05:02:43 +02:00
Improve Factory variable names (#2895)
This commit is contained in:
@@ -57,9 +57,9 @@ class ConnectivityAction implements ActionInterface
|
||||
*/
|
||||
private function reportBridgeConnectivity($bridgeName)
|
||||
{
|
||||
$bridgeFac = new \BridgeFactory();
|
||||
$bridgeFactory = new \BridgeFactory();
|
||||
|
||||
if (!$bridgeFac->isWhitelisted($bridgeName)) {
|
||||
if (!$bridgeFactory->isWhitelisted($bridgeName)) {
|
||||
header('Content-Type: text/html');
|
||||
returnServerError('Bridge is not whitelisted!');
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class ConnectivityAction implements ActionInterface
|
||||
'http_code' => 200,
|
||||
];
|
||||
|
||||
$bridge = $bridgeFac->create($bridgeName);
|
||||
$bridge = $bridgeFactory->create($bridgeName);
|
||||
|
||||
if ($bridge === false) {
|
||||
echo json_encode($retVal);
|
||||
|
@@ -24,14 +24,14 @@ class DetectAction implements ActionInterface
|
||||
$format = $this->userData['format']
|
||||
or returnClientError('You must specify a format!');
|
||||
|
||||
$bridgeFac = new \BridgeFactory();
|
||||
$bridgeFactory = new \BridgeFactory();
|
||||
|
||||
foreach ($bridgeFac->getBridgeNames() as $bridgeName) {
|
||||
if (!$bridgeFac->isWhitelisted($bridgeName)) {
|
||||
foreach ($bridgeFactory->getBridgeNames() as $bridgeName) {
|
||||
if (!$bridgeFactory->isWhitelisted($bridgeName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$bridge = $bridgeFac->create($bridgeName);
|
||||
$bridge = $bridgeFactory->create($bridgeName);
|
||||
|
||||
if ($bridge === false) {
|
||||
continue;
|
||||
|
@@ -33,16 +33,16 @@ class DisplayAction implements ActionInterface
|
||||
$format = $this->userData['format']
|
||||
or returnClientError('You must specify a format!');
|
||||
|
||||
$bridgeFac = new \BridgeFactory();
|
||||
$bridgeFactory = new \BridgeFactory();
|
||||
|
||||
// whitelist control
|
||||
if (!$bridgeFac->isWhitelisted($bridge)) {
|
||||
if (!$bridgeFactory->isWhitelisted($bridge)) {
|
||||
throw new \Exception('This bridge is not whitelisted', 401);
|
||||
die;
|
||||
}
|
||||
|
||||
// Data retrieval
|
||||
$bridge = $bridgeFac->create($bridge);
|
||||
$bridge = $bridgeFactory->create($bridge);
|
||||
$bridge->loadConfiguration();
|
||||
|
||||
$noproxy = array_key_exists('_noproxy', $this->userData)
|
||||
@@ -99,9 +99,9 @@ class DisplayAction implements ActionInterface
|
||||
);
|
||||
|
||||
// Initialize cache
|
||||
$cacheFac = new CacheFactory();
|
||||
$cacheFactory = new CacheFactory();
|
||||
|
||||
$cache = $cacheFac->create();
|
||||
$cache = $cacheFactory->create();
|
||||
$cache->setScope('');
|
||||
$cache->purgeCache(86400); // 24 hours
|
||||
$cache->setKey($cache_params);
|
||||
@@ -205,8 +205,8 @@ class DisplayAction implements ActionInterface
|
||||
|
||||
// Data transformation
|
||||
try {
|
||||
$formatFac = new FormatFactory();
|
||||
$format = $formatFac->create($format);
|
||||
$formatFactory = new FormatFactory();
|
||||
$format = $formatFactory->create($format);
|
||||
$format->setItems($items);
|
||||
$format->setExtraInfos($infos);
|
||||
$lastModified = $cache->getTime();
|
||||
|
@@ -20,10 +20,10 @@ class ListAction implements ActionInterface
|
||||
$list->bridges = [];
|
||||
$list->total = 0;
|
||||
|
||||
$bridgeFac = new \BridgeFactory();
|
||||
$bridgeFactory = new \BridgeFactory();
|
||||
|
||||
foreach ($bridgeFac->getBridgeNames() as $bridgeName) {
|
||||
$bridge = $bridgeFac->create($bridgeName);
|
||||
foreach ($bridgeFactory->getBridgeNames() as $bridgeName) {
|
||||
$bridge = $bridgeFactory->create($bridgeName);
|
||||
|
||||
if ($bridge === false) { // Broken bridge, show as inactive
|
||||
$list->bridges[$bridgeName] = [
|
||||
@@ -33,7 +33,7 @@ class ListAction implements ActionInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
$status = $bridgeFac->isWhitelisted($bridgeName) ? 'active' : 'inactive';
|
||||
$status = $bridgeFactory->isWhitelisted($bridgeName) ? 'active' : 'inactive';
|
||||
|
||||
$list->bridges[$bridgeName] = [
|
||||
'status' => $status,
|
||||
|
Reference in New Issue
Block a user