diff options
author | mattab <matthieu.aubry@gmail.com> | 2015-11-04 01:02:31 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2015-11-04 01:02:31 +0300 |
commit | 45e7d1e860ee25852db28b926143fc1cdfed5940 (patch) | |
tree | 13728cb644fbb257900d5a70f6c54a134f9e2a08 /core/Plugin/ControllerAdmin.php | |
parent | cef675a10832bbeadafd400c136e427435381a1a (diff) |
Refactor following code review #8156 #8193
Diffstat (limited to 'core/Plugin/ControllerAdmin.php')
-rw-r--r-- | core/Plugin/ControllerAdmin.php | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php index 8560d74ec4..6ecca10243 100644 --- a/core/Plugin/ControllerAdmin.php +++ b/core/Plugin/ControllerAdmin.php @@ -124,24 +124,23 @@ abstract class ControllerAdmin extends Controller private static function notifyWhenPhpVersionIsEOL() { - $isDeprecatedPhp = (self::isPhpVersion53() || self::isPhpVersion54()); - $notifyPhpIsEOL = Piwik::hasUserSuperUserAccess() && $isDeprecatedPhp; + $deprecatedMajorPhpVersion = null; + if(self::isPhpVersion53()) { + $deprecatedMajorPhpVersion = '5.3'; + } elseif(self::isPhpVersion54()) { + $deprecatedMajorPhpVersion = '5.4'; + } + + $notifyPhpIsEOL = Piwik::hasUserSuperUserAccess() && $deprecatedMajorPhpVersion; if (!$notifyPhpIsEOL) { return; } $nextRequiredMinimumPHP = '5.5'; - $majorPhpVersion = null; - if(self::isPhpVersion53()) { - $majorPhpVersion = '5.3'; - } elseif(self::isPhpVersion54()) { - $majorPhpVersion = '5.4'; - } - - $message = Piwik::translate('General_WarningPiwikWillStopSupportingPHPVersion', array($majorPhpVersion, $nextRequiredMinimumPHP)) + $message = Piwik::translate('General_WarningPiwikWillStopSupportingPHPVersion', array($deprecatedMajorPhpVersion, $nextRequiredMinimumPHP)) . "\n " - . Piwik::translate('General_WarningPhpVersionXIsTooOld', $majorPhpVersion); + . Piwik::translate('General_WarningPhpVersionXIsTooOld', $deprecatedMajorPhpVersion); $notification = new Notification($message); $notification->title = Piwik::translate('General_Warning'); |