From 7642d334f827d1c077bb1444dfc4e79acf022891 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 2 Jan 2018 23:53:35 +0100 Subject: Replace "keep history" magic value by a constant (#1759) I think the use of a magic value repeated many times in the code is prone to have some errors made by people not knowing its meaning. Using a constant is a bit more safe. Judging by some comments in the code, I am not the only one. --- app/Controllers/feedController.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'app/Controllers/feedController.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 2793577d5..884172112 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -317,10 +317,8 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feed_history = $feed->keepHistory(); if ($isNewFeed) { - $feed_history = -1; //∞ - } elseif ($feed_history == -2) { - // TODO: -2 must be a constant! - // -2 means we take the default value from configuration + $feed_history = FreshRSS_Feed::KEEP_HISTORY_INFINITE; + } elseif (FreshRSS_Feed::KEEP_HISTORY_DEFAULT === $feed_history) { $feed_history = FreshRSS_Context::$user_conf->keep_history_default; } $needFeedCacheRefresh = false; -- cgit v1.2.3