aboutsummaryrefslogtreecommitdiff
path: root/app/Models/ConfigurationSetter.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2018-01-02 23:53:35 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-01-02 23:53:35 +0100
commit7642d334f827d1c077bb1444dfc4e79acf022891 (patch)
tree904bb76cc119ff6d7a806cefd3c1fabbdebf2233 /app/Models/ConfigurationSetter.php
parente3ffc048d7a10a6116cf80fb6fceda0b4037368c (diff)
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.
Diffstat (limited to 'app/Models/ConfigurationSetter.php')
-rw-r--r--app/Models/ConfigurationSetter.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php
index ca4709903..645ef644e 100644
--- a/app/Models/ConfigurationSetter.php
+++ b/app/Models/ConfigurationSetter.php
@@ -81,7 +81,7 @@ class FreshRSS_ConfigurationSetter {
private function _keep_history_default(&$data, $value) {
$value = intval($value);
- $data['keep_history_default'] = $value >= -1 ? $value : 0;
+ $data['keep_history_default'] = $value >= FreshRSS_Feed::KEEP_HISTORY_INFINITE ? $value : 0;
}
// It works for system config too!
@@ -154,7 +154,7 @@ class FreshRSS_ConfigurationSetter {
private function _ttl_default(&$data, $value) {
$value = intval($value);
- $data['ttl_default'] = $value >= -1 ? $value : 3600;
+ $data['ttl_default'] = $value > FreshRSS_Feed::TTL_DEFAULT ? $value : 3600;
}
private function _view_mode(&$data, $value) {