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.
This commit is contained in:
Alexis Degrugillier
2018-01-02 23:53:35 +01:00
committed by Alexandre Alapetite
parent e3ffc048d7
commit 7642d334f8
8 changed files with 17 additions and 17 deletions

View File

@@ -177,9 +177,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
foreach ($feeds as $feed) {
$feed_history = $feed->keepHistory();
if ($feed_history == -2) {
// TODO: -2 must be a constant!
// -2 means we take the default value from configuration
if (FreshRSS_Feed::KEEP_HISTORY_DEFAULT === $feed_history) {
$feed_history = FreshRSS_Context::$user_conf->keep_history_default;
}