diff --git a/app/Mage.php b/app/Mage.php index da389ece420..e504652df00 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -68,49 +68,49 @@ final class Mage * * @var array */ - static private $_registry = []; + private static $_registry = []; /** * Application root absolute path * * @var string */ - static private $_appRoot; + private static $_appRoot; /** * Application model * * @var Mage_Core_Model_App */ - static private $_app; + private static $_app; /** * Config Model * * @var Mage_Core_Model_Config */ - static private $_config; + private static $_config; /** * Event Collection Object * * @var Varien_Event_Collection */ - static private $_events; + private static $_events; /** * Object cache instance * * @var Varien_Object_Cache */ - static private $_objects; + private static $_objects; /** * Is developer mode flag * * @var bool */ - static private $_isDeveloperMode = false; + private static $_isDeveloperMode = false; /** * Is allow throw Exception about headers already sent @@ -124,7 +124,7 @@ final class Mage * * @var bool */ - static private $_isInstalled; + private static $_isInstalled; /** * Magento edition constants @@ -140,7 +140,7 @@ final class Mage * @var string * @static */ - static private $_currentEdition = self::EDITION_COMMUNITY; + private static $_currentEdition = self::EDITION_COMMUNITY; /** * Gets the current Magento version string @@ -182,9 +182,9 @@ public static function getOpenMageVersion() { $i = self::getOpenMageVersionInfo(); $versionString = "{$i['major']}.{$i['minor']}.{$i['patch']}"; - if ( $i['stability'] || $i['number'] ) { + if ($i['stability'] || $i['number']) { $versionString .= "-"; - if ( $i['stability'] && $i['number'] ) { + if ($i['stability'] && $i['number']) { $versionString .= implode('.', [$i['stability'], $i['number']]); } else { $versionString .= implode('', [$i['stability'], $i['number']]); @@ -240,7 +240,7 @@ public static function getOpenMageVersionInfo() */ public static function getEdition() { - return self::$_currentEdition; + return self::$_currentEdition; } /** @@ -508,7 +508,7 @@ public static function dispatchEvent($name, array $data = []) * * @link Mage_Core_Model_Config::getModelInstance * @param string $modelClass - * @param array|object $arguments + * @param array|string|object $arguments * @return Mage_Core_Model_Abstract|false */ public static function getModel($modelClass = '', $arguments = []) @@ -845,8 +845,7 @@ public static function log($message, $level = null, $file = '', $forceLog = fals if (empty($file)) { $file = self::getStoreConfig('dev/log/file'); } - } - catch (Exception $e) { + } catch (Exception $e) { $logActive = true; } @@ -878,7 +877,7 @@ public static function log($message, $level = null, $file = '', $forceLog = fals ',', (string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE) ); - if ( ! ($extension = pathinfo($file, PATHINFO_EXTENSION)) || ! in_array($extension, $_allowedFileExtensions)) { + if (! ($extension = pathinfo($file, PATHINFO_EXTENSION)) || ! in_array($extension, $_allowedFileExtensions)) { return; } @@ -900,8 +899,7 @@ public static function log($message, $level = null, $file = '', $forceLog = fals $writerModel = (string)self::getConfig()->getNode('global/log/core/writer_model'); if (!self::$_app || !$writerModel) { $writer = new Zend_Log_Writer_Stream($logFile); - } - else { + } else { $writer = new $writerModel($logFile); } $writer->setFormatter($formatter); @@ -914,8 +912,7 @@ public static function log($message, $level = null, $file = '', $forceLog = fals $message = addcslashes($message, 'log($message, $level); - } - catch (Exception $e) { + } catch (Exception $e) { } } @@ -973,7 +970,6 @@ public static function printException(Throwable $e, $extra = '') print $e->getTraceAsString(); print ''; } else { - $reportData = [ (!empty($extra) ? $extra . "\n\n" : '') . $e->getMessage(), $e->getTraceAsString() @@ -993,8 +989,8 @@ public static function printException(Throwable $e, $extra = '') try { $storeCode = self::app()->getStore()->getCode(); $reportData['skin'] = $storeCode; + } catch (Exception $e) { } - catch (Exception $e) {} require_once(self::getBaseDir() . DS . 'errors' . DS . 'report.php'); } @@ -1059,6 +1055,5 @@ public static function getScriptSystemUrl($folder, $exitIfNot = false) */ public static function setIsDownloader() { - } } diff --git a/app/code/core/Mage/Admin/Model/Config.php b/app/code/core/Mage/Admin/Model/Config.php index 35bc407bfbf..f8549e41174 100644 --- a/app/code/core/Mage/Admin/Model/Config.php +++ b/app/code/core/Mage/Admin/Model/Config.php @@ -43,7 +43,6 @@ public function __construct() parent::__construct(); $this->setCacheId('adminhtml_acl_menu_config'); - /** @var Varien_Simplexml_Config $adminhtmlConfig */ $adminhtmlConfig = Mage::app()->loadCache($this->getCacheId()); if ($adminhtmlConfig) { $this->_adminhtmlConfig = new Varien_Simplexml_Config($adminhtmlConfig); @@ -80,7 +79,7 @@ public function __construct() * Load Acl resources from config * * @param Mage_Admin_Model_Acl $acl - * @param Mage_Core_Model_Config_Element $resource + * @param Mage_Core_Model_Config_Element|Varien_Simplexml_Element $resource * @param string $parentName * @return $this */ diff --git a/app/code/core/Mage/Admin/Model/Observer.php b/app/code/core/Mage/Admin/Model/Observer.php index f98f45333ae..d697fb194de 100644 --- a/app/code/core/Mage/Admin/Model/Observer.php +++ b/app/code/core/Mage/Admin/Model/Observer.php @@ -70,7 +70,7 @@ public function actionPreDispatchAdmin($observer) $session->login($username, $password, $request); $request->setPost('login', null); } else { - if ($request && !$request->getParam('messageSent')) { + if (!$request->getParam('messageSent')) { Mage::getSingleton('adminhtml/session')->addError( Mage::helper('adminhtml')->__('Invalid Form Key. Please refresh the page.') ); diff --git a/app/code/core/Mage/Admin/Model/Session.php b/app/code/core/Mage/Admin/Model/Session.php index 76d287627c5..cba417c24ad 100644 --- a/app/code/core/Mage/Admin/Model/Session.php +++ b/app/code/core/Mage/Admin/Model/Session.php @@ -63,7 +63,7 @@ class Mage_Admin_Model_Session extends Mage_Core_Model_Session_Abstract /** * Whether it is the first page after successfull login * - * @var bool + * @var bool|null */ protected $_isFirstPageAfterLogin; diff --git a/app/code/core/Mage/Admin/Model/User.php b/app/code/core/Mage/Admin/Model/User.php index c2bedf1c450..de9520a0582 100644 --- a/app/code/core/Mage/Admin/Model/User.php +++ b/app/code/core/Mage/Admin/Model/User.php @@ -504,7 +504,7 @@ protected function _getHelper($helperName) /** * Find first menu item that user is able to access * - * @param Mage_Core_Model_Config_Element $parent + * @param Mage_Core_Model_Config_Element|Varien_Simplexml_Element $parent * @param string $path * @param int $level * @return string diff --git a/app/code/core/Mage/AdminNotification/Model/Feed.php b/app/code/core/Mage/AdminNotification/Model/Feed.php index 6f5d8e84cae..6260412f5ed 100644 --- a/app/code/core/Mage/AdminNotification/Model/Feed.php +++ b/app/code/core/Mage/AdminNotification/Model/Feed.php @@ -120,7 +120,7 @@ public function getFrequency() /** * Retrieve Last update time * - * @return int + * @return string|false */ public function getLastUpdate() { diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index 4ae3a039af5..7cba35203a6 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -1162,7 +1162,7 @@ public function getCache() * Loading cache data * * @param string $id - * @return mixed + * @return string|false */ public function loadCache($id) { diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index 695453c78a2..43f56c6ea73 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -366,7 +366,7 @@ public function getFrontend() * Load data from cache by id * * @param string $id - * @return string + * @return string|false */ public function load($id) { diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index 87fa1981bc6..f98dd818c12 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -1013,9 +1013,9 @@ public function determineOmittedNamespace($name, $asFullModuleName = false) * specidied xml file name to one object * * @param string $fileName - * @param null|Mage_Core_Model_Config_Base $mergeToObject + * @param null|Mage_Core_Model_Config_Base|Varien_Simplexml_Config $mergeToObject * @param null $mergeModel - * @return Mage_Core_Model_Config_Base + * @return Mage_Core_Model_Config_Base|Varien_Simplexml_Config */ public function loadModulesConfiguration($fileName, $mergeToObject = null, $mergeModel = null) { diff --git a/app/code/core/Mage/Log/Model/Visitor/Online.php b/app/code/core/Mage/Log/Model/Visitor/Online.php index 2d7aeab0242..2d19ff23522 100644 --- a/app/code/core/Mage/Log/Model/Visitor/Online.php +++ b/app/code/core/Mage/Log/Model/Visitor/Online.php @@ -66,7 +66,7 @@ public function prepare() /** * Retrieve last prepare at timestamp * - * @return int + * @return string|false */ public function getPrepareAt() { diff --git a/index.php b/index.php index dfb0bf13c44..99a912924ad 100644 --- a/index.php +++ b/index.php @@ -55,10 +55,10 @@ umask(0); /* Store or website code */ -$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : ''; +$mageRunCode = $_SERVER['MAGE_RUN_CODE'] ?? ''; /* Run store or run website */ -$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store'; +$mageRunType = $_SERVER['MAGE_RUN_TYPE'] ?? 'store'; if (file_exists($maintenanceFile)) { $maintenanceBypass = false; diff --git a/lib/Varien/Cache/Core.php b/lib/Varien/Cache/Core.php index ddaaa298df2..c75775c2e68 100644 --- a/lib/Varien/Cache/Core.php +++ b/lib/Varien/Cache/Core.php @@ -155,7 +155,7 @@ public function load($id, $doNotTestCacheValidity = false, $doNotUnserialize = f // Seems we've got chunked data $arr = explode('|', $data); - $chunks = isset($arr[1]) ? $arr[1] : false; + $chunks = $arr[1] ?? false; $chunkData = []; if ($chunks && is_numeric($chunks)) {