From 222dd3b84a374fd4d665643e5b1b0e7c54c47ee8 Mon Sep 17 00:00:00 2001 From: sreichel Date: Sun, 2 Jun 2019 14:49:26 +0200 Subject: [PATCH 1/5] Mage_Core - DOC block update --- app/code/core/Mage/Core/Block/Abstract.php | 78 ++-- app/code/core/Mage/Core/Block/Flush.php | 6 +- .../core/Mage/Core/Block/Html/Calendar.php | 6 +- app/code/core/Mage/Core/Block/Html/Date.php | 25 +- app/code/core/Mage/Core/Block/Html/Select.php | 13 +- app/code/core/Mage/Core/Block/Messages.php | 7 +- app/code/core/Mage/Core/Block/Profiler.php | 4 +- .../core/Mage/Core/Block/Store/Switcher.php | 27 ++ app/code/core/Mage/Core/Block/Template.php | 14 +- .../core/Mage/Core/Block/Template/Zend.php | 27 +- app/code/core/Mage/Core/Block/Text.php | 27 +- app/code/core/Mage/Core/Block/Text/List.php | 4 +- .../core/Mage/Core/Block/Text/List/Item.php | 12 +- .../core/Mage/Core/Block/Text/List/Link.php | 13 +- app/code/core/Mage/Core/Block/Text/Tag.php | 24 +- .../core/Mage/Core/Block/Text/Tag/Css.php | 13 +- .../Mage/Core/Block/Text/Tag/Css/Admin.php | 12 +- .../core/Mage/Core/Block/Text/Tag/Debug.php | 9 +- app/code/core/Mage/Core/Block/Text/Tag/Js.php | 12 +- .../core/Mage/Core/Block/Text/Tag/Meta.php | 12 +- .../Mage/Core/Controller/Front/Action.php | 5 +- .../Mage/Core/Controller/Front/Router.php | 25 +- .../Mage/Core/Controller/Request/Http.php | 41 ++- .../Mage/Core/Controller/Response/Http.php | 12 +- .../Mage/Core/Controller/Varien/Action.php | 95 +++-- .../Mage/Core/Controller/Varien/Front.php | 38 +- .../Controller/Varien/Router/Abstract.php | 19 + .../Core/Controller/Varien/Router/Admin.php | 5 +- .../Controller/Varien/Router/Standard.php | 67 +++- app/code/core/Mage/Core/Exception.php | 10 +- app/code/core/Mage/Core/Helper/Abstract.php | 16 +- app/code/core/Mage/Core/Helper/Data.php | 80 +++-- .../core/Mage/Core/Helper/File/Storage.php | 2 +- .../Core/Helper/File/Storage/Database.php | 9 +- app/code/core/Mage/Core/Helper/Http.php | 7 +- app/code/core/Mage/Core/Helper/Js.php | 10 +- app/code/core/Mage/Core/Helper/String.php | 17 +- app/code/core/Mage/Core/Helper/Url.php | 4 +- app/code/core/Mage/Core/Model/Abstract.php | 58 +-- app/code/core/Mage/Core/Model/App.php | 105 +++--- app/code/core/Mage/Core/Model/App/Area.php | 23 +- .../core/Mage/Core/Model/App/Emulation.php | 17 +- app/code/core/Mage/Core/Model/Cache.php | 14 +- app/code/core/Mage/Core/Model/Config.php | 103 +++--- app/code/core/Mage/Core/Model/Config/Base.php | 3 +- app/code/core/Mage/Core/Model/Config/Data.php | 17 +- .../core/Mage/Core/Model/Config/Element.php | 3 - .../core/Mage/Core/Model/Config/Options.php | 62 ++++ .../core/Mage/Core/Model/Config/System.php | 9 +- app/code/core/Mage/Core/Model/Convert.php | 5 +- app/code/core/Mage/Core/Model/Cookie.php | 7 +- app/code/core/Mage/Core/Model/Date.php | 13 +- app/code/core/Mage/Core/Model/Design.php | 19 +- .../core/Mage/Core/Model/Design/Config.php | 3 +- .../core/Mage/Core/Model/Design/Fallback.php | 6 +- .../core/Mage/Core/Model/Design/Package.php | 102 ++++-- .../Mage/Core/Model/Design/Source/Apply.php | 3 + .../Mage/Core/Model/Design/Source/Design.php | 3 +- .../core/Mage/Core/Model/Domainpolicy.php | 9 +- app/code/core/Mage/Core/Model/Email.php | 38 +- app/code/core/Mage/Core/Model/Email/Queue.php | 27 +- .../core/Mage/Core/Model/Email/Template.php | 84 +++-- .../Core/Model/Email/Template/Abstract.php | 14 +- .../Mage/Core/Model/Email/Template/Filter.php | 13 +- .../Mage/Core/Model/Email/Template/Mailer.php | 4 +- .../core/Mage/Core/Model/File/Storage.php | 5 +- .../Mage/Core/Model/File/Storage/Abstract.php | 2 +- .../Mage/Core/Model/File/Storage/Database.php | 14 +- .../Model/File/Storage/Database/Abstract.php | 12 +- .../Model/File/Storage/Directory/Database.php | 13 +- .../core/Mage/Core/Model/File/Uploader.php | 6 +- .../File/Validator/NotProtectedExtension.php | 2 +- app/code/core/Mage/Core/Model/Flag.php | 11 +- .../core/Mage/Core/Model/Input/Filter.php | 4 +- app/code/core/Mage/Core/Model/Language.php | 2 +- app/code/core/Mage/Core/Model/Layout.php | 27 +- .../core/Mage/Core/Model/Layout/Element.php | 24 +- .../core/Mage/Core/Model/Layout/Update.php | 67 +++- app/code/core/Mage/Core/Model/Locale.php | 40 ++- app/code/core/Mage/Core/Model/Log/Adapter.php | 9 +- app/code/core/Mage/Core/Model/Message.php | 51 ++- .../core/Mage/Core/Model/Message/Abstract.php | 29 +- .../Mage/Core/Model/Message/Collection.php | 7 + .../core/Mage/Core/Model/Message/Error.php | 4 +- .../core/Mage/Core/Model/Message/Notice.php | 5 +- .../core/Mage/Core/Model/Message/Success.php | 4 +- .../core/Mage/Core/Model/Message/Warning.php | 4 +- .../Model/Mysql4/Design/Theme/Collection.php | 10 + app/code/core/Mage/Core/Model/Observer.php | 5 +- app/code/core/Mage/Core/Model/Resource.php | 23 +- .../Mage/Core/Model/Resource/Abstract.php | 16 +- .../Mage/Core/Model/Resource/Config/Data.php | 7 +- .../Mage/Core/Model/Resource/Db/Abstract.php | 55 ++- .../Model/Resource/Db/Collection/Abstract.php | 53 +-- .../core/Mage/Core/Model/Resource/Design.php | 17 +- .../Core/Model/Resource/Design/Collection.php | 5 +- .../Mage/Core/Model/Resource/Email/Queue.php | 9 +- .../Core/Model/Resource/Email/Template.php | 2 +- .../Resource/Email/Template/Collection.php | 2 +- .../Model/Resource/File/Storage/Database.php | 25 +- .../File/Storage/Directory/Database.php | 29 +- .../Core/Model/Resource/File/Storage/File.php | 8 +- .../Core/Model/Resource/Helper/Abstract.php | 2 +- .../Core/Model/Resource/Helper/Mysql4.php | 6 +- .../core/Mage/Core/Model/Resource/Layout.php | 8 +- .../Mage/Core/Model/Resource/Resource.php | 8 +- .../core/Mage/Core/Model/Resource/Setup.php | 32 +- .../Model/Resource/Setup/Query/Modifier.php | 6 +- .../core/Mage/Core/Model/Resource/Store.php | 18 +- .../Core/Model/Resource/Store/Collection.php | 6 +- .../Mage/Core/Model/Resource/Store/Group.php | 6 +- .../Model/Resource/Store/Group/Collection.php | 4 +- .../Mage/Core/Model/Resource/Transaction.php | 2 - .../Mage/Core/Model/Resource/Translate.php | 3 +- .../Core/Model/Resource/Translate/String.php | 31 +- .../core/Mage/Core/Model/Resource/Type/Db.php | 2 +- .../Core/Model/Resource/Type/Db/Mysqli.php | 5 +- .../Model/Resource/Type/Db/Mysqli/Setup.php | 7 +- .../Core/Model/Resource/Type/Db/Pdo/Mysql.php | 2 - .../Mage/Core/Model/Resource/Url/Rewrite.php | 4 +- .../Model/Resource/Url/Rewrite/Collection.php | 3 +- .../Mage/Core/Model/Resource/Variable.php | 31 +- .../Model/Resource/Variable/Collection.php | 3 +- .../core/Mage/Core/Model/Resource/Website.php | 21 +- .../Model/Resource/Website/Collection.php | 11 +- app/code/core/Mage/Core/Model/Session.php | 13 +- .../core/Mage/Core/Model/Session/Abstract.php | 15 +- .../Core/Model/Session/Abstract/Varien.php | 9 +- .../Mage/Core/Model/Session/Abstract/Zend.php | 30 +- app/code/core/Mage/Core/Model/Store.php | 58 +-- app/code/core/Mage/Core/Model/Store/Group.php | 39 +- app/code/core/Mage/Core/Model/Template.php | 7 +- app/code/core/Mage/Core/Model/Translate.php | 65 ++-- .../core/Mage/Core/Model/Translate/Expr.php | 22 +- .../core/Mage/Core/Model/Translate/Inline.php | 15 +- .../core/Mage/Core/Model/Translate/String.php | 14 +- app/code/core/Mage/Core/Model/Url.php | 32 +- app/code/core/Mage/Core/Model/Url/Rewrite.php | 60 +++- .../Mage/Core/Model/Url/Rewrite/Request.php | 8 +- app/code/core/Mage/Core/Model/Variable.php | 16 +- app/code/core/Mage/Core/Model/Website.php | 44 ++- .../Mage/Core/controllers/AjaxController.php | 5 +- .../Mage/Core/controllers/IndexController.php | 3 +- app/code/core/Mage/Core/functions.php | 71 +++- .../Core/sql/core_setup/install-1.6.0.0.php | 339 ++++++++++++------ .../mysql4-data-upgrade-1.6.0.2-1.6.0.3.php | 2 +- .../sql/core_setup/mysql4-install-0.7.0.php | 2 +- .../sql/core_setup/mysql4-install-0.8.0.php | 2 +- .../mysql4-upgrade-0.6.26-0.7.0.php | 2 +- .../core_setup/mysql4-upgrade-0.7.1-0.7.2.php | 2 +- .../core_setup/mysql4-upgrade-0.7.2-0.7.3.php | 2 +- .../core_setup/mysql4-upgrade-0.7.3-0.7.4.php | 2 +- .../core_setup/mysql4-upgrade-0.7.4-0.7.5.php | 11 +- .../core_setup/mysql4-upgrade-0.7.5-0.7.6.php | 2 +- .../core_setup/mysql4-upgrade-0.7.6-0.7.7.php | 2 +- .../core_setup/mysql4-upgrade-0.7.7-0.7.8.php | 2 +- .../core_setup/mysql4-upgrade-0.7.8-0.7.9.php | 4 +- .../core_setup/mysql4-upgrade-0.8.0-0.8.1.php | 2 +- .../core_setup/mysql4-upgrade-0.8.1-0.8.2.php | 2 +- .../mysql4-upgrade-0.8.10-0.8.11.php | 8 +- .../mysql4-upgrade-0.8.11-0.8.12.php | 14 +- .../mysql4-upgrade-0.8.12-0.8.13.php | 16 +- .../mysql4-upgrade-0.8.13-0.8.14.php | 2 +- .../mysql4-upgrade-0.8.14-0.8.15.php | 2 +- .../mysql4-upgrade-0.8.15-0.8.16.php | 6 +- .../mysql4-upgrade-0.8.16-0.8.17.php | 2 +- .../mysql4-upgrade-0.8.17-0.8.18.php | 17 +- .../mysql4-upgrade-0.8.18-0.8.19.php | 20 +- .../mysql4-upgrade-0.8.19-0.8.20.php | 16 +- .../core_setup/mysql4-upgrade-0.8.2-0.8.3.php | 2 +- .../mysql4-upgrade-0.8.20-0.8.21.php | 2 +- .../mysql4-upgrade-0.8.21-0.8.22.php | 2 +- .../mysql4-upgrade-0.8.22-0.8.23.php | 15 +- .../mysql4-upgrade-0.8.23-0.8.24.php | 2 +- .../mysql4-upgrade-0.8.24-0.8.25.php | 6 +- .../mysql4-upgrade-0.8.26-0.8.27.php | 2 +- .../mysql4-upgrade-0.8.27-0.8.28.php | 2 +- .../core_setup/mysql4-upgrade-0.8.3-0.8.4.php | 2 +- .../core_setup/mysql4-upgrade-0.8.4-0.8.5.php | 2 +- .../core_setup/mysql4-upgrade-0.8.5-0.8.6.php | 5 +- .../core_setup/mysql4-upgrade-0.8.6-0.8.7.php | 2 +- .../core_setup/mysql4-upgrade-0.8.7-0.8.8.php | 2 +- .../core_setup/mysql4-upgrade-0.8.8-0.8.9.php | 7 +- .../mysql4-upgrade-0.8.9-0.8.10.php | 2 +- .../mysql4-upgrade-1.5.9.9-1.6.0.0.php | 2 +- .../core_setup/upgrade-1.6.0.1-1.6.0.2.php | 2 +- .../core_setup/upgrade-1.6.0.2-1.6.0.3.php | 2 +- .../core_setup/upgrade-1.6.0.3-1.6.0.4.php | 2 +- .../core_setup/upgrade-1.6.0.5-1.6.0.6.php | 32 +- .../core_setup/upgrade-1.6.0.6-1.6.0.7.php | 2 +- .../core_setup/upgrade-1.6.0.7-1.6.0.8.php | 2 +- 191 files changed, 2351 insertions(+), 1155 deletions(-) diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index 7b020c4129e..9e96f819f97 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -88,7 +88,7 @@ abstract class Mage_Core_Block_Abstract extends Varien_Object /** * Contains references to child block objects * - * @var array + * @var Mage_Core_Block_Abstract[] */ protected $_children = array(); @@ -255,7 +255,7 @@ public function getRequest() /** * Retrieve parent block * - * @return Mage_Core_Block_Abstract + * @return $this */ public function getParentBlock() { @@ -266,7 +266,7 @@ public function getParentBlock() * Set parent block * * @param Mage_Core_Block_Abstract $block - * @return Mage_Core_Block_Abstract + * @return $this */ public function setParentBlock(Mage_Core_Block_Abstract $block) { @@ -288,7 +288,7 @@ public function getAction() * Set layout object * * @param Mage_Core_Model_Layout $layout - * @return Mage_Core_Block_Abstract + * @return $this */ public function setLayout(Mage_Core_Model_Layout $layout) { @@ -304,7 +304,7 @@ public function setLayout(Mage_Core_Model_Layout $layout) * * You can redefine this method in child classes for changing layout * - * @return Mage_Core_Block_Abstract + * @return $this */ protected function _prepareLayout() { @@ -334,7 +334,7 @@ public function getIsAnonymous() * Set the anonymous flag * * @param bool $flag - * @return Mage_Core_Block_Abstract + * @return $this */ public function setIsAnonymous($flag) { @@ -356,7 +356,7 @@ public function getAnonSuffix() * Set anonymous suffix for current block * * @param string $suffix - * @return Mage_Core_Block_Abstract + * @return $this */ public function setAnonSuffix($suffix) { @@ -378,7 +378,7 @@ public function getBlockAlias() * Set block alias * * @param string $alias - * @return Mage_Core_Block_Abstract + * @return $this */ public function setBlockAlias($alias) { @@ -390,7 +390,7 @@ public function setBlockAlias($alias) * Set block's name in layout and unsets previous link if such exists. * * @param string $name - * @return Mage_Core_Block_Abstract + * @return $this */ public function setNameInLayout($name) { @@ -420,7 +420,7 @@ public function getSortedChildren() * * @param string $name * @param mixed $value - * @return Mage_Core_Block_Abstract + * @return $this */ public function setAttribute($name, $value = null) { @@ -432,7 +432,7 @@ public function setAttribute($name, $value = null) * * @param string $alias * @param Mage_Core_Block_Abstract $block - * @return Mage_Core_Block_Abstract + * @return $this */ public function setChild($alias, $block) { @@ -473,7 +473,7 @@ public function setChild($alias, $block) * Unset child block * * @param string $alias - * @return Mage_Core_Block_Abstract + * @return $this */ public function unsetChild($alias) { @@ -508,7 +508,7 @@ public function unsetChild($alias) * @param string $callback * @param mixed $result * @param array $params - * @return Mage_Core_Block_Abstract + * @return $this */ public function unsetCallChild($alias, $callback, $result, $params) { @@ -532,7 +532,7 @@ public function unsetCallChild($alias, $callback, $result, $params) /** * Unset all children blocks * - * @return Mage_Core_Block_Abstract + * @return $this */ public function unsetChildren() { @@ -737,7 +737,7 @@ public function insert($block, $siblingName = '', $after = false, $alias = '') * Sort block's children * * @param boolean $force force re-sort all children - * @return Mage_Core_Block_Abstract + * @return $this */ public function sortChildren($force = false) { @@ -784,7 +784,7 @@ public function sortChildren($force = false) * * @param Mage_Core_Block_Abstract|string $block * @param string $alias - * @return Mage_Core_Block_Abstract + * @return $this */ public function append($block, $alias = '') { @@ -812,7 +812,7 @@ public function addToChildGroup($groupName, Mage_Core_Block_Abstract $child) * Add self to the specified group of parent block * * @param string $groupName - * @return Mage_Core_Block_Abstract + * @return $this */ public function addToParentGroup($groupName) { @@ -849,7 +849,6 @@ public function getChildGroup($groupName, $callback = null, $skipEmptyResults = } else { $result[$alias] = $block; } - } } return $result; @@ -873,7 +872,7 @@ public function getChildData($alias, $key = '') /** * Before rendering html, but after trying to load cache * - * @return Mage_Core_Block_Abstract + * @return $this */ protected function _beforeToHtml() { @@ -885,7 +884,7 @@ protected function _beforeToHtml() * * @param $openTag * @param $closeTag - * @return Mage_Core_Block_Abstract + * @return $this */ public function setFrameTags($openTag, $closeTag = null) { @@ -914,7 +913,7 @@ final public function toHtml() $html = $this->_loadCache(); if ($html === false) { $translate = Mage::getSingleton('core/translate'); - /** @var $translate Mage_Core_Model_Translate */ + /** @var Mage_Core_Model_Translate $translate */ if ($this->hasData('translate_inline')) { $translate->setTranslateInline($this->getData('translate_inline')); } @@ -942,10 +941,12 @@ final public function toHtml() if (self::$_transportObject === null) { self::$_transportObject = new Varien_Object; } - self::$_transportObject->setHtml($html); - Mage::dispatchEvent('core_block_abstract_to_html_after', - array('block' => $this, 'transport' => self::$_transportObject)); - $html = self::$_transportObject->getHtml(); + self::$_transportObject->setData('html', $html); + Mage::dispatchEvent( + 'core_block_abstract_to_html_after', + array('block' => $this, 'transport' => self::$_transportObject) + ); + $html = self::$_transportObject->getData('html'); return $html; } @@ -1072,7 +1073,7 @@ public function getMessagesBlock() * Set messages block * * @param Mage_Core_Block_Messages $block - * @return Mage_Core_Block_Abstract + * @return $this */ public function setMessagesBlock(Mage_Core_Block_Messages $block) { @@ -1084,7 +1085,7 @@ public function setMessagesBlock(Mage_Core_Block_Messages $block) * Return block helper * * @param string $type - * @return Mage_Core_Block_Abstract + * @return $this */ public function getHelper($type) { @@ -1161,8 +1162,11 @@ public function __() } /** - * @deprecated after 1.4.0.0-rc1 + * @param string|array $data + * @param array $allowedTags + * @return string * @see self::escapeHtml() + * @deprecated after 1.4.0.0-rc1 */ public function htmlEscape($data, $allowedTags = null) { @@ -1172,7 +1176,7 @@ public function htmlEscape($data, $allowedTags = null) /** * Escape html entities * - * @param mixed $data + * @param string|array $data * @param array $allowedTags * @return string */ @@ -1195,6 +1199,8 @@ public function stripTags($data, $allowableTags = null, $allowHtmlEntities = fal } /** + * @param string $data + * @return string * @deprecated after 1.4.0.0-rc1 * @see self::escapeUrl() */ @@ -1261,7 +1267,7 @@ public function countChildren() /** * Prepare url for save to cache * - * @return Mage_Core_Block_Abstract + * @return $this */ protected function _beforeCacheUrl() { @@ -1353,7 +1359,7 @@ public function getCacheTags() * Add tag to block * * @param string|array $tag - * @return Mage_Core_Block_Abstract + * @return $this */ public function addCacheTag($tag) { @@ -1368,7 +1374,7 @@ public function addCacheTag($tag) * Add tags from specified model to current block * * @param Mage_Core_Model_Abstract $model - * @return Mage_Core_Block_Abstract + * @return $this */ public function addModelTags(Mage_Core_Model_Abstract $model) { @@ -1404,7 +1410,7 @@ protected function _loadCache() return false; } $cacheKey = $this->getCacheKey(); - /** @var $session Mage_Core_Model_Session */ + /** @var Mage_Core_Model_Session $session */ $session = Mage::getSingleton('core/session'); $cacheData = $this->_getApp()->loadCache($cacheKey); if ($cacheData) { @@ -1421,7 +1427,7 @@ protected function _loadCache() * Save block content to cache storage * * @param string $data - * @return Mage_Core_Block_Abstract + * @return $this|false */ protected function _saveCache($data) { @@ -1429,7 +1435,7 @@ protected function _saveCache($data) return false; } $cacheKey = $this->getCacheKey(); - /** @var $session Mage_Core_Model_Session */ + /** @var Mage_Core_Model_Session $session */ $session = Mage::getSingleton('core/session'); $data = str_replace( $session->getSessionIdQueryParam() . '=' . $session->getEncryptedSessionId(), @@ -1487,7 +1493,7 @@ protected function _getSidPlaceholder($cacheKey = null) public function getItemsTags($items) { $tags = array(); - /** @var $item Mage_Core_Model_Abstract */ + /** @var Mage_Core_Model_Abstract $item */ foreach ($items as $item) { $itemTags = $item->getCacheIdTags(); if (false === $itemTags) { diff --git a/app/code/core/Mage/Core/Block/Flush.php b/app/code/core/Mage/Core/Block/Flush.php index 416a11c06f7..c93b7729a96 100644 --- a/app/code/core/Mage/Core/Block/Flush.php +++ b/app/code/core/Mage/Core/Block/Flush.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Immediate flush block. To be used only as root * @@ -32,7 +31,9 @@ */ class Mage_Core_Block_Flush extends Mage_Core_Block_Abstract { - + /** + * @return string + */ protected function _toHtml() { if (!$this->_beforeToHtml()) { @@ -49,5 +50,4 @@ protected function _toHtml() echo $block->toHtml(); } } - } diff --git a/app/code/core/Mage/Core/Block/Html/Calendar.php b/app/code/core/Mage/Core/Block/Html/Calendar.php index 2648b432ac5..dbbea1c0270 100644 --- a/app/code/core/Mage/Core/Block/Html/Calendar.php +++ b/app/code/core/Mage/Core/Block/Html/Calendar.php @@ -34,6 +34,10 @@ */ class Mage_Core_Block_Html_Calendar extends Mage_Core_Block_Template { + /** + * @return string + * @throws Zend_Locale_Exception + */ protected function _toHtml() { $localeCode = Mage::app()->getLocale()->getLocaleCode(); @@ -61,7 +65,7 @@ protected function _toHtml() $this->assign('pm', Mage::helper('core')->jsonEncode(Zend_Locale_Data::getContent($localeCode, 'pm'))); // get first day of week and weekend days - $this->assign('firstDay', (int)Mage::getStoreConfig('general/locale/firstday')); + $this->assign('firstDay', (int)Mage::getStoreConfig('general/locale/firstday')); $this->assign('weekendDays', Mage::helper('core')->jsonEncode((string)Mage::getStoreConfig('general/locale/weekend'))); // define default format and tooltip format diff --git a/app/code/core/Mage/Core/Block/Html/Date.php b/app/code/core/Mage/Core/Block/Html/Date.php index 16768cc674c..7e20a580449 100644 --- a/app/code/core/Mage/Core/Block/Html/Date.php +++ b/app/code/core/Mage/Core/Block/Html/Date.php @@ -24,17 +24,27 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * HTML select element block * * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method string getClass() + * @method string getExtraParams() + * @method string getFormat() + * @method string getImage() + * @method string getName() + * @method string getTime() + * @method string getValue() + * @method string getYearsRange() */ class Mage_Core_Block_Html_Date extends Mage_Core_Block_Template { - + /** + * @return string + */ protected function _toHtml() { $displayFormat = Varien_Date::convertZendToStrftime($this->getFormat(), true, (bool)$this->getTime()); @@ -73,7 +83,12 @@ protected function _toHtml() return $html; } - public function getEscapedValue($index=null) { + /** + * @param null $index + * @return string + */ + public function getEscapedValue($index = null) + { if($this->getFormat() && $this->getValue()) { return strftime($this->getFormat(), strtotime($this->getValue())); @@ -82,9 +97,11 @@ public function getEscapedValue($index=null) { return htmlspecialchars($this->getValue()); } + /** + * @return string + */ public function getHtml() { return $this->toHtml(); } - } diff --git a/app/code/core/Mage/Core/Block/Html/Select.php b/app/code/core/Mage/Core/Block/Html/Select.php index a28184c7bca..7dde8c50c11 100644 --- a/app/code/core/Mage/Core/Block/Html/Select.php +++ b/app/code/core/Mage/Core/Block/Html/Select.php @@ -24,17 +24,20 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * HTML select element block * * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method string getExtraParams() + * @method string getName() + * @method string getValue() + * @method bool getIsRenderToJsTemplate() */ class Mage_Core_Block_Html_Select extends Mage_Core_Block_Abstract { - protected $_options = array(); /** @@ -232,11 +235,13 @@ protected function _optionToHtml($option, $selected = false) } } - return sprintf('', + return sprintf( + '', $this->escapeHtml($option['value']), $selectedHtml, $params, - $this->escapeHtml($option['label'])); + $this->escapeHtml($option['label']) + ); } /** diff --git a/app/code/core/Mage/Core/Block/Messages.php b/app/code/core/Mage/Core/Block/Messages.php index 3160f5e8593..b0f2a358e26 100644 --- a/app/code/core/Mage/Core/Block/Messages.php +++ b/app/code/core/Mage/Core/Block/Messages.php @@ -75,6 +75,9 @@ class Mage_Core_Block_Messages extends Mage_Core_Block_Template */ protected $_usedStorageTypes = array('core/session'); + /** + * @inheritDoc + */ public function _prepareLayout() { $this->addMessages(Mage::getSingleton('core/session')->getMessages(true)); @@ -223,7 +226,6 @@ public function getHtml($type=null) /** * Retrieve messages in HTML format grouped by type * - * @param string $type * @return string */ public function getGroupedHtml() @@ -260,6 +262,9 @@ public function getGroupedHtml() return $html; } + /** + * @return string + */ protected function _toHtml() { return $this->getGroupedHtml(); diff --git a/app/code/core/Mage/Core/Block/Profiler.php b/app/code/core/Mage/Core/Block/Profiler.php index 9ff32b9c88d..1e65fab5c8f 100644 --- a/app/code/core/Mage/Core/Block/Profiler.php +++ b/app/code/core/Mage/Core/Block/Profiler.php @@ -24,9 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Block_Profiler extends Mage_Core_Block_Abstract { + /** + * @return string + */ protected function _toHtml() { if (!$this->_beforeToHtml() diff --git a/app/code/core/Mage/Core/Block/Store/Switcher.php b/app/code/core/Mage/Core/Block/Store/Switcher.php index 57a289dd8bf..f667d50a488 100644 --- a/app/code/core/Mage/Core/Block/Store/Switcher.php +++ b/app/code/core/Mage/Core/Block/Store/Switcher.php @@ -30,6 +30,11 @@ * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method array getLanguages() + * @method $this setLanguages(array $value) + * @method array getStores() + * @method $this setStores(array $value) */ class Mage_Core_Block_Store_Switcher extends Mage_Core_Block_Template { @@ -45,6 +50,10 @@ public function __construct() return parent::__construct(); } + /** + * @return $this + * @throws Mage_Core_Model_Store_Exception + */ protected function _loadData() { if ($this->_loaded) { @@ -58,9 +67,11 @@ protected function _loadData() $groupCollection = Mage::getModel('core/store_group') ->getCollection() ->addWebsiteFilter($websiteId); + /** @var Mage_Core_Model_Store_Group $group */ foreach ($groupCollection as $group) { $this->_groups[$group->getId()] = $group; } + /** @var Mage_Core_Model_Store $store */ foreach ($storeCollection as $store) { if (!$store->getIsActive()) { continue; @@ -74,6 +85,9 @@ protected function _loadData() return $this; } + /** + * @return int + */ public function getStoreCount() { $stores = array(); @@ -83,6 +97,7 @@ public function getStoreCount() continue; } $useStore = false; + /** @var Mage_Core_Model_Store $store */ foreach ($this->_stores[$group->getId()] as $store) { if ($store->getLocaleCode() == $localeCode) { $useStore = true; @@ -98,6 +113,10 @@ public function getStoreCount() return count($this->getStores()); } + /** + * @return int + * @throws Mage_Core_Model_Store_Exception + */ public function getLanguageCount() { $groupId = Mage::app()->getStore()->getGroupId(); @@ -109,11 +128,19 @@ public function getLanguageCount() return count($this->getLanguages()); } + /** + * @return int + * @throws Mage_Core_Model_Store_Exception + */ public function getCurrentStoreId() { return Mage::app()->getStore()->getId(); } + /** + * @return string + * @throws Mage_Core_Model_Store_Exception + */ public function getCurrentStoreCode() { return Mage::app()->getStore()->getCode(); diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php index 9c39a2dc337..c3a6ba51a57 100644 --- a/app/code/core/Mage/Core/Block/Template.php +++ b/app/code/core/Mage/Core/Block/Template.php @@ -24,13 +24,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Base html block * * @category Mage * @package Mage_Core - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Core_Block_Template extends Mage_Core_Block_Abstract { @@ -152,8 +151,7 @@ public function assign($key, $value=null) foreach ($key as $k=>$v) { $this->assign($k, $v); } - } - else { + } else { $this->_viewVars[$key] = $value; } return $this; @@ -189,6 +187,9 @@ public function getDirectOutput() return false; } + /** + * @return bool + */ public function getShowTemplateHints() { if (is_null(self::$_showTemplateHints)) { @@ -243,7 +244,6 @@ public function fetchView($fileName) $thisClass = get_class($this); Mage::log('Not valid template file:' . $fileName . ' class: ' . $thisClass, Zend_Log::CRIT, null, true); } - } catch (Exception $e) { ob_get_clean(); throw $e; @@ -330,9 +330,7 @@ public function getObjectData(Varien_Object $object, $key) } /** - * Get cache key informative items - * - * @return array + * @inheritDoc */ public function getCacheKeyInfo() { diff --git a/app/code/core/Mage/Core/Block/Template/Zend.php b/app/code/core/Mage/Core/Block/Template/Zend.php index fdea576eecc..6f84c6eba4a 100644 --- a/app/code/core/Mage/Core/Block/Template/Zend.php +++ b/app/code/core/Mage/Core/Block/Template/Zend.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Zend html block * @@ -34,14 +33,13 @@ */ class Mage_Core_Block_Template_Zend extends Mage_Core_Block_Template { - + /** + * @var Zend_View + */ protected $_view = null; /** * Class constructor. Base html block - * - * @param none - * @return void */ function _construct() { @@ -49,10 +47,16 @@ function _construct() $this->_view = new Zend_View(); } - public function assign($key, $value=null) + /** + * @param array|string $key + * @param null $value + * @return $this|Mage_Core_Block_Template + * @throws Zend_View_Exception + */ + public function assign($key, $value = null) { if (is_array($key) && is_null($value)) { - foreach ($key as $k=>$v) { + foreach ($key as $k => $v) { $this->assign($k, $v); } } elseif (!is_null($value)) { @@ -61,14 +65,21 @@ public function assign($key, $value=null) return $this; } + /** + * @param string $dir + * @return void + */ public function setScriptPath($dir) { $this->_view->setScriptPath($dir.DS); } + /** + * @param string $fileName + * @return string + */ public function fetchView($fileName) { return $this->_view->render($fileName); } - } diff --git a/app/code/core/Mage/Core/Block/Text.php b/app/code/core/Mage/Core/Block/Text.php index 1b2ea703ebb..143e5f028a5 100644 --- a/app/code/core/Mage/Core/Block/Text.php +++ b/app/code/core/Mage/Core/Block/Text.php @@ -29,22 +29,41 @@ * Base html block * * @author Magento Core Team + * + * @method array getLiParams() + * @method $this setLiParams(array $value) + * @method array getAParams() + * @method $this setAParams(array $value) + * @method string getInnerText() + * @method $this setInnerText(string $value) + * @method string getAfterText() + * @method $this setAfterText(string $value) */ class Mage_Core_Block_Text extends Mage_Core_Block_Abstract { - + /** + * @param string $text + * @return $this + */ public function setText($text) { $this->setData('text', $text); return $this; } + /** + * @return string + */ public function getText() { return $this->getData('text'); } - public function addText($text, $before=false) + /** + * @param string $text + * @param bool $before + */ + public function addText($text, $before = false) { if ($before) { $this->setText($text.$this->getText()); @@ -53,6 +72,9 @@ public function addText($text, $before=false) } } + /** + * @return string + */ protected function _toHtml() { if (!$this->_beforeToHtml()) { @@ -61,5 +83,4 @@ protected function _toHtml() return $this->getText(); } - } diff --git a/app/code/core/Mage/Core/Block/Text/List.php b/app/code/core/Mage/Core/Block/Text/List.php index 66c6af355cd..37d033ee7a9 100644 --- a/app/code/core/Mage/Core/Block/Text/List.php +++ b/app/code/core/Mage/Core/Block/Text/List.php @@ -29,9 +29,11 @@ * * @author Magento Core Team */ - class Mage_Core_Block_Text_List extends Mage_Core_Block_Text { + /** + * @inheritDoc + */ protected function _toHtml() { $this->setText(''); diff --git a/app/code/core/Mage/Core/Block/Text/List/Item.php b/app/code/core/Mage/Core/Block/Text/List/Item.php index c5d786e0d15..e2dd476aa37 100644 --- a/app/code/core/Mage/Core/Block/Text/List/Item.php +++ b/app/code/core/Mage/Core/Block/Text/List/Item.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * List item block * @@ -32,7 +31,12 @@ */ class Mage_Core_Block_Text_List_Item extends Mage_Core_Block_Text { - function setLink($liParams, $innerText) + /** + * @param array $liParams + * @param array $innerText + * @return $this + */ + public function setLink($liParams, $innerText) { $this->setLiParams($liParams); $this->setInnerText($innerText); @@ -40,6 +44,9 @@ function setLink($liParams, $innerText) return $this; } + /** + * @inheritDoc + */ protected function _toHtml() { $this->setText('setLiParams($liParams); $this->setAParams($aParams); @@ -42,6 +49,9 @@ function setLink($liParams, $aParams, $innerText, $afterText='') return $this; } + /** + * @inheritDoc + */ protected function _toHtml() { $this->setText(' + * + * @method string getTagContents() + * @method $this setTagContents(string $value) + * @method getTagName() + * @method array getTagParams() + * @method $this setTagParams(array $value) */ class Mage_Core_Block_Text_Tag extends Mage_Core_Block_Text { @@ -39,7 +44,12 @@ protected function _construct() $this->setTagParams(array()); } - function setTagParam($param, $value=null) + /** + * @param string|array $param + * @param null $value + * @return $this + */ + public function setTagParam($param, $value = null) { if (is_array($param) && is_null($value)) { foreach ($param as $k=>$v) { @@ -53,12 +63,19 @@ function setTagParam($param, $value=null) return $this; } - function setContents($text) + /** + * @param string $text + * @return $this + */ + public function setContents($text) { $this->setTagContents($text); return $this; } + /** + * @inheritDoc + */ protected function _toHtml() { $this->setText('<'.$this->getTagName().' '); @@ -71,5 +88,4 @@ protected function _toHtml() $this->addText('>'.$this->getTagContents().'getTagName().'>'."\r\n"); return parent::_toHtml(); } - } diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Css.php b/app/code/core/Mage/Core/Block/Text/Tag/Css.php index df3040d6263..e17cda4be9f 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Css.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Css.php @@ -24,15 +24,16 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Base html block * + * @method Mage_Core_Block_Text_Tag_Css setTagName(string $value) + * @method Mage_Core_Block_Text_Tag_Css setTagParams(array $value) + * * @author Magento Core Team */ class Mage_Core_Block_Text_Tag_Css extends Mage_Core_Block_Text_Tag { - protected function _construct() { parent::_construct(); @@ -40,7 +41,12 @@ protected function _construct() $this->setTagParams(array('rel'=>'stylesheet', 'type'=>'text/css', 'media'=>'all')); } - function setHref($href, $type=null) + /** + * @param string $href + * @param string|null $type + * @return Mage_Core_Block_Text_Tag_Css + */ + public function setHref($href, $type = null) { $type = (string)$type; if (empty($type)) { @@ -50,5 +56,4 @@ function setHref($href, $type=null) return $this->setTagParam('href', $url); } - } diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Css/Admin.php b/app/code/core/Mage/Core/Block/Text/Tag/Css/Admin.php index 3a4201ace2e..0a18c8e8481 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Css/Admin.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Css/Admin.php @@ -24,15 +24,15 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Base html block * * @author Magento Core Team + * + * @method string getTheme() */ class Mage_Core_Block_Text_Tag_Css_Admin extends Mage_Core_Block_Text_Tag_Css { - protected function _construct() { parent::_construct(); @@ -40,7 +40,12 @@ protected function _construct() $this->setAttribute('theme', $theme); } - function setHref($href, $type=null) + /** + * @param string $href + * @param string|null $type + * @return $this + */ + public function setHref($href, $type = null) { $type = (string)$type; if (empty($type)) { @@ -49,5 +54,4 @@ function setHref($href, $type=null) $url = Mage::getBaseUrl($type).$href.$this->getTheme().'.css'; return $this->setTagParam('href', $url); } - } diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Debug.php b/app/code/core/Mage/Core/Block/Text/Tag/Debug.php index 6952c46420e..6c45ef6735f 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Debug.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Debug.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Base html block * @@ -32,7 +31,6 @@ */ class Mage_Core_Block_Text_Tag_Debug extends Mage_Core_Block_Text_Tag { - protected function _construct() { parent::_construct(); @@ -41,9 +39,12 @@ protected function _construct() )); } - function setValue($value) + /** + * @param mixed $value + * @return Mage_Core_Block_Text_Tag_Debug + */ + public function setValue($value) { return $this->setContents(print_r($value, 1)); } - } diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Js.php b/app/code/core/Mage/Core/Block/Text/Tag/Js.php index 81103d199b6..9c21992e0da 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Js.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Js.php @@ -24,11 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Base html block * * @author Magento Core Team + * + * @method $this setTagName(string $value) + * @method $this setTagParams(array $value) */ class Mage_Core_Block_Text_Tag_Js extends Mage_Core_Block_Text_Tag { @@ -40,7 +42,12 @@ protected function _construct() $this->setTagParams(array('language'=>'javascript', 'type'=>'text/javascript')); } - function setSrc($src, $type=null) + /** + * @param string $src + * @param string|null $type + * @return $this + */ + public function setSrc($src, $type = null) { $type = (string)$type; if (empty($type)) { @@ -50,5 +57,4 @@ function setSrc($src, $type=null) return $this->setTagParam('src', $url); } - } diff --git a/app/code/core/Mage/Core/Block/Text/Tag/Meta.php b/app/code/core/Mage/Core/Block/Text/Tag/Meta.php index 802a26e46fc..c456f72b603 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag/Meta.php +++ b/app/code/core/Mage/Core/Block/Text/Tag/Meta.php @@ -24,9 +24,19 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +/** + * @method string getContentType() + * @method $this setContentType(string $value) + * @method string getTitle() + * @method string getDescription() + * @method string getKeywords() + * @method string getRobots() + */ class Mage_Core_Block_Text_Tag_Meta extends Mage_Core_Block_Text { + /** + * @return string + */ protected function _toHtml() { if (!$this->getContentType()) { diff --git a/app/code/core/Mage/Core/Controller/Front/Action.php b/app/code/core/Mage/Core/Controller/Front/Action.php index 1933b4d8525..e266f42df15 100644 --- a/app/code/core/Mage/Core/Controller/Front/Action.php +++ b/app/code/core/Mage/Core/Controller/Front/Action.php @@ -107,7 +107,10 @@ public function __() * @param int $contentLength explicit content length, if strlen($content) isn't applicable * @return $this */ - protected function _prepareDownloadResponse($fileName, $content, $contentType = 'application/octet-stream', + protected function _prepareDownloadResponse( + $fileName, + $content, + $contentType = 'application/octet-stream', $contentLength = null ) { $session = Mage::getSingleton('admin/session'); diff --git a/app/code/core/Mage/Core/Controller/Front/Router.php b/app/code/core/Mage/Core/Controller/Front/Router.php index 37cc958a3f0..844328e21f0 100644 --- a/app/code/core/Mage/Core/Controller/Front/Router.php +++ b/app/code/core/Mage/Core/Controller/Front/Router.php @@ -24,21 +24,30 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Controller_Front_Router { protected $_config = null; - + + /** + * @param Mage_Core_Model_Config_Element $config + */ public function __construct($config) { $this->_config = $config; } - + + /** + * @return Mage_Core_Model_Config_Element + */ public function getConfig() { return $this->_config; } - + + /** + * @param Zend_Controller_Router_Interface $router + * @return $this + */ public function addRoutes(Zend_Controller_Router_Interface $router) { $frontName = $this->_config->getName(); @@ -50,8 +59,12 @@ public function addRoutes(Zend_Controller_Router_Interface $router) return $this; } - - public function getUrl($params=array()) + + /** + * @param array $params + * @return string + */ + public function getUrl($params = array()) { static $reservedKeys = array('module'=>1, 'controller'=>1, 'action'=>1, 'array'=>1); diff --git a/app/code/core/Mage/Core/Controller/Request/Http.php b/app/code/core/Mage/Core/Controller/Request/Http.php index 442ace61b3d..98f723beae2 100644 --- a/app/code/core/Mage/Core/Controller/Request/Http.php +++ b/app/code/core/Mage/Core/Controller/Request/Http.php @@ -49,7 +49,7 @@ class Mage_Core_Controller_Request_Http extends Zend_Controller_Request_Http /** * Path info array used before applying rewrite from config * - * @var null || array + * @var null|array */ protected $_rewritedPathInfo= null; protected $_requestedRouteName = null; @@ -64,7 +64,7 @@ class Mage_Core_Controller_Request_Http extends Zend_Controller_Request_Http * Streight request flag. * If flag is determined no additional logic is applicable * - * @var $_isStraight bool + * @var bool $_isStraight */ protected $_isStraight = false; @@ -97,6 +97,10 @@ public function getOriginalPathInfo() return $this->_originalPathInfo; } + /** + * @return string|null + * @throws Mage_Core_Model_Store_Exception + */ public function getStoreCodeFromPath() { if (!$this->_storeCode) { @@ -112,14 +116,12 @@ public function getStoreCodeFromPath() $this->setPathInfo(implode('/', $p)); $this->_storeCode = $storeCode; Mage::app()->setCurrentStore($storeCode); - } - else { + } else { $this->_storeCode = Mage::app()->getStore()->getCode(); } } else { $this->_storeCode = Mage::app()->getStore()->getCode(); } - } return $this->_storeCode; } @@ -166,8 +168,7 @@ public function setPathInfo($pathInfo = null) if ($storeCode!=='' && isset($stores[$storeCode])) { Mage::app()->setCurrentStore($storeCode); $pathInfo = '/'.(isset($pathParts[1]) ? $pathParts[1] : ''); - } - elseif ($storeCode !== '') { + } elseif ($storeCode !== '') { $this->setActionName('noRoute'); } } @@ -239,6 +240,10 @@ public function getDirectFrontNames() return $this->_directFrontNames; } + /** + * @return Zend_Controller_Request_Http + * @throws Zend_Controller_Request_Exception + */ public function getOriginalRequest() { $request = new Zend_Controller_Request_Http(); @@ -246,11 +251,17 @@ public function getOriginalRequest() return $request; } + /** + * @return string + */ public function getRequestString() { return $this->_requestString; } + /** + * @return string + */ public function getBasePath() { $path = parent::getBasePath(); @@ -273,11 +284,17 @@ public function getBaseUrl($raw = false) return $url; } + /** + * @param string $route + * @return $this + */ public function setRouteName($route) { $this->_route = $route; $router = Mage::app()->getFrontController()->getRouterByRoute($route); - if (!$router) return $this; + if (!$router) { + return $this; + } $module = $router->getFrontNameByRoute($route); if ($module) { $this->setModuleName($module); @@ -285,6 +302,9 @@ public function setRouteName($route) return $this; } + /** + * @return string + */ public function getRouteName() { return $this->_route; @@ -328,8 +348,7 @@ public function setPost($key, $value = null) { if (is_array($key)) { $_POST = $key; - } - else { + } else { $_POST[$key] = $value; } return $this; @@ -488,7 +507,7 @@ public function setRoutingInfo($data) * Collect properties changed by _forward in protected storage * before _forward was called first time. * - * @return Mage_Core_Controller_Varien_Action + * @return $this */ public function initForward() { diff --git a/app/code/core/Mage/Core/Controller/Response/Http.php b/app/code/core/Mage/Core/Controller/Response/Http.php index 5d20dfc95d3..ed9b4c5eccc 100644 --- a/app/code/core/Mage/Core/Controller/Response/Http.php +++ b/app/code/core/Mage/Core/Controller/Response/Http.php @@ -44,7 +44,7 @@ class Mage_Core_Controller_Response_Http extends Zend_Controller_Response_Http * * @link http://bugs.php.net/bug.php?id=36705 * - * @return $this + * {@inheritDoc} */ public function sendHeaders() { @@ -87,9 +87,7 @@ public function sendResponse() /** * Additionally check for session messages in several domains case * - * @param string $url - * @param int $code - * @return $this + * {@inheritDoc} */ public function setRedirect($url, $code = 302) { @@ -101,8 +99,10 @@ public function setRedirect($url, $code = 302) } self::$_transportObject->setUrl($url); self::$_transportObject->setCode($code); - Mage::dispatchEvent('controller_response_redirect', - array('response' => $this, 'transport' => self::$_transportObject)); + Mage::dispatchEvent( + 'controller_response_redirect', + array('response' => $this, 'transport' => self::$_transportObject) + ); return parent::setRedirect(self::$_transportObject->getUrl(), self::$_transportObject->getCode()); } diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index 7d84fc352cc..59002ba5c96 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -55,14 +55,14 @@ abstract class Mage_Core_Controller_Varien_Action /** * Request object * - * @var Zend_Controller_Request_Abstract + * @var Mage_Core_Controller_Request_Http */ protected $_request; /** * Response object * - * @var Zend_Controller_Response_Abstract + * @var Mage_Core_Controller_Response_Http */ protected $_response; @@ -149,6 +149,10 @@ protected function _construct() { } + /** + * @param string $action + * @return bool + */ public function hasAction($action) { return method_exists($this, $this->getActionMethodName($action)); @@ -179,7 +183,7 @@ public function getResponse() * * @param string $action * @param string $flag - * @return bool + * @return array|bool */ public function getFlag($action, $flag='') { @@ -188,11 +192,9 @@ public function getFlag($action, $flag='') } if (''===$flag) { return $this->_flags; - } - elseif (isset($this->_flags[$action][$flag])) { + } elseif (isset($this->_flags[$action][$flag])) { return $this->_flags[$action][$flag]; - } - else { + } else { return false; } } @@ -202,8 +204,8 @@ public function getFlag($action, $flag='') * * @param string $action * @param string $flag - * @param string $value - * @return Mage_Core_Controller_Varien_Action + * @param string|int $value + * @return $this */ public function setFlag($action, $flag, $value) { @@ -244,7 +246,7 @@ public function getLayout() * @param string|null|bool $handles * @param bool $generateBlocks * @param bool $generateXml - * @return Mage_Core_Controller_Varien_Action + * @return $this */ public function loadLayout($handles = null, $generateBlocks = true, $generateXml = true) { @@ -272,6 +274,10 @@ public function loadLayout($handles = null, $generateBlocks = true, $generateXml return $this; } + /** + * @return $this + * @throws Mage_Core_Model_Store_Exception + */ public function addActionLayoutHandles() { $update = $this->getLayout()->getUpdate(); @@ -291,6 +297,10 @@ public function addActionLayoutHandles() return $this; } + /** + * @return $this + * @throws Mage_Core_Exception + */ public function loadLayoutUpdates() { $_profilerKey = self::PROFILER_KEY . '::' .$this->getFullActionName(); @@ -309,6 +319,9 @@ public function loadLayoutUpdates() return $this; } + /** + * @return $this + */ public function generateLayoutXml() { $_profilerKey = self::PROFILER_KEY . '::' . $this->getFullActionName(); @@ -328,6 +341,9 @@ public function generateLayoutXml() return $this; } + /** + * @return $this + */ public function generateLayoutBlocks() { $_profilerKey = self::PROFILER_KEY . '::' . $this->getFullActionName(); @@ -358,7 +374,7 @@ public function generateLayoutBlocks() * Rendering layout * * @param string $output - * @return Mage_Core_Controller_Varien_Action + * @return $this|void */ public function renderLayout($output='') { @@ -395,6 +411,9 @@ public function renderLayout($output='') return $this; } + /** + * @param string $action + */ public function dispatch($action) { try { @@ -423,8 +442,7 @@ public function dispatch($action) Varien_Profiler::stop(self::PROFILER_KEY.'::postdispatch'); } } - } - catch (Mage_Core_Controller_Varien_Exception $e) { + } catch (Mage_Core_Controller_Varien_Exception $e) { // set prepared flags foreach ($e->getResultFlags() as $flagData) { list($action, $flag, $value) = $flagData; @@ -489,7 +507,7 @@ public function preDispatch() $checkCookie = in_array($this->getRequest()->getActionName(), $this->_cookieCheckActions) && !$this->getRequest()->getParam('nocookie', false); $cookies = Mage::getSingleton('core/cookie')->get(); - /** @var $session Mage_Core_Model_Session */ + /** @var Mage_Core_Model_Session $session */ $session = Mage::getSingleton('core/session', array('name' => $this->_sessionNamespace))->start(); if (empty($cookies)) { @@ -523,10 +541,14 @@ public function preDispatch() } Mage::dispatchEvent('controller_action_predispatch', array('controller_action' => $this)); - Mage::dispatchEvent('controller_action_predispatch_' . $this->getRequest()->getRouteName(), - array('controller_action' => $this)); - Mage::dispatchEvent('controller_action_predispatch_' . $this->getFullActionName(), - array('controller_action' => $this)); + Mage::dispatchEvent( + 'controller_action_predispatch_' . $this->getRequest()->getRouteName(), + array('controller_action' => $this) + ); + Mage::dispatchEvent( + 'controller_action_predispatch_' . $this->getFullActionName(), + array('controller_action' => $this) + ); } /** @@ -549,6 +571,9 @@ public function postDispatch() Mage::dispatchEvent('controller_action_postdispatch', array('controller_action'=>$this)); } + /** + * @param mixed|null $coreRoute + */ public function norouteAction($coreRoute = null) { $status = ( $this->getRequest()->getParam('__status__') ) @@ -567,7 +592,8 @@ public function norouteAction($coreRoute = null) $status->getForwardAction(), $status->getForwardController(), $status->getForwardModule(), - array('__status__' => $status)); + array('__status__' => $status) + ); } } @@ -628,7 +654,7 @@ protected function _forward($action, $controller = null, $module = null, array $ * Initializing layout messages by message storage(s), loading and adding messages to layout messages block * * @param string|array $messagesStorage - * @return Mage_Core_Controller_Varien_Action + * @return $this */ protected function _initLayoutMessages($messagesStorage) { @@ -642,10 +668,9 @@ protected function _initLayoutMessages($messagesStorage) $block->addMessages($storage->getMessages(true)); $block->setEscapeMessageFlag($storage->getEscapeMessages(true)); $block->addStorageType($storageName); - } - else { + } else { Mage::throwException( - Mage::helper('core')->__('Invalid messages storage "%s" for layout messages initialization', (string) $storageName) + Mage::helper('core')->__('Invalid messages storage "%s" for layout messages initialization', (string) $storageName) ); } } @@ -656,7 +681,7 @@ protected function _initLayoutMessages($messagesStorage) * Initializing layout messages by message storage(s), loading and adding messages to layout messages block * * @param string|array $messagesStorage - * @return Mage_Core_Controller_Varien_Action + * @return $this */ public function initLayoutMessages($messagesStorage) { @@ -667,7 +692,7 @@ public function initLayoutMessages($messagesStorage) * Set redirect url into response * * @param string $url - * @return Mage_Core_Controller_Varien_Action + * @return $this */ protected function _redirectUrl($url) { @@ -680,7 +705,7 @@ protected function _redirectUrl($url) * * @param string $path * @param array $arguments - * @return Mage_Core_Controller_Varien_Action + * @return $this */ protected function _redirect($path, $arguments = array()) { @@ -693,11 +718,11 @@ protected function _redirect($path, $arguments = array()) * * @param string $path * @param array $arguments - * @return Mage_Core_Controller_Varien_Action + * @return $this */ public function setRedirectWithCookieCheck($path, array $arguments = array()) { - /** @var $session Mage_Core_Model_Session */ + /** @var Mage_Core_Model_Session $session */ $session = Mage::getSingleton('core/session', array('name' => $this->_sessionNamespace)); if ($session->getCookieShouldBeReceived() && Mage::app()->getUseSessionInUrl() && $this->_sessionNamespace != Mage_Adminhtml_Controller_Action::SESSION_NAMESPACE @@ -715,7 +740,7 @@ public function setRedirectWithCookieCheck($path, array $arguments = array()) * Redirect to success page * * @param string $defaultUrl - * @return Mage_Core_Controller_Varien_Action + * @return $this */ protected function _redirectSuccess($defaultUrl) { @@ -734,7 +759,7 @@ protected function _redirectSuccess($defaultUrl) * Redirect to error page * * @param string $defaultUrl - * @return Mage_Core_Controller_Varien_Action + * @return $this */ protected function _redirectError($defaultUrl) { @@ -753,7 +778,7 @@ protected function _redirectError($defaultUrl) * Set referer url for redirect in response * * @param string $defaultUrl - * @return Mage_Core_Controller_Varien_Action + * @return $this */ protected function _redirectReferer($defaultUrl=null) { @@ -919,7 +944,7 @@ protected function _validateFormKey() * @see self::_renderTitles() * @param string|false|-1|null $text * @param bool $resetIfExists - * @return Mage_Core_Controller_Varien_Action + * @return $this */ protected function _title($text = null, $resetIfExists = true) { @@ -1031,14 +1056,14 @@ protected function _filterDateTime($array, $dateFields) * that case * @param string $contentType * @param int $contentLength explicit content length, if strlen($content) isn't applicable - * @return Mage_Core_Controller_Varien_Action + * @return $this */ protected function _prepareDownloadResponse( $fileName, $content, $contentType = 'application/octet-stream', - $contentLength = null) - { + $contentLength = null + ) { $session = Mage::getSingleton('admin/session'); if ($session->isFirstPageAfterLogin()) { $this->_redirect($session->getUser()->getStartupPageUrl()); diff --git a/app/code/core/Mage/Core/Controller/Varien/Front.php b/app/code/core/Mage/Core/Controller/Varien/Front.php index 22c4c3da430..47916eef668 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Front.php +++ b/app/code/core/Mage/Core/Controller/Varien/Front.php @@ -24,7 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +/** + * @method Mage_Core_Controller_Varien_Action getAction() + * @method $this setAction(Mage_Core_Controller_Varien_Action $value) + * @method bool getNoRender() + */ class Mage_Core_Controller_Varien_Front extends Varien_Object { protected $_defaults = array(); @@ -40,7 +44,12 @@ class Mage_Core_Controller_Varien_Front extends Varien_Object const XML_STORE_ROUTERS_PATH = 'web/routers'; - public function setDefault($key, $value=null) + /** + * @param array|string $key + * @param string|null $value + * @return $this + */ + public function setDefault($key, $value = null) { if (is_array($key)) { $this->_defaults = $key; @@ -50,7 +59,11 @@ public function setDefault($key, $value=null) return $this; } - public function getDefault($key=null) + /** + * @param string|null $key + * @return array|false + */ + public function getDefault($key = null) { if (is_null($key)) { return $this->_defaults; @@ -73,7 +86,7 @@ public function getRequest() /** * Retrieve response object * - * @return Zend_Controller_Response_Http + * @return Mage_Core_Controller_Response_Http */ public function getResponse() { @@ -98,7 +111,7 @@ public function addRouter($name, Mage_Core_Controller_Varien_Router_Abstract $ro * Retrieve router by name * * @param string $name - * @return Mage_Core_Controller_Varien_Router_Abstract + * @return Mage_Core_Controller_Varien_Router_Abstract|false */ public function getRouter($name) { @@ -135,6 +148,7 @@ public function init() continue; } if (isset($routerInfo['class'])) { + /** @var Mage_Core_Controller_Varien_Router_Standard $router */ $router = new $routerInfo['class']; if (isset($routerInfo['area'])) { $router->collectRoutes($routerInfo['area'], $routerCode); @@ -153,6 +167,10 @@ public function init() return $this; } + /** + * @return $this + * @throws Mage_Core_Exception + */ public function dispatch() { $request = $this->getRequest(); @@ -168,7 +186,7 @@ public function dispatch() $i = 0; while (!$request->isDispatched() && $i++ < 100) { foreach ($this->_routers as $router) { - /** @var $router Mage_Core_Controller_Varien_Router_Abstract */ + /** @var Mage_Core_Controller_Varien_Router_Abstract $router */ if ($router->match($request)) { break; } @@ -196,7 +214,6 @@ public function dispatch() protected function _getRequestRewriteController() { $className = (string)Mage::getConfig()->getNode('global/request_rewrite/model'); - return Mage::getSingleton('core/factory')->getModel($className, array( 'routers' => $this->getRouters(), )); @@ -229,6 +246,10 @@ public function getRouterByRoute($routeName) return $router; } + /** + * @param string $frontName + * @return false|Mage_Core_Controller_Varien_Router_Abstract + */ public function getRouterByFrontName($frontName) { // empty route supplied - return base url @@ -253,7 +274,6 @@ public function getRouterByFrontName($frontName) /** * Apply configuration rewrites to current url * - * @return $this * @deprecated since 1.7.0.2. Refactored and moved to Mage_Core_Controller_Request_Rewrite */ public function rewrite() @@ -373,7 +393,7 @@ protected function _isAdminFrontNameMatched($request) if (is_array($adminFrontNameNodes)) { foreach ($adminFrontNameNodes as $frontNameNode) { - /** @var $frontNameNode SimpleXMLElement */ + /** @var SimpleXMLElement $frontNameNode */ array_push($adminFrontNames, (string)$frontNameNode); } } diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php b/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php index 7facaa2b4c8..fbdc0897cfd 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php @@ -28,26 +28,45 @@ abstract class Mage_Core_Controller_Varien_Router_Abstract { protected $_front; + /** + * @param Mage_Core_Controller_Varien_Front $front + * @return $this + */ public function setFront($front) { $this->_front = $front; return $this; } + /** + * @return Mage_Core_Controller_Varien_Front + */ public function getFront() { return $this->_front; } + /** + * @param string $routeName + * @return string + */ public function getFrontNameByRoute($routeName) { return $routeName; } + /** + * @param string $frontName + * @return string + */ public function getRouteByFrontName($frontName) { return $frontName; } + /** + * @param Zend_Controller_Request_Http $request + * @return bool + */ abstract public function match(Zend_Controller_Request_Http $request); } diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php index da1c50ec99d..6eb68f81494 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php @@ -133,10 +133,7 @@ public function collectRoutes($configArea, $useRouterName) /** * Add module definition to routes. * - * @param string $frontName - * @param mixed $moduleName - * @param string $routeName - * @return $this + * {@inheritDoc} */ public function addModule($frontName, $moduleName, $routeName) { diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php index 59d2a55fb6d..a522d089994 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php @@ -30,6 +30,10 @@ class Mage_Core_Controller_Varien_Router_Standard extends Mage_Core_Controller_V protected $_routes = array(); protected $_dispatchData = array(); + /** + * @param string $configArea + * @param string $useRouterName + */ public function collectRoutes($configArea, $useRouterName) { $routers = array(); @@ -104,8 +108,8 @@ protected function _afterModuleMatch() /** * Match the request * - * @param Zend_Controller_Request_Http $request - * @return boolean + * @param Mage_Core_Controller_Request_Http $request + * {@inheritDoc} */ public function match(Zend_Controller_Request_Http $request) { @@ -227,8 +231,11 @@ public function match(Zend_Controller_Request_Http $request) } // instantiate controller class - $controllerInstance = Mage::getControllerInstance($controllerClassName, $request, - $front->getResponse()); + $controllerInstance = Mage::getControllerInstance( + $controllerClassName, + $request, + $front->getResponse() + ); if (!$controllerInstance->hasAction($action)) { return false; @@ -290,7 +297,10 @@ protected function _validateControllerInstance($controllerInstance) * Generating and validating class file name, * class and if evrything ok do include if needed and return of class name * + * @param string $realModule + * @param string $controller * @return mixed + * @throws Mage_Core_Exception */ protected function _validateControllerClassName($realModule, $controller) { @@ -313,6 +323,10 @@ protected function _validateControllerClassName($realModule, $controller) } /** + * @param string $controllerFileName + * @param string $controllerClassName + * @return bool + * @throws Mage_Core_Exception * @deprecated * @see _includeControllerClass() */ @@ -343,6 +357,12 @@ protected function _includeControllerClass($controllerFileName, $controllerClass return true; } + /** + * @param string $frontName + * @param string $moduleName + * @param string $routeName + * @return $this + */ public function addModule($frontName, $moduleName, $routeName) { $this->_modules[$frontName] = $moduleName; @@ -350,6 +370,10 @@ public function addModule($frontName, $moduleName, $routeName) return $this; } + /** + * @param string $frontName + * @return bool|string + */ public function getModuleByFrontName($frontName) { if (isset($this->_modules[$frontName])) { @@ -358,6 +382,11 @@ public function getModuleByFrontName($frontName) return false; } + /** + * @param string $moduleName + * @param string $modules + * @return bool + */ public function getModuleByName($moduleName, $modules) { foreach ($modules as $module) { @@ -369,6 +398,10 @@ public function getModuleByName($moduleName, $modules) return false; } + /** + * @param string $routeName + * @return false|string + */ public function getFrontNameByRoute($routeName) { if (isset($this->_routes[$routeName])) { @@ -377,11 +410,20 @@ public function getFrontNameByRoute($routeName) return false; } + /** + * @param string $frontName + * @return false|int|string + */ public function getRouteByFrontName($frontName) { return array_search($frontName, $this->_routes); } + /** + * @param string $realModule + * @param string $controller + * @return string + */ public function getControllerFileName($realModule, $controller) { $parts = explode('_', $realModule); @@ -394,6 +436,10 @@ public function getControllerFileName($realModule, $controller) return $file; } + /** + * @param string $fileName + * @return bool + */ public function validateControllerFileName($fileName) { if ($fileName && is_readable($fileName) && false===strpos($fileName, '//')) { @@ -402,12 +448,21 @@ public function validateControllerFileName($fileName) return false; } + /** + * @param string $realModule + * @param string $controller + * @return string + */ public function getControllerClassName($realModule, $controller) { $class = $realModule.'_'.uc_words($controller).'Controller'; return $class; } + /** + * @param array $p + * @return array + */ public function rewrite(array $p) { $rewrite = Mage::getConfig()->getNode('global/rewrite'); @@ -457,6 +512,10 @@ protected function _checkShouldBeSecure($request, $path = '') } } + /** + * @param Mage_Core_Controller_Request_Http $request + * @return string + */ protected function _getCurrentSecureUrl($request) { if ($alias = $request->getAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS)) { diff --git a/app/code/core/Mage/Core/Exception.php b/app/code/core/Mage/Core/Exception.php index 303f9805158..52cc718d3d5 100644 --- a/app/code/core/Mage/Core/Exception.php +++ b/app/code/core/Mage/Core/Exception.php @@ -37,6 +37,10 @@ class Mage_Core_Exception extends Exception { protected $_messages = array(); + /** + * @param Mage_Core_Model_Message_Abstract $message + * @return $this + */ public function addMessage(Mage_Core_Model_Message_Abstract $message) { if (!isset($this->_messages[$message->getType()])) { @@ -46,7 +50,11 @@ public function addMessage(Mage_Core_Model_Message_Abstract $message) return $this; } - public function getMessages($type='') + /** + * @param string $type + * @return array|Mage_Core_Model_Message_Abstract[] + */ + public function getMessages($type = '') { if ('' == $type) { $arrRes = array(); diff --git a/app/code/core/Mage/Core/Helper/Abstract.php b/app/code/core/Mage/Core/Helper/Abstract.php index ea847e3c8bd..9adef6366b3 100644 --- a/app/code/core/Mage/Core/Helper/Abstract.php +++ b/app/code/core/Mage/Core/Helper/Abstract.php @@ -79,9 +79,10 @@ protected function _loadCache($id) /** * Saving cache * - * @param mixed $data - * @param string $id - * @param array $tags + * @param mixed $data + * @param string $id + * @param array $tags + * @param null|false|int $lifeTime * @return Mage_Core_Helper_Abstract */ protected function _saveCache($data, $id, $tags=array(), $lifeTime=false) @@ -187,8 +188,11 @@ public function __() } /** - * @deprecated after 1.4.0.0-rc1 + * @param $data + * @param array $allowedTags + * @return mixed * @see self::escapeHtml() + * @deprecated after 1.4.0.0-rc1 */ public function htmlEscape($data, $allowedTags = null) { @@ -198,7 +202,7 @@ public function htmlEscape($data, $allowedTags = null) /** * Escape html entities * - * @param mixed $data + * @param string|array $data * @param array $allowedTags * @return mixed */ @@ -261,6 +265,8 @@ public function stripTags($data, $allowableTags = null, $escape = false) } /** + * @param string $data + * @return string * @deprecated after 1.4.0.0-rc1 * @see self::escapeHtml() */ diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index ebd240998c3..7397ec175bf 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -121,8 +121,7 @@ public static function currencyByStore($value, $store = null, $format = true, $i } $value = $store->convertPrice($value, $format, $includeContainer); - } - catch (Exception $e){ + } catch (Exception $e) { $value = $e->getMessage(); } @@ -156,7 +155,7 @@ public function formatPrice($price, $includeContainer = true) /** * Format date using current locale options and time zone. * - * @param date|Zend_Date|null $date + * @param string|Zend_Date|null $date * @param string $format See Mage_Core_Model_Locale::FORMAT_TYPE_* constants * @param bool $showTime Whether to include time * @return string @@ -187,7 +186,7 @@ public function formatDate($date = null, $format = Mage_Core_Model_Locale::FORMA /** * Format time using current locale options * - * @param date|Zend_Date|null $time + * @param string|Zend_Date|null $time * @param string $format * @param bool $showDate * @return string @@ -243,11 +242,20 @@ public function decrypt($data) return $this->getEncryptor()->decrypt($data); } + /** + * @param string $key + * @return Varien_Crypt_Mcrypt + */ public function validateKey($key) { return $this->getEncryptor()->validateKey($key); } + /** + * @param int $len + * @param string|null $chars + * @return string + */ public function getRandomString($len, $chars = null) { if (is_null($chars)) { @@ -264,12 +272,19 @@ public function getRandomString($len, $chars = null) * * @param string $password * @param string|integer|boolean $salt + * @return string */ public function getHash($password, $salt = false) { return $this->getEncryptor()->getHash($password, $salt); } + /** + * @param string $password + * @param string $hash + * @return bool + * @throws Exception + */ public function validateHash($password, $hash) { return $this->getEncryptor()->validateHash($password, $hash); @@ -281,12 +296,17 @@ public function validateHash($password, $hash) * @param mixed $store * @return int */ - public function getStoreId($store=null) + public function getStoreId($store = null) { return Mage::app()->getStore($store)->getId(); } - public function removeAccents($string, $german=false) + /** + * @param string $string + * @param bool $german + * @return false|string + */ + public function removeAccents($string, $german = false) { static $replacements; @@ -340,7 +360,11 @@ public function removeAccents($string, $german=false) return $string; } - public function isDevAllowed($storeId=null) + /** + * @param int|null $storeId + * @return bool + */ + public function isDevAllowed($storeId = null) { $allow = true; @@ -495,8 +519,7 @@ public function decorateArray($array, $prefix = 'decorated_', $forceSetAll = fal $isEven = !$isEven; $i++; $this->_decorateArrayObject($element, $keyIsLast, ($i === $count), $forceSetAll || ($i === $count)); - } - elseif (is_array($element)) { + } elseif (is_array($element)) { if ($forceSetAll || (0 === $i)) { $array[$key][$keyIsFirst] = (0 === $i); } @@ -517,12 +540,18 @@ public function decorateArray($array, $prefix = 'decorated_', $forceSetAll = fal return $array; } - private function _decorateArrayObject($element, $key, $value, $dontSkip) { + /** + * @param Varien_Object $element + * @param string $key + * @param mixed $value + * @param bool $dontSkip + */ + private function _decorateArrayObject($element, $key, $value, $dontSkip) + { if ($dontSkip) { if ($element instanceof Varien_Object) { $element->setData($key, $value); - } - else { + } else { $element->$key = $value; } } @@ -577,13 +606,11 @@ private function _assocToXml(array $array, $rootName, SimpleXMLElement &$xml) } $hasStringKey = true; $xml->$key = $value; - } - elseif (is_int($key)) { + } elseif (is_int($key)) { $hasNumericKey = true; $xml->{$rootName}[$key] = $value; } - } - else { + } else { self::_assocToXml($value, $key, $xml->$key); } } @@ -609,14 +636,12 @@ public function xmlToAssoc(SimpleXMLElement $xml) foreach ($value->$key as $v) { $array[$key][$i++] = (string)$v; } - } - else { + } else { // try to transform it into string value, trimming spaces between elements $array[$key] = trim((string)$value); if (empty($array[$key]) && !empty($value)) { $array[$key] = self::xmlToAssoc($value); - } - // untrim strings values + } // untrim strings values else { $array[$key] = (string)$value; } @@ -636,7 +661,7 @@ public function xmlToAssoc(SimpleXMLElement $xml) public function jsonEncode($valueToEncode, $cycleCheck = false, $options = array()) { $json = Zend_Json::encode($valueToEncode, $cycleCheck, $options); - /* @var $inline Mage_Core_Model_Translate_Inline */ + /* @var Mage_Core_Model_Translate_Inline $inline */ $inline = Mage::getSingleton('core/translate_inline'); if ($inline->isAllowed()) { $inline->setIsJson(true); @@ -654,7 +679,9 @@ public function jsonEncode($valueToEncode, $cycleCheck = false, $options = array * switch added to prevent exceptions in json_decode * * @param string $encodedValue + * @param int $objectDecodeType * @return mixed + * @throws Zend_Json_Exception */ public function jsonDecode($encodedValue, $objectDecodeType = Zend_Json::TYPE_ARRAY) { @@ -707,9 +734,13 @@ public function uniqHash($prefix = '') * @param array|string $extensionsFilter * @return bool|string */ - public function mergeFiles(array $srcFiles, $targetFile = false, $mustMerge = false, - $beforeMergeCallback = null, $extensionsFilter = array()) - { + public function mergeFiles( + array $srcFiles, + $targetFile = false, + $mustMerge = false, + $beforeMergeCallback = null, + $extensionsFilter = array() + ) { try { // check whether merger is required $shouldMerge = $mustMerge || !$targetFile; @@ -929,7 +960,6 @@ public function getEscapedCSVData(array $data) public function unEscapeCSVData($data) { if (is_array($data) and Mage::getStoreConfigFlag(Mage_ImportExport_Model_Export_Adapter_Csv::CONFIG_ESCAPING_FLAG)) { - foreach ($data as $key => $value) { $value = (string)$value; diff --git a/app/code/core/Mage/Core/Helper/File/Storage.php b/app/code/core/Mage/Core/Helper/File/Storage.php index 05892c96c3b..728d377129f 100644 --- a/app/code/core/Mage/Core/Helper/File/Storage.php +++ b/app/code/core/Mage/Core/Helper/File/Storage.php @@ -92,7 +92,7 @@ public function isInternalStorage($storage = null) * * @param int|null $storage * @param array $params - * @return Mage_Core_Model_Abstract|bool + * @return Mage_Core_Model_File_Storage_File|Mage_Core_Model_File_Storage_Database */ public function getStorageModel($storage = null, $params = array()) { diff --git a/app/code/core/Mage/Core/Helper/File/Storage/Database.php b/app/code/core/Mage/Core/Helper/File/Storage/Database.php index e98a0dfd09c..e275a14284b 100644 --- a/app/code/core/Mage/Core/Helper/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Helper/File/Storage/Database.php @@ -145,7 +145,8 @@ public function renameFile($oldName, $newName) * @param string $oldName * @param string $newName */ - public function copyFile($oldName, $newName) { + public function copyFile($oldName, $newName) + { if ($this->checkDbUsage()) { $this->getStorageDatabaseModel() ->copyFile($this->_removeAbsPathFromFileName($oldName), $this->_removeAbsPathFromFileName($newName)); @@ -177,8 +178,8 @@ public function fileExists($filename) public function getUniqueFilename($directory, $filename) { if ($this->checkDbUsage()) { - $directory = $this->_removeAbsPathFromFileName($directory); - if($this->fileExists($directory . $filename)) { + $directory = $this->_removeAbsPathFromFileName($directory); + if ($this->fileExists($directory . $filename)) { $index = 1; $extension = strrchr($filename, '.'); $filenameWoExtension = substr($filename, 0, -1 * strlen($extension)); @@ -200,7 +201,7 @@ public function getUniqueFilename($directory, $filename) public function saveFileToFilesystem($filename) { if ($this->checkDbUsage()) { - /** @var $file Mage_Core_Model_File_Storage_Database */ + /** @var Mage_Core_Model_File_Storage_Database $file */ $file = Mage::getModel('core/file_storage_database') ->loadByFilename($this->_removeAbsPathFromFileName($filename)); if (!$file->getId()) { diff --git a/app/code/core/Mage/Core/Helper/Http.php b/app/code/core/Mage/Core/Helper/Http.php index 0136bd0f85e..0bc67da0207 100644 --- a/app/code/core/Mage/Core/Helper/Http.php +++ b/app/code/core/Mage/Core/Helper/Http.php @@ -45,6 +45,7 @@ class Mage_Core_Helper_Http extends Mage_Core_Helper_Abstract /** * Validate and retrieve user and password from HTTP * + * @param string|null $headers * @return array */ public function authValidate($headers = null) @@ -69,14 +70,12 @@ public function authValidate($headers = null) if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { $user = $_SERVER['PHP_AUTH_USER']; $pass = $_SERVER['PHP_AUTH_PW']; - } - // IIS Note:: For HTTP Authentication to work with IIS, + } // IIS Note:: For HTTP Authentication to work with IIS, // the PHP directive cgi.rfc2616_headers must be set to 0 (the default value). elseif (!empty($_SERVER['HTTP_AUTHORIZATION'])) { $auth = $_SERVER['HTTP_AUTHORIZATION']; list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, " ") + 1))); - } - elseif (!empty($_SERVER['Authorization'])) { + } elseif (!empty($_SERVER['Authorization'])) { $auth = $_SERVER['Authorization']; list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, " ") + 1))); } diff --git a/app/code/core/Mage/Core/Helper/Js.php b/app/code/core/Mage/Core/Helper/Js.php index 20783cb964b..336dc196e24 100644 --- a/app/code/core/Mage/Core/Helper/Js.php +++ b/app/code/core/Mage/Core/Helper/Js.php @@ -147,8 +147,7 @@ protected function _getTranslateData() foreach ($messages as $message) { $messageText = (string)$message; $module = $message->getParent()->getAttribute("module"); - $this->_translateData[$messageText] = Mage::helper(empty($module) ? 'core' : $module - )->__($messageText); + $this->_translateData[$messageText] = Mage::helper(empty($module) ? 'core' : $module)->__($messageText); } } @@ -179,8 +178,11 @@ protected function _getXmlConfig() Mage::getConfig()->loadModulesConfiguration(self::JAVASCRIPT_TRANSLATE_CONFIG_FILENAME, $xmlConfig); if ($canUsaCache) { - Mage::app()->saveCache($xmlConfig->getXmlString(), self::JAVASCRIPT_TRANSLATE_CONFIG_KEY, - array(Mage_Core_Model_Config::CACHE_TAG)); + Mage::app()->saveCache( + $xmlConfig->getXmlString(), + self::JAVASCRIPT_TRANSLATE_CONFIG_KEY, + array(Mage_Core_Model_Config::CACHE_TAG) + ); } } $this->_config = $xmlConfig; diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 0d41a95a88e..88b80bdffd4 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -185,8 +185,7 @@ public function str_split($str, $length = 1, $keepWords = false, $trim = false, for ($offset = 0; $offset < $strlen; $offset += $length) { $result[] = $this->substr($str, $offset, $length); } - } - // split smartly, keeping words + } // split smartly, keeping words else { $split = preg_split('/(' . $wordSeparatorRegex . '+)/siu', $str, null, PREG_SPLIT_DELIM_CAPTURE); $i = 0; @@ -213,21 +212,18 @@ public function str_split($str, $length = 1, $keepWords = false, $trim = false, $result[$i] = ''; $space = ''; $spaceLen = 0; - } - else { + } else { $currentLength = $this->strlen($result[$i]); } $partLength = $this->strlen($part); // add part to current last element if (($currentLength + $spaceLen + $partLength) <= $length) { $result[$i] .= $space . $part; - } - // add part to new element + } // add part to new element elseif ($partLength <= $length) { $i++; $result[$i] = $part; - } - // break too long part recursively + } // break too long part recursively else { foreach ($this->str_split($part, $length, false, $trim, $wordSeparatorRegex) as $subpart) { $i++; @@ -265,8 +261,7 @@ function splitWords($str, $uniqueOnly = false, $maxWordLength = 0, $wordSeparato foreach ($split as $word) { if ($uniqueOnly) { $result[$word] = $word; - } - else { + } else { $result[] = $word; } } @@ -305,7 +300,7 @@ public function strpos($haystack, $needle, $offset = null) * Sorts array with multibyte string keys * * @param array $sort - * @return array + * @return array|false */ public function ksortMultibyte(array &$sort) { diff --git a/app/code/core/Mage/Core/Helper/Url.php b/app/code/core/Mage/Core/Helper/Url.php index c8eca839bdd..0fa1775c75d 100644 --- a/app/code/core/Mage/Core/Helper/Url.php +++ b/app/code/core/Mage/Core/Helper/Url.php @@ -107,8 +107,8 @@ protected function _prepareString($string) /** * Add request parameter into url * - * @param $url string - * @param $param array( 'key' => value ) + * @param string $url + * @param array $param ( 'key' => value ) * @return string */ public function addRequestParam($url, $param) diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index cb9a533314e..87468db9fdb 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -31,6 +31,11 @@ * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method string getCreatedAt() + * @method $this setCreatedAt(string $currentTime) + * @method $this setUpdatedAt(string $currentTime) + * @method bool hasErrors() */ abstract class Mage_Core_Model_Abstract extends Varien_Object { @@ -171,7 +176,7 @@ public function getId() * Declare model object identifier value * * @param mixed $id - * @return Mage_Core_Model_Abstract + * @return $this */ public function setId($id) { @@ -206,6 +211,9 @@ public function getResourceCollection() return Mage::getResourceModel($this->_resourceCollectionName, $this->_getResource()); } + /** + * @return object + */ public function getCollection() { return $this->getResourceCollection(); @@ -214,8 +222,9 @@ public function getCollection() /** * Load object data * - * @param integer $id - * @return Mage_Core_Model_Abstract + * @param string|integer $id + * @param string|null $field + * @return $this */ public function load($id, $field=null) { @@ -243,7 +252,9 @@ protected function _getEventData() /** * Processing object before load data * - * @return Mage_Core_Model_Abstract + * @param int $id + * @param string|null $field + * @return $this */ protected function _beforeLoad($id, $field = null) { @@ -257,7 +268,7 @@ protected function _beforeLoad($id, $field = null) /** * Processing object after load data * - * @return Mage_Core_Model_Abstract + * @return $this */ protected function _afterLoad() { @@ -266,12 +277,10 @@ protected function _afterLoad() return $this; } - - /** * Object after load processing. Implemented as public interface for supporting objects after load in collections * - * @return Mage_Core_Model_Abstract + * @return $this */ public function afterLoad() { @@ -295,7 +304,7 @@ protected function _hasModelChanged() /** * Save object data * - * @return Mage_Core_Model_Abstract + * @return $this */ public function save() { @@ -334,7 +343,7 @@ public function save() /** * Callback function which called after transaction commit in resource model * - * @return Mage_Core_Model_Abstract + * @return $this */ public function afterCommitCallback() { @@ -349,7 +358,7 @@ public function afterCommitCallback() * When method is called we don't have garantee what transaction was really commited * * @deprecated after 1.4.0.0 - please use afterCommitCallback instead - * @return Mage_Core_Model_Abstract + * @return $this */ protected function _afterSaveCommit() { @@ -379,7 +388,7 @@ public function isObjectNew($flag=null) /** * Processing object before save data * - * @return Mage_Core_Model_Abstract + * @return $this */ protected function _beforeSave() { @@ -442,7 +451,7 @@ public function getCacheIdTags() /** * Remove model onject related cache * - * @return Mage_Core_Model_Abstract + * @return $this */ public function cleanModelCache() { @@ -456,7 +465,7 @@ public function cleanModelCache() /** * Processing object after save data * - * @return Mage_Core_Model_Abstract + * @return $this */ protected function _afterSave() { @@ -468,7 +477,7 @@ protected function _afterSave() /** * Delete object from database * - * @return Mage_Core_Model_Abstract + * @return $this */ public function delete() { @@ -479,8 +488,7 @@ public function delete() $this->_afterDelete(); $this->_getResource()->commit(); - } - catch (Exception $e){ + } catch (Exception $e) { $this->_getResource()->rollBack(); throw $e; } @@ -491,7 +499,7 @@ public function delete() /** * Processing object before delete data * - * @return Mage_Core_Model_Abstract + * @return $this */ protected function _beforeDelete() { @@ -519,7 +527,7 @@ protected function _protectFromNonAdmin() /** * Processing object after delete data * - * @return Mage_Core_Model_Abstract + * @return $this */ protected function _afterDelete() { @@ -531,7 +539,7 @@ protected function _afterDelete() /** * Processing manipulation after main transaction commit * - * @return Mage_Core_Model_Abstract + * @return $this */ protected function _afterDeleteCommit() { @@ -550,6 +558,9 @@ public function getResource() return $this->_getResource(); } + /** + * @return int + */ public function getEntityId() { return $this->_getData('entity_id'); @@ -558,7 +569,7 @@ public function getEntityId() /** * Clearing object for correct deleting by garbage collector * - * @return Mage_Core_Model_Abstract + * @return $this */ final public function clearInstance() { @@ -571,7 +582,7 @@ final public function clearInstance() /** * Clearing cyclic references * - * @return Mage_Core_Model_Abstract + * @return $this */ protected function _clearReferences() { @@ -581,11 +592,10 @@ protected function _clearReferences() /** * Clearing object's data * - * @return Mage_Core_Model_Abstract + * @return $this */ protected function _clearData() { return $this; } - } diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index e1d4bda5591..aac39e5d1e5 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -152,21 +152,21 @@ class Mage_Core_Model_App /** * Websites cache * - * @var array + * @var Mage_Core_Model_Website[] */ protected $_websites = array(); /** * Groups cache * - * @var array + * @var Mage_Core_Model_Store_Group[] */ protected $_groups = array(); /** * Stores cache * - * @var array + * @var Mage_Core_Model_Store[] */ protected $_stores = array(); @@ -469,7 +469,7 @@ protected function _initRequest() * * @param string $scopeCode code of default scope (website/store_group/store code) * @param string $scopeType type of default scope (website/group/store) - * @return Mage_Core_Model_App + * @return $this */ protected function _initCurrentStore($scopeCode, $scopeType) { @@ -500,7 +500,8 @@ protected function _initCurrentStore($scopeCode, $scopeType) $this->_checkGetStore($scopeType); } $this->_useSessionInUrl = $this->getStore()->getConfig( - Mage_Core_Model_Session_Abstract::XML_PATH_USE_FRONTEND_SID); + Mage_Core_Model_Session_Abstract::XML_PATH_USE_FRONTEND_SID + ); return $this; } @@ -550,11 +551,9 @@ protected function _checkGetStore($type) $curStoreObj = $this->_stores[$this->_currentStore]; if ($type == 'website' && $storeObj->getWebsiteId() == $curStoreObj->getWebsiteId()) { $this->_currentStore = $store; - } - elseif ($type == 'group' && $storeObj->getGroupId() == $curStoreObj->getGroupId()) { + } elseif ($type == 'group' && $storeObj->getGroupId() == $curStoreObj->getGroupId()) { $this->_currentStore = $store; - } - elseif ($type == 'store') { + } elseif ($type == 'store') { $this->_currentStore = $store; } @@ -616,17 +615,17 @@ protected function _initStores() $this->_website = null; $this->_websites = array(); - /** @var $websiteCollection Mage_Core_Model_Website */ + /** @var Mage_Core_Model_Resource_Website_Collection $websiteCollection */ $websiteCollection = Mage::getModel('core/website')->getCollection() ->initCache($this->getCache(), 'app', array(Mage_Core_Model_Website::CACHE_TAG)) ->setLoadDefault(true); - /** @var $websiteCollection Mage_Core_Model_Store_Group */ + /** @var Mage_Core_Model_Resource_Store_Group_Collection $groupCollection */ $groupCollection = Mage::getModel('core/store_group')->getCollection() ->initCache($this->getCache(), 'app', array(Mage_Core_Model_Store_Group::CACHE_TAG)) ->setLoadDefault(true); - /** @var $websiteCollection Mage_Core_Model_Store */ + /** @var Mage_Core_Model_Resource_Store_Collection $storeCollection */ $storeCollection = Mage::getModel('core/store')->getCollection() ->initCache($this->getCache(), 'app', array(Mage_Core_Model_Store::CACHE_TAG)) ->setLoadDefault(true); @@ -641,7 +640,7 @@ protected function _initStores() $groupStores = array(); foreach ($storeCollection as $store) { - /** @var $store Mage_Core_Model_Store */ + /** @var Mage_Core_Model_Store $store */ $store->initConfigCache(); $store->setWebsite($websiteCollection->getItemById($store->getWebsiteId())); $store->setGroup($groupCollection->getItemById($store->getGroupId())); @@ -658,7 +657,7 @@ protected function _initStores() } foreach ($groupCollection as $group) { - /* @var $group Mage_Core_Model_Store_Group */ + /* @var Mage_Core_Model_Store_Group $group */ if (!isset($groupStores[$group->getId()])) { $groupStores[$group->getId()] = array(); } @@ -671,7 +670,7 @@ protected function _initStores() } foreach ($websiteCollection as $website) { - /* @var $website Mage_Core_Model_Website */ + /* @var Mage_Core_Model_Website $website */ if (!isset($websiteGroups[$website->getId()])) { $websiteGroups[$website->getId()] = array(); } @@ -771,7 +770,7 @@ protected function _initFrontController() * Redeclare custom error handler * * @param string $handler - * @return Mage_Core_Model_App + * @return $this */ public function setErrorHandler($handler) { @@ -783,7 +782,7 @@ public function setErrorHandler($handler) * Loading application area * * @param string $code - * @return Mage_Core_Model_App + * @return $this */ public function loadArea($code) { @@ -796,7 +795,7 @@ public function loadArea($code) * * @param string $area * @param string $part - * @return Mage_Core_Model_App + * @return $this */ public function loadAreaPart($area, $part) { @@ -851,7 +850,7 @@ public function getStore($id = null) if (empty($this->_stores[$id])) { $store = Mage::getModel('core/store'); - /* @var $store Mage_Core_Model_Store */ + /* @var Mage_Core_Model_Store $store */ if (is_numeric($id)) { $store->load($id); } elseif (is_string($id)) { @@ -871,19 +870,17 @@ public function getStore($id = null) * Retrieve application store object without Store_Exception * * @param string|int|Mage_Core_Model_Store $id - * @return Mage_Core_Model_Store + * @return Mage_Core_Model_Store|Varien_Object */ public function getSafeStore($id = null) { try { return $this->getStore($id); - } - catch (Exception $e) { + } catch (Exception $e) { if ($this->_currentStore) { $this->getRequest()->setActionName('noRoute'); return new Varien_Object(); - } - else { + } else { Mage::throwException(Mage::helper('core')->__('Requested invalid store "%s"', $id)); } } @@ -894,7 +891,7 @@ public function getSafeStore($id = null) * * @param bool $withDefault * @param bool $codeKey - * @return array + * @return Mage_Core_Model_Store[] */ public function getStores($withDefault = false, $codeKey = false) { @@ -905,8 +902,7 @@ public function getStores($withDefault = false, $codeKey = false) } if ($codeKey) { $stores[$store->getCode()] = $store; - } - else { + } else { $stores[$store->getId()] = $store; } } @@ -914,6 +910,9 @@ public function getStores($withDefault = false, $codeKey = false) return $stores; } + /** + * @return Mage_Core_Model_Store + */ protected function _getDefaultStore() { if (empty($this->_store)) { @@ -942,6 +941,9 @@ public function getDefaultStoreView() return null; } + /** + * @return string + */ public function getDistroLocaleCode() { return self::DISTRO_LOCALE_CODE; @@ -983,6 +985,11 @@ public function getWebsite($id=null) return $this->_websites[$id]; } + /** + * @param bool $withDefault + * @param bool $codeKey + * @return Mage_Core_Model_Website[] + */ public function getWebsites($withDefault = false, $codeKey = false) { $websites = array(); @@ -993,8 +1000,7 @@ public function getWebsites($withDefault = false, $codeKey = false) } if ($codeKey) { $websites[$website->getCode()] = $website; - } - else { + } else { $websites[$website->getId()] = $website; } } @@ -1163,7 +1169,7 @@ public function loadCache($id) * @param string $id * @param array $tags * @param null|false|int $lifeTime - * @return Mage_Core_Model_App + * @return $this */ public function saveCache($data, $id, $tags=array(), $lifeTime=false) { @@ -1175,7 +1181,7 @@ public function saveCache($data, $id, $tags=array(), $lifeTime=false) * Remove cache * * @param string $id - * @return Mage_Core_Model_App + * @return $this */ public function removeCache($id) { @@ -1187,7 +1193,7 @@ public function removeCache($id) * Cleaning cache * * @param array $tags - * @return Mage_Core_Model_App + * @return $this */ public function cleanCache($tags=array()) { @@ -1260,7 +1266,7 @@ public function setRequest(Mage_Core_Controller_Request_Http $request) /** * Retrieve response object * - * @return Zend_Controller_Response_Http + * @return Mage_Core_Controller_Response_Http */ public function getResponse() { @@ -1284,6 +1290,10 @@ public function setResponse(Mage_Core_Controller_Response_Http $response) return $this; } + /** + * @param string $area + * @return $this + */ public function addEventArea($area) { if (!isset($this->_events[$area])) { @@ -1292,6 +1302,12 @@ public function addEventArea($area) return $this; } + /** + * @param string $eventName + * @param array $args + * @return $this + * @throws Mage_Core_Exception + */ public function dispatchEvent($eventName, $args) { $eventName = strtolower($eventName); @@ -1303,7 +1319,11 @@ public function dispatchEvent($eventName, $args) continue; } $observers = array(); - foreach ($eventConfig->observers->children() as $obsName=>$obsConfig) { + /** + * @var string $obsName + * @var Mage_Core_Model_Config_Element $obsConfig + */ + foreach ($eventConfig->observers->children() as $obsName => $obsConfig) { $observers[$obsName] = array( 'type' => (string)$obsConfig->type, 'model' => $obsConfig->class ? (string)$obsConfig->class : $obsConfig->getClassName(), @@ -1367,11 +1387,17 @@ protected function _callObserverMethod($object, $method, $observer) return $this; } + /** + * @param bool $value + */ public function setUpdateMode($value) { $this->_updateMode = $value; } + /** + * @return bool + */ public function getUpdateMode() { return $this->_updateMode; @@ -1461,7 +1487,7 @@ public function setIsSingleStoreModeAllowed($value) * * @param bool $withDefault * @param bool $codeKey - * @return array + * @return Mage_Core_Model_Store_Group[] */ public function getGroups($withDefault = false, $codeKey = false) { @@ -1473,8 +1499,7 @@ public function getGroups($withDefault = false, $codeKey = false) } if ($codeKey) { $groups[$group->getCode()] = $group; - } - else { + } else { $groups[$group->getId()] = $group; } } @@ -1497,10 +1522,9 @@ public function isInstalled() /** * Generate cache tags from cache id * + * @param array $tags + * @return array * @deprecated after 1.4.0.0-alpha3, functionality implemented in Mage_Core_Model_Cache - * @param string $id - * @param array $tags - * @return array */ protected function _getCacheTags($tags=array()) { @@ -1564,7 +1588,6 @@ public function getIsCacheLocked() * Unset website by id from app cache * * @param null|bool|int|string|Mage_Core_Model_Website $id - * @return void */ public function clearWebsiteCache($id = null) { diff --git a/app/code/core/Mage/Core/Model/App/Area.php b/app/code/core/Mage/Core/Model/App/Area.php index 87d9300932a..c7d9181dbbb 100644 --- a/app/code/core/Mage/Core/Model/App/Area.php +++ b/app/code/core/Mage/Core/Model/App/Area.php @@ -62,6 +62,11 @@ class Mage_Core_Model_App_Area */ protected $_application; + /** + * Mage_Core_Model_App_Area constructor. + * @param string $areaCode + * @param Mage_Core_Model_App $application + */ public function __construct($areaCode, $application) { $this->_code = $areaCode; @@ -91,8 +96,7 @@ public function load($part=null) ->_loadPart(self::PART_EVENTS) ->_loadPart(self::PART_DESIGN) ->_loadPart(self::PART_TRANSLATE); - } - else { + } else { $this->_loadPart($part); } return $this; @@ -131,9 +135,11 @@ protected function _loadPart($part) protected function _initConfig() { - } + /** + * @return $this + */ protected function _initEvents() { Mage::app()->addEventArea($this->_code); @@ -141,20 +147,29 @@ protected function _initEvents() return $this; } + /** + * @return $this + */ protected function _initTranslate() { Mage::app()->getTranslator()->init($this->_code); return $this; } + /** + * @return $this|void + * @throws Mage_Core_Exception + * @throws Mage_Core_Model_Store_Exception + */ protected function _initDesign() { if (Mage::app()->getRequest()->isStraight()) { return $this; } $designPackage = Mage::getSingleton('core/design_package'); - if ($designPackage->getArea() != self::AREA_FRONTEND) + if ($designPackage->getArea() != self::AREA_FRONTEND) { return; + } $currentStore = Mage::app()->getStore()->getStoreId(); diff --git a/app/code/core/Mage/Core/Model/App/Emulation.php b/app/code/core/Mage/Core/Model/App/Emulation.php index 230f1b865ed..7d7bfea7cbf 100644 --- a/app/code/core/Mage/Core/Model/App/Emulation.php +++ b/app/code/core/Mage/Core/Model/App/Emulation.php @@ -71,9 +71,11 @@ public function __construct(array $args = array()) * * @return Varien_Object information about environment of the initial store */ - public function startEnvironmentEmulation($storeId, $area = Mage_Core_Model_App_Area::AREA_FRONTEND, - $emulateStoreInlineTranslation = false) - { + public function startEnvironmentEmulation( + $storeId, + $area = Mage_Core_Model_App_Area::AREA_FRONTEND, + $emulateStoreInlineTranslation = false + ) { if (is_null($area)) { $area = Mage_Core_Model_App_Area::AREA_FRONTEND; } @@ -100,7 +102,7 @@ public function startEnvironmentEmulation($storeId, $area = Mage_Core_Model_App_ * * Function restores initial store environment * - * @param Varien_Object $initialEnvironmentInfo information about environment of the initial store + * @param Varien_Object|OpenMage_Object_AppEmulation $initialEnvironmentInfo information about environment of the initial store * * @return $this */ @@ -230,9 +232,10 @@ protected function _restoreInitialDesign(array $initialDesign) * * @return $this */ - protected function _restoreInitialLocale($initialLocaleCode, - $initialArea = Mage_Core_Model_App_Area::AREA_ADMINHTML) - { + protected function _restoreInitialLocale( + $initialLocaleCode, + $initialArea = Mage_Core_Model_App_Area::AREA_ADMINHTML + ) { $currentLocaleCode = $this->_app->getLocale()->getLocaleCode(); if ($currentLocaleCode != $initialLocaleCode) { $this->_app->getLocale()->setLocaleCode($initialLocaleCode); diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index f2bc85931c8..e263fac3507 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -132,8 +132,14 @@ public function __construct(array $options = array()) $backend = $this->_getBackendOptions($options); $frontend = $this->_getFrontendOptions($options); - $this->_frontend = Zend_Cache::factory('Varien_Cache_Core', $backend['type'], $frontend, $backend['options'], - true, true, true + $this->_frontend = Zend_Cache::factory( + 'Varien_Cache_Core', + $backend['type'], + $frontend, + $backend['options'], + true, + true, + true ); if (isset($options['request_processors'])) { @@ -459,7 +465,7 @@ public function getDbAdapter() /** * Get cache resource model * - * @return Mage_Core_Model_Mysql4_Cache + * @return Mage_Core_Model_Resource_Cache */ protected function _getResource() { @@ -697,6 +703,8 @@ public function processRequest() /** * Get request processor object + * @param string $processor + * @return object */ protected function _getProcessor($processor) { diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index 776603a7309..a7c8b20ddfb 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Core configuration class * @@ -85,7 +84,7 @@ class Mage_Core_Model_Config extends Mage_Core_Model_Config_Base /** * Storage for generated block class names * - * @var unknown_type + * @var array */ protected $_blockClassNameCache = array(); @@ -243,6 +242,7 @@ public function setOptions($options) /** * Initialization of core configuration * + * @param array $options * @return $this */ public function init($options=array()) @@ -418,7 +418,9 @@ protected function _canUseCacheForInit() $retries = 10; do { if ($this->_loadCache($this->_getCacheLockId())) { - if ($retries) usleep(500000); // 0.5 seconds + if ($retries) { + usleep(500000); // 0.5 seconds + } } else { return TRUE; } @@ -431,7 +433,7 @@ protected function _canUseCacheForInit() /** * Retrieve cache object * - * @return Zend_Cache_Frontend_File + * @return Zend_Cache_Core */ public function getCache() { @@ -494,11 +496,12 @@ public function saveCache($tags=array()) /** * Save cache of specified * - * @param string $idPrefix cache id prefix - * @param string $sectionName - * @param Varien_Simplexml_Element $source - * @param int $recursionLevel - * @return Mage_Core_Model_Config + * @param string $idPrefix cache id prefix + * @param string $sectionName + * @param Varien_Simplexml_Element $source + * @param int $recursionLevel + * @param array $tags + * @return Mage_Core_Model_Config */ protected function _saveSectionCache($idPrefix, $sectionName, $source, $recursionLevel=0, $tags=array()) { @@ -507,7 +510,11 @@ protected function _saveSectionCache($idPrefix, $sectionName, $source, $recursio if ($recursionLevel > 0) { foreach ($source->$sectionName->children() as $subSectionName => $node) { $this->_saveSectionCache( - $cacheId, $subSectionName, $source->$sectionName, $recursionLevel-1, $tags + $cacheId, + $subSectionName, + $source->$sectionName, + $recursionLevel-1, + $tags ); } } @@ -519,8 +526,8 @@ protected function _saveSectionCache($idPrefix, $sectionName, $source, $recursio /** * Load config section cached data * - * @param string $sectionName - * @return Varien_Simplexml_Element + * @param string $sectionName + * @return false|SimpleXMLElement */ protected function _loadSectionCache($sectionName) { @@ -579,7 +586,7 @@ protected function _removeCache($id) /** * Remove configuration cache * - * @return $this + * {@inheritDoc} */ public function removeCache() { @@ -601,7 +608,7 @@ public function cleanCache() * Getter for section configuration object * * @param array $path - * @return Mage_Core_Model_Config_Element + * @return false|Mage_Core_Model_Config_Element */ protected function _getSectionConfig($path) { @@ -627,8 +634,8 @@ protected function _getSectionConfig($path) /** * Get node value from cached section data * - * @param array $path - * @return Mage_Core_Model_Config + * @param array $path + * @return false|Varien_Simplexml_Element */ public function getSectionNode($path) { @@ -644,10 +651,7 @@ public function getSectionNode($path) /** * Returns node found by the $path and scope info * - * @param string $path - * @param string $scope - * @param string|int $scopeCode - * @return Mage_Core_Model_Config_Element + * {@inheritDoc} */ public function getNode($path=null, $scope='', $scopeCode=null) { @@ -680,7 +684,7 @@ public function getNode($path=null, $scope='', $scopeCode=null) } } } - return parent::getNode($path); + return parent::getNode($path); } /** @@ -709,7 +713,7 @@ public function setNode($path, $value, $overwrite = true) /** * Retrive Declared Module file list * - * @return array + * @return array|false */ protected function _getDeclaredModuleFiles() { @@ -749,7 +753,7 @@ protected function _getDeclaredModuleFiles() /** * Add module(s) to allowed list * - * @param strung|array $module + * @param string|array $module * @return $this */ public function addAllowedModules($module) @@ -784,7 +788,7 @@ protected function _isAllowedModule($moduleName) * Load declared modules configuration * * @param null $mergeConfig depricated - * @return Mage_Core_Model_Config + * @return $this|void */ protected function _loadDeclaredModules($mergeConfig = null) { @@ -944,9 +948,10 @@ public function determineOmittedNamespace($name, $asFullModuleName = false) * Iterate all active modules "etc" folders and combine data from * specidied xml file name to one object * - * @param string $fileName - * @param null|Mage_Core_Model_Config_Base $mergeToObject - * @return Mage_Core_Model_Config_Base + * @param string $fileName + * @param null|Mage_Core_Model_Config_Base $mergeToObject + * @param null $mergeModel + * @return Mage_Core_Model_Config_Base */ public function loadModulesConfiguration($fileName, $mergeToObject = null, $mergeModel=null) { @@ -972,7 +977,6 @@ public function loadModulesConfiguration($fileName, $mergeToObject = null, $merg foreach ($fileName as $configFile) { $configFile = $this->getModuleDir('etc', $modName).DS.$configFile; if ($mergeModel->loadFile($configFile)) { - $this->_makeEventsLowerCase(Mage_Core_Model_App_Area::AREA_GLOBAL, $mergeModel); $this->_makeEventsLowerCase(Mage_Core_Model_App_Area::AREA_FRONTEND, $mergeModel); $this->_makeEventsLowerCase(Mage_Core_Model_App_Area::AREA_ADMIN, $mergeModel); @@ -1004,7 +1008,6 @@ public function getTempVarDir() public function getDistroServerVars() { if (!$this->_distroServerVars) { - if (isset($_SERVER['SCRIPT_NAME']) && isset($_SERVER['HTTP_HOST'])) { $secure = (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) || $_SERVER['SERVER_PORT']=='443'; $scheme = ($secure ? 'https' : 'http') . '://' ; @@ -1012,7 +1015,8 @@ public function getDistroServerVars() $hostArr = explode(':', $_SERVER['HTTP_HOST']); $host = $hostArr[0]; $port = isset( - $hostArr[1]) && (!$secure && $hostArr[1]!=80 || $secure && $hostArr[1]!=443 + $hostArr[1] + ) && (!$secure && $hostArr[1]!=80 || $secure && $hostArr[1]!=443 ) ? ':'.$hostArr[1] : ''; $path = Mage::app()->getRequest()->getBasePath(); @@ -1036,6 +1040,10 @@ public function getDistroServerVars() return $this->_distroServerVars; } + /** + * @param $data + * @return mixed + */ public function substDistroServerVars($data) { $this->getDistroServerVars(); @@ -1050,7 +1058,7 @@ public function substDistroServerVars($data) * Get module config node * * @param string $moduleName - * @return Varien_Simplexml_Object + * @return Mage_Core_Model_Config_Element|SimpleXMLElement */ function getModuleConfig($moduleName='') { @@ -1067,7 +1075,7 @@ function getModuleConfig($moduleName='') * * Defaults to Mage_Core_Setup * - * @param string|Varien_Simplexml_Object $module + * @param string|Mage_Core_Model_Config_Element $module * @return object */ function getModuleSetup($module='') @@ -1118,6 +1126,10 @@ public function getVarDir($path=null, $type='var') return $dir; } + /** + * @param string $dir + * @return bool + */ public function createDirIfNotExists($dir) { return $this->getOptions()->createDirIfNotExists($dir); @@ -1302,7 +1314,7 @@ public function getBlockClassName($blockType) /** * Retrieve helper class name * - * @param string $name + * @param string $helperName * @return string */ public function getHelperClassName($helperName) @@ -1375,6 +1387,10 @@ public function getModelInstance($modelClass='', $constructArguments=array()) } } + /** + * @param string $path + * @return bool + */ public function getNodeClassInstance($path) { $config = Mage::getConfig()->getNode($path); @@ -1391,7 +1407,7 @@ public function getNodeClassInstance($path) * * @param string $modelClass * @param array $constructArguments - * @return object + * @return object|false */ public function getResourceModelInstance($modelClass='', $constructArguments=array()) { @@ -1406,7 +1422,7 @@ public function getResourceModelInstance($modelClass='', $constructArguments=arr * Get resource configuration for resource name * * @param string $name - * @return Varien_Simplexml_Element + * @return SimpleXMLElement|Varien_Simplexml_Element */ public function getResourceConfig($name) { @@ -1417,7 +1433,7 @@ public function getResourceConfig($name) * Get connection configuration * * @param string $name - * @return Varien_Simplexml_Element|false + * @return false|SimpleXMLElement|Varien_Simplexml_Element */ public function getResourceConnectionConfig($name) { @@ -1439,7 +1455,7 @@ public function getResourceConnectionConfig($name) * Retrieve resource type configuration for resource name * * @param string $type - * @return Varien_Simplexml_Element + * @return SimpleXMLElement|Varien_Simplexml_Element */ public function getResourceTypeConfig($type) { @@ -1453,14 +1469,19 @@ public function getResourceTypeConfig($type) * * return array($storeId=>$pathValue) * - * @param string $path - * @param array $allowValues - * @return array + * @param string $path + * @param array $allowValues + * @param string $useAsKey + * @return array */ public function getStoresConfigByPath($path, $allowValues = array(), $useAsKey = 'id') { $storeValues = array(); $stores = $this->getNode('stores'); + /** + * @var string $code + * @var Varien_Simplexml_Element $store + */ foreach ($stores->children() as $code => $store) { switch ($useAsKey) { case 'id': @@ -1585,7 +1606,7 @@ public function deleteConfig($path, $scope = 'default', $scopeId = 0) * * @param string $name fieldset name * @param string $root fieldset area, could be 'admin' - * @return null|array + * @return null|Mage_Core_Model_Config_Element[]|SimpleXMLElement */ public function getFieldset($name, $root = 'global') { diff --git a/app/code/core/Mage/Core/Model/Config/Base.php b/app/code/core/Mage/Core/Model/Config/Base.php index a9b1ca9d2f7..800f80dde1e 100644 --- a/app/code/core/Mage/Core/Model/Config/Base.php +++ b/app/code/core/Mage/Core/Model/Config/Base.php @@ -38,8 +38,7 @@ class Mage_Core_Model_Config_Base extends Varien_Simplexml_Config { /** - * Constructor - * + * @param string|null $sourceData */ public function __construct($sourceData=null) { diff --git a/app/code/core/Mage/Core/Model/Config/Data.php b/app/code/core/Mage/Core/Model/Config/Data.php index a2be7beb408..8918f2fd9f4 100644 --- a/app/code/core/Mage/Core/Model/Config/Data.php +++ b/app/code/core/Mage/Core/Model/Config/Data.php @@ -31,13 +31,15 @@ * @method Mage_Core_Model_Resource_Config_Data _getResource() * @method Mage_Core_Model_Resource_Config_Data getResource() * @method string getScope() - * @method Mage_Core_Model_Config_Data setScope(string $value) + * @method $this setScope(string $value) * @method int getScopeId() - * @method Mage_Core_Model_Config_Data setScopeId(int $value) + * @method $this setScopeId(int $value) * @method string getPath() - * @method Mage_Core_Model_Config_Data setPath(string $value) + * @method $this setPath(string $value) * @method string getValue() - * @method Mage_Core_Model_Config_Data setValue(string $value) + * @method $this setValue(string $value) + * @method string getStoreCode() + * @method string getWebsiteCode() * * @category Mage * @package Mage_Core @@ -107,11 +109,12 @@ public function getOldValue() } return (string) Mage::getConfig()->getNode('default/' . $path); } - - /** + + /** * Get value by key for new user data from
/groups//fields/ - * + * + * @param string $key * @return string */ public function getFieldsetDataValue($key) diff --git a/app/code/core/Mage/Core/Model/Config/Element.php b/app/code/core/Mage/Core/Model/Config/Element.php index 77d3a38a860..bfc53bf99a9 100644 --- a/app/code/core/Mage/Core/Model/Config/Element.php +++ b/app/code/core/Mage/Core/Model/Config/Element.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Config element model * @@ -33,7 +32,6 @@ */ class Mage_Core_Model_Config_Element extends Varien_Simplexml_Element { - /** * Enter description here... * @@ -73,5 +71,4 @@ public function getClassName() } return Mage::getConfig()->getModelClassName($model); } - } diff --git a/app/code/core/Mage/Core/Model/Config/Options.php b/app/code/core/Mage/Core/Model/Config/Options.php index b67f26a583f..03d2edc9612 100644 --- a/app/code/core/Mage/Core/Model/Config/Options.php +++ b/app/code/core/Mage/Core/Model/Config/Options.php @@ -72,6 +72,11 @@ protected function _construct() $this->_data['export_dir'] = $this->_data['var_dir'].DS.'export'; } + /** + * @param string $type + * @return mixed + * @throws Mage_Core_Exception + */ public function getDir($type) { $method = 'get'.ucwords($type).'Dir'; @@ -82,65 +87,99 @@ public function getDir($type) return $dir; } + /** + * @return string + */ public function getAppDir() { //return $this->getDataSetDefault('app_dir', Mage::getRoot()); return $this->_data['app_dir']; } + /** + * @return string + */ public function getBaseDir() { //return $this->getDataSetDefault('base_dir', dirname($this->getAppDir())); return $this->_data['base_dir']; } + /** + * @return string + */ public function getCodeDir() { //return $this->getDataSetDefault('code_dir', $this->getAppDir().DS.'code'); return $this->_data['code_dir']; } + /** + * @return string + */ public function getDesignDir() { //return $this->getDataSetDefault('design_dir', $this->getAppDir().DS.'design'); return $this->_data['design_dir']; } + /** + * @return string + */ public function getEtcDir() { //return $this->getDataSetDefault('etc_dir', $this->getAppDir().DS.'etc'); return $this->_data['etc_dir']; } + /** + * @return string + */ public function getLibDir() { //return $this->getDataSetDefault('lib_dir', $this->getBaseDir().DS.'lib'); return $this->_data['lib_dir']; } + /** + * @return string + */ public function getLocaleDir() { //return $this->getDataSetDefault('locale_dir', $this->getAppDir().DS.'locale'); return $this->_data['locale_dir']; } + /** + * @return string + */ public function getMediaDir() { //return $this->getDataSetDefault('media_dir', $this->getBaseDir().DS.'media'); return $this->_data['media_dir']; } + /** + * @return string + */ public function getSkinDir() { //return $this->getDataSetDefault('skin_dir', $this->getBaseDir().DS.'skin'); return $this->_data['skin_dir']; } + /** + * @return bool|string + */ public function getSysTmpDir() { return sys_get_temp_dir(); } + /** + * @return string + * @throws Mage_Core_Exception + */ public function getVarDir() { //$dir = $this->getDataSetDefault('var_dir', $this->getBaseDir().DS.'var'); @@ -155,6 +194,10 @@ public function getVarDir() return $dir; } + /** + * @return string + * @throws Mage_Core_Exception + */ public function getTmpDir() { //$dir = $this->getDataSetDefault('tmp_dir', $this->getVarDir().DS.'tmp'); @@ -168,6 +211,9 @@ public function getTmpDir() return $dir; } + /** + * @return string + */ public function getCacheDir() { //$dir = $this->getDataSetDefault('cache_dir', $this->getVarDir().DS.'cache'); @@ -176,6 +222,9 @@ public function getCacheDir() return $dir; } + /** + * @return string + */ public function getLogDir() { //$dir = $this->getDataSetDefault('log_dir', $this->getVarDir().DS.'log'); @@ -184,6 +233,9 @@ public function getLogDir() return $dir; } + /** + * @return string + */ public function getSessionDir() { //$dir = $this->getDataSetDefault('session_dir', $this->getVarDir().DS.'session'); @@ -192,6 +244,9 @@ public function getSessionDir() return $dir; } + /** + * @return string + */ public function getUploadDir() { //$dir = $this->getDataSetDefault('upload_dir', $this->getMediaDir().DS.'upload'); @@ -200,6 +255,9 @@ public function getUploadDir() return $dir; } + /** + * @return string + */ public function getExportDir() { //$dir = $this->getDataSetDefault('export_dir', $this->getVarDir().DS.'export'); @@ -208,6 +266,10 @@ public function getExportDir() return $dir; } + /** + * @param string $dir + * @return bool + */ public function createDirIfNotExists($dir) { if (!empty($this->_dirExists[$dir])) { diff --git a/app/code/core/Mage/Core/Model/Config/System.php b/app/code/core/Mage/Core/Model/Config/System.php index 98f663920dc..f549c6b6dec 100644 --- a/app/code/core/Mage/Core/Model/Config/System.php +++ b/app/code/core/Mage/Core/Model/Config/System.php @@ -33,11 +33,18 @@ */ class Mage_Core_Model_Config_System extends Mage_Core_Model_Config_Base { - function __construct($sourceData=null) + /** + * @param string|null $sourceData + */ + function __construct($sourceData = null) { parent::__construct($sourceData); } + /** + * @param string $module + * @return $this + */ public function load($module) { $file = Mage::getConfig()->getModuleDir('etc', $module).DS.'system.xml'; diff --git a/app/code/core/Mage/Core/Model/Convert.php b/app/code/core/Mage/Core/Model/Convert.php index b405a3f538d..1ecf12d87e5 100644 --- a/app/code/core/Mage/Core/Model/Convert.php +++ b/app/code/core/Mage/Core/Model/Convert.php @@ -31,7 +31,6 @@ * @package Mage_Core * @author Magento Core Team */ -//class Mage_Core_Model_Convert extends Varien_Convert_Profile_Collection class Mage_Core_Model_Convert extends Mage_Dataflow_Model_Convert_Profile_Collection { public function __construct() @@ -47,6 +46,10 @@ public function __construct() } } + /** + * @param string $type + * @return mixed|string + */ public function getClassNameByType($type) { if (strpos($type, '/')!==false) { diff --git a/app/code/core/Mage/Core/Model/Cookie.php b/app/code/core/Mage/Core/Model/Cookie.php index b43018ebd73..9e96fe6eb3e 100644 --- a/app/code/core/Mage/Core/Model/Cookie.php +++ b/app/code/core/Mage/Core/Model/Cookie.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Core cookie model * @@ -222,8 +221,7 @@ public function set($name, $value, $period = null, $path = null, $domain = null, if ($period == 0) { $expire = 0; - } - else { + } else { $expire = time() + $period; } if (is_null($path)) { @@ -252,6 +250,7 @@ public function set($name, $value, $period = null, $path = null, $domain = null, * @param string $path * @param string $domain * @param int|bool $secure + * @param bool $httponly * @return $this */ public function renew($name, $period = null, $path = null, $domain = null, $secure = null, $httponly = null) @@ -269,7 +268,7 @@ public function renew($name, $period = null, $path = null, $domain = null, $secu /** * Retrieve cookie or false if not exists * - * @param string $neme The cookie name + * @param string $name The cookie name * @return mixed */ public function get($name = null) diff --git a/app/code/core/Mage/Core/Model/Date.php b/app/code/core/Mage/Core/Model/Date.php index d44bf3fc4bd..4b66c4501e1 100644 --- a/app/code/core/Mage/Core/Model/Date.php +++ b/app/code/core/Mage/Core/Model/Date.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Date conversion model * @@ -160,7 +159,6 @@ public function gmtTimestamp($input = null) unset($date); return $timestamp; - } /** @@ -213,6 +211,13 @@ public function getGmtOffset($type = 'seconds') } /** + * @param int $year + * @param int $month + * @param int $day + * @param int $hour + * @param int $minute + * @param int $second + * @return bool * @deprecated since 1.1.7 */ public function checkDateTime($year, $month, $day, $hour = 0, $minute = 0, $second = 0) @@ -230,6 +235,10 @@ public function checkDateTime($year, $month, $day, $hour = 0, $minute = 0, $seco } /** + * @param string $dateTimeString + * @param string $dateTimeFormat + * @return array + * @throws Mage_Core_Exception * @deprecated since 1.1.7 */ public function parseDateTime($dateTimeString, $dateTimeFormat) diff --git a/app/code/core/Mage/Core/Model/Design.php b/app/code/core/Mage/Core/Model/Design.php index 954880490a2..b2ad4fa3c9e 100644 --- a/app/code/core/Mage/Core/Model/Design.php +++ b/app/code/core/Mage/Core/Model/Design.php @@ -24,20 +24,21 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Enter description here ... * * @method Mage_Core_Model_Resource_Design _getResource() * @method Mage_Core_Model_Resource_Design getResource() * @method int getStoreId() - * @method Mage_Core_Model_Design setStoreId(int $value) + * @method $this setStoreId(int $value) * @method string getDesign() - * @method Mage_Core_Model_Design setDesign(string $value) + * @method $this setDesign(string $value) * @method string getDateFrom() - * @method Mage_Core_Model_Design setDateFrom(string $value) + * @method $this setDateFrom(string $value) * @method string getDateTo() - * @method Mage_Core_Model_Design setDateTo(string $value) + * @method $this setDateTo(string $value) + * @method string getPackage() + * @method string getTheme() * * @category Mage * @package Mage_Core @@ -50,12 +51,20 @@ protected function _construct() $this->_init('core/design'); } + /** + * @return $this + */ public function validate() { $this->getResource()->validate($this); return $this; } + /** + * @param int $storeId + * @param string|null $date + * @return $this + */ public function loadChange($storeId, $date = null) { $result = $this->getResource() diff --git a/app/code/core/Mage/Core/Model/Design/Config.php b/app/code/core/Mage/Core/Model/Design/Config.php index 096ffcada71..f5c9d5bca70 100644 --- a/app/code/core/Mage/Core/Model/Design/Config.php +++ b/app/code/core/Mage/Core/Model/Design/Config.php @@ -38,7 +38,8 @@ class Mage_Core_Model_Design_Config extends Varien_Simplexml_Config /** * Assemble themes inheritance config - * + * @param array $params + * @throws Mage_Core_Exception */ public function __construct(array $params = array()) { diff --git a/app/code/core/Mage/Core/Model/Design/Fallback.php b/app/code/core/Mage/Core/Model/Design/Fallback.php index e0b8bf40900..6cd0ed451c4 100644 --- a/app/code/core/Mage/Core/Model/Design/Fallback.php +++ b/app/code/core/Mage/Core/Model/Design/Fallback.php @@ -60,6 +60,7 @@ class Mage_Core_Model_Design_Fallback /** * Constructor + * @param array $params */ public function __construct(array $params = array()) { @@ -80,7 +81,7 @@ public function getStore() } /** - * @param $store string|integer|Mage_Core_Model_Store + * @param string|integer|Mage_Core_Model_Store $store * @return $this */ public function setStore($store) @@ -106,7 +107,6 @@ public function getFallbackScheme($area, $package, $theme) $cacheKey = $area . '/' . $package . '/' . $theme; if (!isset($this->_cachedSchemes[$cacheKey])) { - if ($this->_isInheritanceDefined($area, $package, $theme)) { $scheme = $this->_getFallbackScheme($area, $package, $theme); } else { @@ -147,7 +147,6 @@ protected function _getFallbackScheme($area, $package, $theme) $scheme = array(array()); $this->_visited = array(); while ($parent = (string)$this->_config->getNode($area . '/' . $package . '/' . $theme . '/parent')) { - $this->_checkVisited($area, $package, $theme); $parts = explode('/', $parent); @@ -168,7 +167,6 @@ protected function _getFallbackScheme($area, $package, $theme) * @param string $package * @param string $theme * @throws Mage_Core_Exception - * @return array */ protected function _checkVisited($area, $package, $theme) { diff --git a/app/code/core/Mage/Core/Model/Design/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php index 648243dd9c7..8e53e4a81b6 100644 --- a/app/code/core/Mage/Core/Model/Design/Package.php +++ b/app/code/core/Mage/Core/Model/Design/Package.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Model_Design_Package { const DEFAULT_AREA = 'frontend'; @@ -154,7 +153,7 @@ public function setArea($area) /** * Retrieve package area * - * @return unknown + * @return string */ public function getArea() { @@ -178,12 +177,10 @@ public function setPackageName($name = '') $customPackage = $this->_checkUserAgentAgainstRegexps('design/package/ua_regexp'); if ($customPackage) { $this->_name = $customPackage; - } - else { + } else { $this->_name = Mage::getStoreConfig('design/package/name', $this->getStore()); } - } - else { + } else { $this->_name = $name; } // make sure not to crash, if wrong package specified @@ -233,6 +230,11 @@ public function getPackageName() return $this->_name; } + /** + * @param string $packageName + * @param string $area + * @return bool + */ public function designPackageExists($packageName, $area = self::DEFAULT_AREA) { return is_dir(Mage::getBaseDir('design') . DS . $area . DS . $packageName); @@ -265,6 +267,10 @@ public function setTheme() return $this; } + /** + * @param string $type + * @return string + */ public function getTheme($type) { if (empty($this->_theme[$type])) { @@ -290,11 +296,18 @@ public function getTheme($type) return $this->_theme[$type]; } + /** + * @return string + */ public function getDefaultTheme() { return self::DEFAULT_THEME; } + /** + * @param array $params + * @return $this + */ public function updateParamDefaults(array &$params) { if ($this->getStore()) { @@ -307,7 +320,7 @@ public function updateParamDefaults(array &$params) $params['_package'] = $this->getPackageName(); } if (empty($params['_theme'])) { - $params['_theme'] = $this->getTheme( (isset($params['_type'])) ? $params['_type'] : '' ); + $params['_theme'] = $this->getTheme((isset($params['_type'])) ? $params['_type'] : ''); } if (empty($params['_default'])) { $params['_default'] = false; @@ -315,6 +328,10 @@ public function updateParamDefaults(array &$params) return $this; } + /** + * @param array $params + * @return string + */ public function getBaseDir(array $params) { $this->updateParamDefaults($params); @@ -323,7 +340,11 @@ public function getBaseDir(array $params) return $baseDir; } - public function getSkinBaseDir(array $params=array()) + /** + * @param array $params + * @return string + */ + public function getSkinBaseDir(array $params = array()) { $params['_type'] = 'skin'; $this->updateParamDefaults($params); @@ -332,7 +353,11 @@ public function getSkinBaseDir(array $params=array()) return $baseDir; } - public function getLocaleBaseDir(array $params=array()) + /** + * @param array $params + * @return string + */ + public function getLocaleBaseDir(array $params = array()) { $params['_type'] = 'locale'; $this->updateParamDefaults($params); @@ -342,7 +367,11 @@ public function getLocaleBaseDir(array $params=array()) return $baseDir; } - public function getSkinBaseUrl(array $params=array()) + /** + * @param array $params + * @return string + */ + public function getSkinBaseUrl(array $params = array()) { $params['_type'] = 'skin'; $this->updateParamDefaults($params); @@ -454,19 +483,34 @@ public function getFilename($file, array $params) return $result; } - public function getLayoutFilename($file, array $params=array()) + /** + * @param string $file + * @param array $params + * @return string + */ + public function getLayoutFilename($file, array $params = array()) { $params['_type'] = 'layout'; return $this->getFilename($file, $params); } - public function getTemplateFilename($file, array $params=array()) + /** + * @param string $file + * @param array $params + * @return string + */ + public function getTemplateFilename($file, array $params = array()) { $params['_type'] = 'template'; return $this->getFilename($file, $params); } - public function getLocaleFileName($file, array $params=array()) + /** + * @param string $file + * @param array $params + * @return string + */ + public function getLocaleFileName($file, array $params = array()) { $params['_type'] = 'locale'; return $this->getFilename($file, $params); @@ -518,7 +562,7 @@ public function getPackageList() /** * Design package (optional) themes list getter * @param string $package - * @return string + * @return array */ public function getThemeList($package = null) { @@ -671,7 +715,8 @@ public function getMergedCssUrl($files) // merge into target file $targetFilename = md5(implode(',', $files) . "|{$hostname}|{$port}") . '.css'; $mergeFilesResult = $this->_mergeFiles( - $files, $targetDir . DS . $targetFilename, + $files, + $targetDir . DS . $targetFilename, false, array($this, 'beforeMergeCss'), 'css' @@ -693,9 +738,13 @@ public function getMergedCssUrl($files) * @param array|string $extensionsFilter * @return bool|string */ - protected function _mergeFiles(array $srcFiles, $targetFile = false, - $mustMerge = false, $beforeMergeCallback = null, $extensionsFilter = array()) - { + protected function _mergeFiles( + array $srcFiles, + $targetFile = false, + $mustMerge = false, + $beforeMergeCallback = null, + $extensionsFilter = array() + ) { if (Mage::helper('core/file_storage_database')->checkDbUsage()) { if (!file_exists($targetFile)) { Mage::helper('core/file_storage_database')->saveFileToFilesystem($targetFile); @@ -716,7 +765,6 @@ protected function _mergeFiles(array $srcFiles, $targetFile = false, Mage::helper('core/file_storage_database')->saveFile($targetFile); } return $result; - } else { return Mage::helper('core')->mergeFiles( $srcFiles, @@ -776,15 +824,15 @@ protected function _initMergerDir($dirRelativeName, $cleanup = false) */ public function beforeMergeCss($file, $contents) { - $this->_setCallbackFileDir($file); + $this->_setCallbackFileDir($file); - $cssImport = '/@import\\s+([\'"])(.*?)[\'"]/'; - $contents = preg_replace_callback($cssImport, array($this, '_cssMergerImportCallback'), $contents); + $cssImport = '/@import\\s+([\'"])(.*?)[\'"]/'; + $contents = preg_replace_callback($cssImport, array($this, '_cssMergerImportCallback'), $contents); - $cssUrl = '/url\\(\\s*(?![\\\'\\"]?data:)([^\\)\\s]+)\\s*\\)?/'; - $contents = preg_replace_callback($cssUrl, array($this, '_cssMergerUrlCallback'), $contents); + $cssUrl = '/url\\(\\s*(?![\\\'\\"]?data:)([^\\)\\s]+)\\s*\\)?/'; + $contents = preg_replace_callback($cssUrl, array($this, '_cssMergerUrlCallback'), $contents); - return $contents; + return $contents; } /** @@ -794,8 +842,8 @@ public function beforeMergeCss($file, $contents) */ protected function _setCallbackFileDir($file) { - $file = str_replace(Mage::getBaseDir().DS, '', $file); - $this->_callbackFileDir = dirname($file); + $file = str_replace(Mage::getBaseDir().DS, '', $file); + $this->_callbackFileDir = dirname($file); } /** diff --git a/app/code/core/Mage/Core/Model/Design/Source/Apply.php b/app/code/core/Mage/Core/Model/Design/Source/Apply.php index ddca7a3d169..c83a43cb755 100644 --- a/app/code/core/Mage/Core/Model/Design/Source/Apply.php +++ b/app/code/core/Mage/Core/Model/Design/Source/Apply.php @@ -29,6 +29,9 @@ */ class Mage_Core_Model_Design_Source_Apply extends Mage_Eav_Model_Entity_Attribute_Source_Abstract { + /** + * @return array + */ public function getAllOptions() { if (!$this->_options) { diff --git a/app/code/core/Mage/Core/Model/Design/Source/Design.php b/app/code/core/Mage/Core/Model/Design/Source/Design.php index 16000f3acdd..9dd6375cc12 100644 --- a/app/code/core/Mage/Core/Model/Design/Source/Design.php +++ b/app/code/core/Mage/Core/Model/Design/Source/Design.php @@ -81,8 +81,7 @@ public function getAllOptions($withEmpty = true) if ($withEmpty) { array_unshift($options, array( 'value'=>'', - 'label'=>Mage::helper('core')->__('-- Please Select --')) - ); + 'label'=>Mage::helper('core')->__('-- Please Select --'))); } return $options; } diff --git a/app/code/core/Mage/Core/Model/Domainpolicy.php b/app/code/core/Mage/Core/Model/Domainpolicy.php index 45fadb0f000..9f35af7e6f4 100644 --- a/app/code/core/Mage/Core/Model/Domainpolicy.php +++ b/app/code/core/Mage/Core/Model/Domainpolicy.php @@ -58,6 +58,11 @@ class Mage_Core_Model_Domainpolicy */ protected $_store; + /** + * Mage_Core_Model_Domainpolicy constructor. + * @param array $options + * @throws Mage_Core_Model_Store_Exception + */ public function __construct($options = array()) { $this->_store = isset($options['store']) ? $options['store'] : Mage::app()->getStore(); @@ -71,7 +76,7 @@ public function __construct($options = array()) */ public function addDomainPolicyHeader($observer) { - /** @var Mage_Core_Controller->getCurrentAreaDomainPolicy_Varien_Action $action */ + /** @var Mage_Core_Controller_Varien_Action $action */ $action = $observer->getControllerAction(); $policy = null; @@ -110,8 +115,6 @@ public function getFrontendPolicy() return $this->_getDomainPolicyByCode((int)(string)$this->_store->getConfig(self::XML_DOMAIN_POLICY_FRONTEND)); } - - /** * Return string representation for policy code * diff --git a/app/code/core/Mage/Core/Model/Email.php b/app/code/core/Mage/Core/Model/Email.php index ab18e8b7255..e7a3eca5de0 100644 --- a/app/code/core/Mage/Core/Model/Email.php +++ b/app/code/core/Mage/Core/Model/Email.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Possible data fields: * @@ -35,10 +34,23 @@ * - template (file name) * - module (for template) * + * @method getFromEmail() + * @method $this setFromEmail(string $string) + * @method getFromName() + * @method $this setFromName(string $string) + * @method string getTemplate() + * @method string|array getToEmail() + * @method getToName() + * @method string getType() + * @method $this setType(string $string) */ class Mage_Core_Model_Email extends Varien_Object { protected $_tplVars = array(); + + /** + * @var Mage_Core_Block_Template + */ protected $_block; public function __construct() @@ -49,24 +61,34 @@ public function __construct() $this->setType('text'); } + /** + * @param string|array $var + * @param string|null $value + * @return $this + */ public function setTemplateVar($var, $value = null) { if (is_array($var)) { foreach ($var as $index=>$value) { $this->_tplVars[$index] = $value; } - } - else { + } else { $this->_tplVars[$var] = $value; } return $this; } + /** + * @return array + */ public function getTemplateVars() { return $this->_tplVars; } + /** + * @return string + */ public function getBody() { $body = $this->getData('body'); @@ -84,6 +106,9 @@ public function getBody() return $body; } + /** + * @return string + */ public function getSubject() { $subject = $this->getData('subject'); @@ -94,6 +119,10 @@ public function getSubject() return $subject; } + /** + * @return $this + * @throws Zend_Mail_Exception + */ public function send() { if (Mage::getStoreConfigFlag('system/smtp/disable')) { @@ -104,8 +133,7 @@ public function send() if (strtolower($this->getType()) == 'html') { $mail->setBodyHtml($this->getBody()); - } - else { + } else { $mail->setBodyText($this->getBody()); } diff --git a/app/code/core/Mage/Core/Model/Email/Queue.php b/app/code/core/Mage/Core/Model/Email/Queue.php index a05e2db34fc..53962e00261 100644 --- a/app/code/core/Mage/Core/Model/Email/Queue.php +++ b/app/code/core/Mage/Core/Model/Email/Queue.php @@ -27,20 +27,23 @@ /** * Email Template Mailer Model * - * @method Mage_Core_Model_Email_Queue setEntityId(int $value) - * @method Mage_Core_Model_Email_Queue setEntityType(string $value) - * @method Mage_Core_Model_Email_Queue setEventType(string $value) - * @method Mage_Core_Model_Email_Queue setIsForceCheck(int $value) - * @method int getIsForceCheck() + * @method Mage_Core_Model_Resource_Email_Queue _getResource() + * @method $this setCreatedAt(string $value) * @method int getEntityId() + * @method $this setEntityId(int $value) * @method string getEntityType() + * @method $this setEntityType(string $value) * @method string getEventType() + * @method $this setEventType(string $value) + * @method int getIsForceCheck() + * @method $this setIsForceCheck(int $value) * @method string getMessageBodyHash() * @method string getMessageBody() - * @method Mage_Core_Model_Email_Queue setMessageBody(string $value) - * @method Mage_Core_Model_Email_Queue setMessageParameters(array $value) - * @method Mage_Core_Model_Email_Queue setProcessedAt(string $value) + * @method $this setMessageBody(string $value) + * @method $this setMessageBodyHash(array $value) * @method array getMessageParameters() + * @method $this setMessageParameters(array $value) + * @method $this setProcessedAt(string $value) * * @category Mage * @package Mage_Core @@ -77,7 +80,7 @@ protected function _construct() /** * Save bind recipients to message * - * @return $this + * {@inheritDoc} */ protected function _afterSave() { @@ -88,7 +91,7 @@ protected function _afterSave() /** * Validate recipients before saving * - * @return $this + * {@inheritDoc} */ protected function _beforeSave() { @@ -185,7 +188,7 @@ public function getRecipients() */ public function send() { - /** @var $collection Mage_Core_Model_Resource_Email_Queue_Collection */ + /** @var Mage_Core_Model_Resource_Email_Queue_Collection $collection */ $collection = Mage::getModel('core/email_queue')->getCollection() ->addOnlyForSendingFilter() ->setPageSize(self::MESSAGES_LIMIT_PER_CRON_RUN) @@ -196,7 +199,7 @@ public function send() ini_set('SMTP', Mage::getStoreConfig('system/smtp/host')); ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port')); - /** @var $message Mage_Core_Model_Email_Queue */ + /** @var Mage_Core_Model_Email_Queue $message */ foreach ($collection as $message) { if ($message->getId()) { $parameters = new Varien_Object($message->getMessageParameters()); diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index ad160059587..de44a5494f1 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -41,30 +41,43 @@ * @method Mage_Core_Model_Resource_Email_Template _getResource() * @method Mage_Core_Model_Resource_Email_Template getResource() * @method string getTemplateCode() - * @method Mage_Core_Model_Email_Template setTemplateCode(string $value) + * @method $this setTemplateCode(string $value) * @method string getTemplateText() - * @method Mage_Core_Model_Email_Template setTemplateText(string $value) + * @method $this setTemplateText(string $value) * @method string getTemplateStyles() - * @method Mage_Core_Model_Email_Template setTemplateStyles(string $value) + * @method $this setTemplateStyles(string $value) * @method int getTemplateType() - * @method Mage_Core_Model_Email_Template setTemplateType(int $value) + * @method $this setTemplateType(int $value) * @method string getTemplateSubject() - * @method Mage_Core_Model_Email_Template setTemplateSubject(string $value) + * @method $this setTemplateSubject(string $value) * @method string getTemplateSenderName() - * @method Mage_Core_Model_Email_Template setTemplateSenderName(string $value) + * @method $this setTemplateSenderName(string $value) * @method string getTemplateSenderEmail() - * @method Mage_Core_Model_Email_Template setTemplateSenderEmail(string $value) + * @method $this setTemplateSenderEmail(string $value) * @method string getAddedAt() - * @method Mage_Core_Model_Email_Template setAddedAt(string $value) + * @method $this setAddedAt(string $value) * @method string getModifiedAt() - * @method Mage_Core_Model_Email_Template setModifiedAt(string $value) + * @method $this setModifiedAt(string $value) * @method string getOrigTemplateCode() - * @method Mage_Core_Model_Email_Template setOrigTemplateCode(string $value) + * @method $this setOrigTemplateCode(string $value) * @method string getOrigTemplateVariables() - * @method Mage_Core_Model_Email_Template setOrigTemplateVariables(string $value) - * @method Mage_Core_Model_Email_Template setQueue(Mage_Core_Model_Abstract $value) + * @method $this setOrigTemplateVariables(string $value) + * @method $this setQueue(Mage_Core_Model_Abstract $value) * @method Mage_Core_Model_Email_Queue getQueue() * @method int hasQueue() + * @method bool getSentSuccess() + * @method string getSenderName() + * @method string getSenderEmail() + * @method int getTemplateId() + * @method $this setTemplateId(int $value) + * @method $this setSenderName(string $value) + * @method $this setSenderEmail(string $value) + * @method $this setSentSuccess(bool $value) + * @method $this setCreatedAt(string $value) + * @method int getTemplateActual() + * @method bool getUseAbsoluteLinks() + * @method setUseAbsoluteLinks(bool $value) + * @method $this setInlineCssFile(string $value) * * @category Mage * @package Mage_Core @@ -152,8 +165,9 @@ public function loadByCode($templateCode) * * @param string $templateId * @param string $locale + * @return $this */ - public function loadDefault($templateId, $locale=null) + public function loadDefault($templateId, $locale = null) { $defaultTemplates = self::getDefaultTemplates(); if (!isset($defaultTemplates[$templateId])) { @@ -164,7 +178,9 @@ public function loadDefault($templateId, $locale=null) $this->setTemplateType($data['type']=='html' ? self::TYPE_HTML : self::TYPE_TEXT); $templateText = Mage::app()->getTranslator()->getTemplateFile( - $data['file'], 'email', $locale + $data['file'], + 'email', + $locale ); if (preg_match('//u', $templateText, $matches)) { @@ -178,8 +194,8 @@ public function loadDefault($templateId, $locale=null) } if (preg_match('//s', $templateText, $matches)) { - $this->setTemplateStyles($matches[1]); - $templateText = str_replace($matches[0], '', $templateText); + $this->setTemplateStyles($matches[1]); + $templateText = str_replace($matches[0], '', $templateText); } /** @@ -198,7 +214,7 @@ public function loadDefault($templateId, $locale=null) * * @return array */ - static public function getDefaultTemplates() + public static function getDefaultTemplates() { if(is_null(self::$_defaultTemplates)) { self::$_defaultTemplates = Mage::getConfig()->getNode(self::XML_PATH_TEMPLATE_EMAIL)->asArray(); @@ -212,7 +228,7 @@ static public function getDefaultTemplates() * * @return array */ - static public function getDefaultTemplatesAsOptionsArray() + public static function getDefaultTemplatesAsOptionsArray() { $options = array( array('value'=>'', 'label'=> '') @@ -247,6 +263,7 @@ public function getId() /** * Set id of template * @param int $value + * @return $this */ public function setId($value) { @@ -271,7 +288,8 @@ public function isValidForSend() * * @return int|string */ - public function getType(){ + public function getType() + { return $this->getTemplateType(); } @@ -313,8 +331,7 @@ public function getProcessedTemplate(array $variables = array()) $this->setInlineCssFile($processor->getInlineCssFile()); // Now that all HTML has been assembled, run email through CSS inlining process $processedResult = $this->getPreparedTemplateText($result); - } - catch (Exception $e) { + } catch (Exception $e) { $this->_cancelDesignConfig(); throw $e; } @@ -353,8 +370,8 @@ public function getPreparedTemplateText($html = null) public function getInclude($template, array $variables) { $thisClass = __CLASS__; + /** @var Mage_Core_Model_Email_Template $includeTemplate */ $includeTemplate = new $thisClass(); - $includeTemplate->loadByCode($template); return $includeTemplate->getProcessedTemplate($variables); @@ -405,7 +422,7 @@ public function send($email, $name = null, array $variables = array()) } if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) { - /** @var $emailQueue Mage_Core_Model_Email_Queue */ + /** @var Mage_Core_Model_Email_Queue $emailQueue */ $emailQueue = $this->getQueue(); $emailQueue->clearRecipients(); $emailQueue->setMessageBody($text); @@ -451,8 +468,7 @@ public function send($email, $name = null, array $variables = array()) try { $mail->send(); $this->_mail = null; - } - catch (Exception $e) { + } catch (Exception $e) { $this->_mail = null; Mage::logException($e); return false; @@ -473,7 +489,7 @@ public function send($email, $name = null, array $variables = array()) * * @throws Mage_Core_Exception * - * @return Mage_Core_Model_Email_Template + * @return $this */ public function sendTransactional($templateId, $sender, $email, $name, $vars=array(), $storeId=null) { @@ -527,10 +543,9 @@ public function getProcessedTemplateSubject(array $variables) $processor->setVariables($variables); $this->_applyDesignConfig(); - try{ + try { $processedResult = $processor->filter($this->getTemplateSubject()); - } - catch (Exception $e) { + } catch (Exception $e) { $this->_cancelDesignConfig(); throw $e; } @@ -538,6 +553,10 @@ public function getProcessedTemplateSubject(array $variables) return $processedResult; } + /** + * @param array|string $bcc + * @return $this + */ public function addBcc($bcc) { if (is_array($bcc)) { @@ -545,8 +564,7 @@ public function addBcc($bcc) $this->_bccEmails[] = $email; $this->getMail()->addBcc($email); } - } - elseif ($bcc) { + } elseif ($bcc) { $this->_bccEmails[] = $bcc; $this->getMail()->addBcc($bcc); } @@ -559,7 +577,7 @@ public function addBcc($bcc) * @param string $email * @return $this */ - public function setReturnPath($email) + public function setReturnPath($email) { $this->getMail()->setReturnPath($email); return $this; @@ -623,7 +641,7 @@ public function getVariablesOptionArray($withGroup = false) /** * Validate email template code * - * @return $this + * {@inheritDoc} */ protected function _beforeSave() { diff --git a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php index 4ee32f3344d..b4891853a4b 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php @@ -30,6 +30,12 @@ * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method string getInlineCssFile() + * @method $this setTemplateType(int $value) + * @method getTemplateText() + * @method $this setTemplateText(string $value) + * @method string getTemplateStyles() */ abstract class Mage_Core_Model_Email_Template_Abstract extends Mage_Core_Model_Template { @@ -62,7 +68,7 @@ public function getTemplateByConfigPath($configPath, array $variables) * * @param string $configPath The path to the config setting that defines which global/template/email/* node * should be used to load the email template - * @return Mage_Core_Model_Email_Template + * @return $this|null */ public function loadByConfigPath($configPath) { @@ -84,7 +90,9 @@ public function loadByConfigPath($configPath) $localeCode = Mage::getStoreConfig('general/locale/code', $storeId); $templateText = Mage::app()->getTranslator()->getTemplateFile( - $data['file'], 'email', $localeCode + $data['file'], + 'email', + $localeCode ); $this->setTemplateText($templateText); @@ -264,7 +272,7 @@ protected function _getCssByConfig($configPath) $files = array_map('trim', explode(",", $filesToLoad)); $css = ''; - foreach($files as $fileName) { + foreach ($files as $fileName) { $css .= $this->_getCssFileContent($fileName) . "\n"; } $this->_cssFileCache[$configPath] = $css; diff --git a/app/code/core/Mage/Core/Model/Email/Template/Filter.php b/app/code/core/Mage/Core/Model/Email/Template/Filter.php index 5a2c4a31ae3..9eded15bee1 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Filter.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Filter.php @@ -220,11 +220,10 @@ public function layoutDirective($construction) $params = $this->_getIncludeParameters($construction[2]); $layout = Mage::getModel('core/layout'); - /* @var $layout Mage_Core_Model_Layout */ + /* @var Mage_Core_Model_Layout $layout */ if (isset($params['area'])) { $layout->setArea($params['area']); - } - else { + } else { $layout->setArea(Mage::app()->getLayout()->getArea()); } @@ -235,7 +234,7 @@ public function layoutDirective($construction) $layout->generateBlocks(); foreach ($layout->getAllBlocks() as $blockName => $block) { - /* @var $block Mage_Core_Block_Abstract */ + /* @var Mage_Core_Block_Abstract $block */ foreach ($params as $k => $v) { if (in_array($k, $skipParams)) { continue; @@ -329,8 +328,7 @@ public function storeDirective($construction) $path = ''; $params['_direct'] = $params['direct_url']; unset($params['direct_url']); - } - else { + } else { $path = isset($params['url']) ? $params['url'] : ''; unset($params['url']); } @@ -456,8 +454,7 @@ public function protocolDirective($construction) $protocol = $isSecure ? 'https' : 'http'; if (isset($params['url'])) { return $protocol . '://' . $params['url']; - } - elseif (isset($params['http']) && isset($params['https'])) { + } elseif (isset($params['http']) && isset($params['https'])) { if ($isSecure) { return $params['https']; } diff --git a/app/code/core/Mage/Core/Model/Email/Template/Mailer.php b/app/code/core/Mage/Core/Model/Email/Template/Mailer.php index b77d821b66c..7f444b29c67 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Mailer.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Mailer.php @@ -64,7 +64,7 @@ public function addEmailInfo(Mage_Core_Model_Email_Info $emailInfo) */ public function send() { - /** @var $emailTemplate Mage_Core_Model_Email_Template */ + /** @var Mage_Core_Model_Email_Template $emailTemplate */ $emailTemplate = Mage::getModel('core/email_template'); // Send all emails from corresponding list while (!empty($this->_emailInfos)) { @@ -81,7 +81,7 @@ public function send() $emailInfo->getToNames(), $this->getTemplateParams(), $this->getStoreId() - ); + ); } return $this; } diff --git a/app/code/core/Mage/Core/Model/File/Storage.php b/app/code/core/Mage/Core/Model/File/Storage.php index 2eb83a21452..3526f524496 100644 --- a/app/code/core/Mage/Core/Model/File/Storage.php +++ b/app/code/core/Mage/Core/Model/File/Storage.php @@ -65,7 +65,8 @@ class Mage_Core_Model_File_Storage extends Mage_Core_Model_Abstract * @param Mage_Core_Model_Abstract $destinationModel * @return bool */ - protected function _synchronizeHasErrors(Mage_Core_Model_Abstract $sourceModel, + protected function _synchronizeHasErrors( + Mage_Core_Model_Abstract $sourceModel, Mage_Core_Model_Abstract $destinationModel ) { if (!$sourceModel || !$destinationModel) { @@ -96,7 +97,7 @@ public function getSyncFlag() * * @param int|null $storage * @param array $params - * @return Mage_Core_Model_Abstract|bool + * @return Mage_Core_Model_File_Storage_File|Mage_Core_Model_File_Storage_Database|false */ public function getStorageModel($storage = null, $params = array()) { diff --git a/app/code/core/Mage/Core/Model/File/Storage/Abstract.php b/app/code/core/Mage/Core/Model/File/Storage/Abstract.php index d97ac52e552..b2ddb61788b 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Abstract.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Abstract.php @@ -49,7 +49,7 @@ abstract class Mage_Core_Model_File_Storage_Abstract extends Mage_Core_Model_Abs public function getMediaBaseDirectory() { if (null === $this->_mediaBaseDirectory) { - /** @var $helper Mage_Core_Helper_File_Storage_Database */ + /** @var Mage_Core_Helper_File_Storage_Database $helper */ $helper = Mage::helper('core/file_storage_database'); $this->_mediaBaseDirectory = $helper->getMediaBaseDir(); } diff --git a/app/code/core/Mage/Core/Model/File/Storage/Database.php b/app/code/core/Mage/Core/Model/File/Storage/Database.php index 56b2e6714ac..0c0c65242ef 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Database.php @@ -30,6 +30,8 @@ * * @method Mage_Core_Model_Resource_File_Storage_Database _getResource() * @method Mage_Core_Model_Resource_File_Storage_Database getResource() + * @method string getConnectionName() + * @method $this setDirectoryId(int $value) * * @category Mage * @package Mage_Core @@ -80,7 +82,8 @@ public function getDirectoryModel() if (is_null($this->_directoryModel)) { $this->_directoryModel = Mage::getModel( 'core/file_storage_directory_database', - array('connection' => $this->getConnectionName())); + array('connection' => $this->getConnectionName()) + ); } return $this->_directoryModel; @@ -152,7 +155,8 @@ public function clear() * @param int $count * @return bool|array */ - public function exportDirectories($offset = 0, $count = 100) { + public function exportDirectories($offset = 0, $count = 100) + { return $this->getDirectoryModel()->exportDirectories($offset, $count); } @@ -162,7 +166,8 @@ public function exportDirectories($offset = 0, $count = 100) { * @param array $dirs * @return Mage_Core_Model_File_Storage_Directory_Database */ - public function importDirectories($dirs) { + public function importDirectories($dirs) + { return $this->getDirectoryModel()->importDirectories($dirs); } @@ -209,7 +214,8 @@ public function importFiles($files) $file['directory_id'] = (isset($file['directory']) && strlen($file['directory'])) ? Mage::getModel( 'core/file_storage_directory_database', - array('connection' => $this->getConnectionName())) + array('connection' => $this->getConnectionName()) + ) ->loadByPath($file['directory'])->getId() : null; diff --git a/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php b/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php index 8d976193f1d..31c25a76973 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php @@ -24,20 +24,21 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Abstract database storage model class * * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method string getConnectionName() */ abstract class Mage_Core_Model_File_Storage_Database_Abstract extends Mage_Core_Model_File_Storage_Abstract { /** * Class construct * - * @param string $databaseConnection + * @param array $params */ public function __construct($params = array()) { @@ -68,10 +69,11 @@ public function getConfigConnectionName() /** * Get resource instance * - * @return Mage_Core_Model_Mysql4_Abstract + * @return Mage_Core_Model_Resource_File_Storage_Database */ protected function _getResource() { + /** @var Mage_Core_Model_Resource_File_Storage_Database $resource */ $resource = parent::_getResource(); $resource->setConnectionName($this->getConnectionName()); @@ -81,7 +83,7 @@ protected function _getResource() /** * Prepare data storage * - * @return Mage_Core_Model_File_Storage_Database + * @return $this */ public function prepareStorage() { @@ -94,7 +96,7 @@ public function prepareStorage() * Specify connection name * * @param $connectionName - * @return Mage_Core_Model_File_Storage_Database + * @return $this */ public function setConnectionName($connectionName) { diff --git a/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php b/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php index 72e37f29cb0..ec2e0db9796 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php @@ -24,13 +24,20 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Directory database storage model class * * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method Mage_Core_Model_Resource_File_Storage_Directory_Database _getResource() + * @method string getConnectionName() + * @method $this setName(string $value) + * @method string getPath() + * @method $this setPath(string $value) + * @method $this setParentId(string $value) + * @method $this setUploadTime(string $value) */ class Mage_Core_Model_File_Storage_Directory_Database extends Mage_Core_Model_File_Storage_Database_Abstract { @@ -51,7 +58,7 @@ class Mage_Core_Model_File_Storage_Directory_Database extends Mage_Core_Model_Fi /** * Class construct * - * @param string $databaseConnection + * @param string $connectionName */ public function __construct($connectionName = null) { @@ -235,7 +242,7 @@ public function getSubdirectories($directory) /** * Delete directory from database * - * @param string $path + * @param string $dirPath * @return $this */ public function deleteDirectory($dirPath) diff --git a/app/code/core/Mage/Core/Model/File/Uploader.php b/app/code/core/Mage/Core/Model/File/Uploader.php index f5ad28fb261..a6fb7e97a16 100644 --- a/app/code/core/Mage/Core/Model/File/Uploader.php +++ b/app/code/core/Mage/Core/Model/File/Uploader.php @@ -53,14 +53,14 @@ protected function _afterSave($result) return $this; } - /** @var $helper Mage_Core_Helper_File_Storage */ + /** @var Mage_Core_Helper_File_Storage $helper */ $helper = Mage::helper('core/file_storage'); if ($helper->isInternalStorage() || $this->skipDbProcessing()) { return $this; } - /** @var $dbHelper Mage_Core_Helper_File_Storage_Database */ + /** @var Mage_Core_Helper_File_Storage_Database $dbHelper */ $dbHelper = Mage::helper('core/file_storage_database'); $this->_result['file'] = $dbHelper->saveUploadedFile($result); @@ -91,7 +91,7 @@ public function skipDbProcessing($flag = null) public function checkAllowedExtension($extension) { //validate with protected file types - /** @var $validator Mage_Core_Model_File_Validator_NotProtectedExtension */ + /** @var Mage_Core_Model_File_Validator_NotProtectedExtension $validator */ $validator = Mage::getSingleton('core/file_validator_notProtectedExtension'); if (!$validator->isValid($extension)) { return false; diff --git a/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php b/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php index d41740cd37b..acba2c08ece 100644 --- a/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php +++ b/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php @@ -82,7 +82,7 @@ protected function _initMessageTemplates() protected function _initProtectedFileExtensions() { if (!$this->_protectedFileExtensions) { - /** @var $helper Mage_Core_Helper_Data */ + /** @var Mage_Core_Helper_Data $helper */ $helper = Mage::helper('core'); $extensions = $helper->getProtectedFileExtensions(); if (is_string($extensions)) { diff --git a/app/code/core/Mage/Core/Model/Flag.php b/app/code/core/Mage/Core/Model/Flag.php index 74ca26489f8..da5986a9968 100644 --- a/app/code/core/Mage/Core/Model/Flag.php +++ b/app/code/core/Mage/Core/Model/Flag.php @@ -31,11 +31,12 @@ * @method Mage_Core_Model_Resource_Flag _getResource() * @method Mage_Core_Model_Resource_Flag getResource() * @method string getFlagCode() - * @method Mage_Core_Model_Flag setFlagCode(string $value) + * @method $this setFlagCode(string $value) * @method int getState() - * @method Mage_Core_Model_Flag setState(int $value) + * @method $this setState(int $value) * @method string getLastUpdate() - * @method Mage_Core_Model_Flag setLastUpdate(string $value) + * @method $this setLastUpdate(string $value) + * @method bool hasFlagData() * * @category Mage * @package Mage_Core @@ -64,9 +65,7 @@ protected function _construct() } /** - * Processing object before save data - * - * @return $this + * @inheritDoc */ protected function _beforeSave() { diff --git a/app/code/core/Mage/Core/Model/Input/Filter.php b/app/code/core/Mage/Core/Model/Input/Filter.php index 3309c82c931..0bcf58fee89 100644 --- a/app/code/core/Mage/Core/Model/Input/Filter.php +++ b/app/code/core/Mage/Core/Model/Input/Filter.php @@ -30,7 +30,7 @@ * Model for multi-filtering all data which set to models * Example: * - * /** @var $filter Mage_Core_Model_Input_Filter {@*} + * /** @var Mage_Core_Model_Input_Filter $filter {@*} * $filter = Mage::getModel('core/input_filter'); * $filter->setFilters(array( * 'list_values' => array( @@ -304,7 +304,7 @@ protected function _getZendFilter($filterData) { $zendFilter = false; if (is_object($filterData) && $filterData instanceof Zend_Filter_Interface) { - /** @var $zendFilter Zend_Filter_Interface */ + /** @var Zend_Filter_Interface $zendFilter */ $zendFilter = $filterData; } elseif (isset($filterData['model'])) { $zendFilter = $this->_createCustomZendFilter($filterData); diff --git a/app/code/core/Mage/Core/Model/Language.php b/app/code/core/Mage/Core/Model/Language.php index acb3ce25dd2..61c2b6dab10 100644 --- a/app/code/core/Mage/Core/Model/Language.php +++ b/app/code/core/Mage/Core/Model/Language.php @@ -25,7 +25,7 @@ */ -class Mage_Core_Model_Language extends Mage_Core_Model_Abstract +class Mage_Core_Model_Language extends Mage_Core_Model_Abstract { protected function _construct() { diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php index eb46ed20b6d..6b92fcd0609 100644 --- a/app/code/core/Mage/Core/Model/Layout.php +++ b/app/code/core/Mage/Core/Model/Layout.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Layout model * @@ -33,7 +32,6 @@ */ class Mage_Core_Model_Layout extends Varien_Simplexml_Config { - /** * Layout Update module * @@ -188,7 +186,7 @@ public function generateXml() /** * Create layout blocks hierarchy from layout xml configuration * - * @param Mage_Core_Layout_Element|null $parent + * @param Mage_Core_Model_Layout_Element|null $parent */ public function generateBlocks($parent=null) { @@ -221,7 +219,7 @@ public function generateBlocks($parent=null) * Add block object to layout based on xml node data * * @param Varien_Simplexml_Element $node - * @param Varien_Simplexml_Element $parent + * @param Mage_Core_Model_Layout_Element $parent * @return $this */ protected function _generateBlock($node, $parent) @@ -284,7 +282,7 @@ protected function _generateBlock($node, $parent) * Enter description here... * * @param Varien_Simplexml_Element $node - * @param Varien_Simplexml_Element $parent + * @param Mage_Core_Model_Layout_Element $parent * @return $this */ protected function _generateAction($node, $parent) @@ -309,7 +307,6 @@ protected function _generateAction($node, $parent) $block = $this->getBlock($parentName); } if (!empty($block)) { - $args = (array)$node->children(); unset($args['@attributes']); @@ -404,6 +401,7 @@ protected function _translateLayoutNode($node, &$args) * * @param string $name * @param Mage_Core_Model_Layout $block + * @return $this */ public function setBlock($name, $block) { @@ -415,6 +413,7 @@ public function setBlock($name, $block) * Remove block from registry * * @param string $name + * @return $this */ public function unsetBlock($name) { @@ -429,7 +428,7 @@ public function unsetBlock($name) * @param string $type * @param string $name * @param array $attributes - * @return Mage_Core_Block_Abstract + * @return Mage_Core_Block_Abstract|false */ public function createBlock($type, $name='', array $attributes = array()) { @@ -463,7 +462,7 @@ public function createBlock($type, $name='', array $attributes = array()) /** * Add a block to registry, create new object if needed * - * @param string|Mage_Core_Block_Abstract $blockClass + * @param string|Mage_Core_Block_Abstract $block * @param string $blockName * @return Mage_Core_Block_Abstract */ @@ -512,7 +511,7 @@ public function getAllBlocks() * Get block object by name * * @param string $name - * @return Mage_Core_Block_Abstract + * @return Mage_Core_Block_Abstract|false */ public function getBlock($name) { @@ -528,6 +527,7 @@ public function getBlock($name) * * @param string $blockName * @param string $method + * @return $this */ public function addOutputBlock($blockName, $method='toHtml') { @@ -536,6 +536,10 @@ public function addOutputBlock($blockName, $method='toHtml') return $this; } + /** + * @param string $blockName + * @return $this + */ public function removeOutputBlock($blockName) { unset($this->_output[$blockName]); @@ -577,7 +581,7 @@ public function getMessagesBlock() * Enter description here... * * @param string $type - * @return Mage_Core_Helper_Abstract + * @return Mage_Core_Block_Abstract */ public function getBlockSingleton($type) { @@ -602,7 +606,7 @@ public function getBlockSingleton($type) * Retrieve helper object * * @param string $name - * @return Mage_Core_Helper_Abstract + * @return Mage_Core_Helper_Abstract|false */ public function helper($name) { @@ -630,6 +634,7 @@ public static function findTranslationModuleName(Varien_Simplexml_Element $node) if ($result) { return (string)$result; } + /** @var Varien_Simplexml_Element $element */ foreach (array_reverse($node->xpath('ancestor::*[@module]')) as $element) { $result = $element->getAttribute('module'); if ($result) { diff --git a/app/code/core/Mage/Core/Model/Layout/Element.php b/app/code/core/Mage/Core/Model/Layout/Element.php index af8a24a5843..dd27bc0a45a 100644 --- a/app/code/core/Mage/Core/Model/Layout/Element.php +++ b/app/code/core/Mage/Core/Model/Layout/Element.php @@ -27,6 +27,10 @@ class Mage_Core_Model_Layout_Element extends Varien_Simplexml_Element { + /** + * @param array $args + * @return $this + */ public function prepare($args) { switch ($this->getName()) { @@ -65,6 +69,9 @@ public function prepare($args) return $this; } + /** + * @return false|string + */ public function getBlockName() { $tagName = (string)$this->getName(); @@ -74,6 +81,10 @@ public function getBlockName() return (string)$this['name']; } + /** + * @param $args + * @return $this + */ public function prepareBlock($args) { $type = (string)$this['type']; @@ -93,11 +104,19 @@ public function prepareBlock($args) return $this; } + /** + * @param $args + * @return $this + */ public function prepareReference($args) { return $this; } + /** + * @param $args + * @return $this + */ public function prepareAction($args) { $parent = $this->getParent(); @@ -106,9 +125,12 @@ public function prepareAction($args) return $this; } + /** + * @param $args + * @return $this + */ public function prepareActionArgument($args) { return $this; } - } diff --git a/app/code/core/Mage/Core/Model/Layout/Update.php b/app/code/core/Mage/Core/Model/Layout/Update.php index 361915e74d7..3bf21454441 100644 --- a/app/code/core/Mage/Core/Model/Layout/Update.php +++ b/app/code/core/Mage/Core/Model/Layout/Update.php @@ -45,7 +45,7 @@ class Mage_Core_Model_Layout_Update protected $_elementClass; /** - * @var Simplexml_Element + * @var SimpleXMLElement */ protected $_packageLayout; @@ -87,12 +87,15 @@ class Mage_Core_Model_Layout_Update public function __construct() { $subst = Mage::getConfig()->getPathVars(); - foreach ($subst as $k=>$v) { + foreach ($subst as $k => $v) { $this->_subst['from'][] = '{{'.$k.'}}'; $this->_subst['to'][] = $v; } } + /** + * @return string + */ public function getElementClass() { if (!$this->_elementClass) { @@ -101,34 +104,54 @@ public function getElementClass() return $this->_elementClass; } + /** + * @return $this + */ public function resetUpdates() { $this->_updates = array(); return $this; } + /** + * @param string $update + * @return $this + */ public function addUpdate($update) { $this->_updates[] = $update; return $this; } + /** + * @return array + */ public function asArray() { return $this->_updates; } + /** + * @return string + */ public function asString() { return implode('', $this->_updates); } + /** + * @return $this + */ public function resetHandles() { $this->_handles = array(); return $this; } + /** + * @param string $handle + * @return $this + */ public function addHandle($handle) { if (is_array($handle)) { @@ -141,12 +164,19 @@ public function addHandle($handle) return $this; } + /** + * @param string $handle + * @return $this + */ public function removeHandle($handle) { unset($this->_handles[$handle]); return $this; } + /** + * @return array + */ public function getHandles() { return array_keys($this->_handles); @@ -177,6 +207,9 @@ public function setCacheId($cacheId) return $this; } + /** + * @return bool + */ public function loadCache() { if (!Mage::app()->useCache('layout')) { @@ -199,6 +232,9 @@ public function loadCache() return true; } + /** + * @return bool + */ public function saveCache() { if (!Mage::app()->useCache('layout')) { @@ -249,6 +285,9 @@ public function load($handles=array()) return $this; } + /** + * @return SimpleXMLElement + */ public function asSimplexml() { $updates = trim($this->asString()); @@ -275,6 +314,10 @@ public function merge($handle) return $this; } + /** + * @return $this + * @throws Mage_Core_Model_Store_Exception + */ public function fetchFileLayoutUpdates() { $storeId = Mage::app()->getStore()->getId(); @@ -360,6 +403,11 @@ public function fetchFileLayoutUpdates() return $this; } + /** + * @param string $handle + * @return bool + * @throws Mage_Core_Model_Store_Exception + */ public function fetchPackageLayoutUpdates($handle) { $_profilerKey = 'layout/package_update: '.$handle; @@ -367,6 +415,7 @@ public function fetchPackageLayoutUpdates($handle) if (empty($this->_packageLayout)) { $this->fetchFileLayoutUpdates(); } + /** @var Varien_Simplexml_Element $updateXml */ foreach ($this->_packageLayout->$handle as $updateXml) { #echo ''; $this->fetchRecursiveUpdates($updateXml); @@ -377,6 +426,10 @@ public function fetchPackageLayoutUpdates($handle) return true; } + /** + * @param string $handle + * @return bool + */ public function fetchDbLayoutUpdates($handle) { $_profilerKey = 'layout/db_update: '.$handle; @@ -388,6 +441,7 @@ public function fetchDbLayoutUpdates($handle) } $updateStr = '' . $updateStr . ''; $updateStr = str_replace($this->_subst['from'], $this->_subst['to'], $updateStr); + /** @var Varien_Simplexml_Element $updateXml */ $updateXml = simplexml_load_string($updateStr, $this->getElementClass()); $this->fetchRecursiveUpdates($updateXml); $this->addUpdate($updateXml->innerXml()); @@ -407,6 +461,10 @@ protected function _getUpdateString($handle) return Mage::getResourceModel('core/layout')->fetchUpdatesByHandle($handle); } + /** + * @param SimpleXMLElement $updateXml + * @return $this + */ public function fetchRecursiveUpdates($updateXml) { foreach ($updateXml->children() as $child) { @@ -426,14 +484,14 @@ public function fetchRecursiveUpdates($updateXml) * @param string $package * @param string $theme * @param integer|null $storeId - * @return Mage_Core_Model_Layout_Element + * @return SimpleXMLElement */ public function getFileLayoutUpdatesXml($area, $package, $theme, $storeId = null) { if (null === $storeId) { $storeId = Mage::app()->getStore()->getId(); } - /* @var $design Mage_Core_Model_Design_Package */ + /* @var Mage_Core_Model_Design_Package $design */ $design = Mage::getSingleton('core/design_package'); $layoutXml = null; $elementClass = $this->getElementClass(); @@ -469,6 +527,7 @@ public function getFileLayoutUpdatesXml($area, $package, $theme, $storeId = null } $fileStr = file_get_contents($filename); $fileStr = str_replace($this->_subst['from'], $this->_subst['to'], $fileStr); + /** @var Varien_Simplexml_Element $fileXml */ $fileXml = simplexml_load_string($fileStr, $elementClass); if (!$fileXml instanceof SimpleXMLElement) { continue; diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index c6578c00576..d10ab76fed1 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -89,6 +89,10 @@ class Mage_Core_Model_Locale protected static $_currencyCache = array(); + /** + * Mage_Core_Model_Locale constructor. + * @param string|null $locale + */ public function __construct($locale = null) { $this->setLocale($locale); @@ -352,7 +356,7 @@ public function getOptionCountries() /** * Retrieve currency option list * - * @return unknown + * @return array */ public function getOptionCurrencies() { @@ -376,7 +380,7 @@ public function getOptionCurrencies() /** * Retrieve all currency option list * - * @return unknown + * @return array */ public function getOptionAllCurrencies() { @@ -391,6 +395,10 @@ public function getOptionAllCurrencies() return $this->_sortOptionArray($options); } + /** + * @param array $option + * @return array + */ protected function _sortOptionArray($option) { $data = array(); @@ -421,7 +429,7 @@ public function getAllowLocales() /** * Retrieve array of allowed currencies * - * @return unknown + * @return array */ public function getAllowCurrencies() { @@ -454,8 +462,11 @@ public function getDateFormat($type=null) */ public function getDateFormatWithLongYear() { - return preg_replace('/(?getTranslation(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, 'date')); + return preg_replace( + '/(?getTranslation(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, 'date') + ); } /** @@ -667,12 +678,10 @@ public function getNumber($value) if ($separatorComa > $separatorDot) { $value = str_replace('.', '', $value); $value = str_replace(',', '.', $value); - } - else { + } else { $value = str_replace(',', '', $value); } - } - elseif ($separatorComa !== false) { + } elseif ($separatorComa !== false) { $value = str_replace(',', '.', $value); } @@ -742,8 +751,7 @@ public function emulate($storeId) $this->_locale = new Zend_Locale(Mage::getStoreConfig(self::XML_PATH_DEFAULT_LOCALE, $storeId)); $this->_localeCode = $this->_locale->toString(); Mage::getSingleton('core/translate')->setLocale($this->_locale)->init('frontend', true); - } - else { + } else { $this->_emulatedLocales[] = false; } } @@ -802,8 +810,8 @@ protected function _convertYearTwoDigitTo4($currentFormat) /** * Returns the localized country name * - * @param string $value Name to get detailed information about - * @return array + * @param string $value Name to get detailed information about + * @return false|string */ public function getCountryTranslation($value) { @@ -844,10 +852,8 @@ public function isStoreDateInInterval($store, $dateFrom = null, $dateTo = null) $result = false; if (!is_empty_date($dateFrom) && $storeTimeStamp < $fromTimeStamp) { - } - elseif (!is_empty_date($dateTo) && $storeTimeStamp > $toTimeStamp) { - } - else { + } elseif (!is_empty_date($dateTo) && $storeTimeStamp > $toTimeStamp) { + } else { $result = true; } diff --git a/app/code/core/Mage/Core/Model/Log/Adapter.php b/app/code/core/Mage/Core/Model/Log/Adapter.php index 3028db5451c..90c758f46e9 100644 --- a/app/code/core/Mage/Core/Model/Log/Adapter.php +++ b/app/code/core/Mage/Core/Model/Log/Adapter.php @@ -75,8 +75,7 @@ public function log($data = null) { if ($data === null) { $data = $this->_data; - } - else { + } else { if (!is_array($data)) { $data = array($data); } @@ -99,8 +98,7 @@ public function setData($key, $value = null) { if(is_array($key)) { $this->_data = $key; - } - else { + } else { $this->_data[$key] = $value; } return $this; @@ -133,8 +131,7 @@ protected function _filterDebugData($debugData) foreach ($debugData as $key => $value) { if (in_array($key, $this->_debugReplacePrivateDataKeys)) { $debugData[$key] = '****'; - } - else { + } else { if (is_array($debugData[$key])) { $debugData[$key] = $this->_filterDebugData($debugData[$key]); } diff --git a/app/code/core/Mage/Core/Model/Message.php b/app/code/core/Mage/Core/Model/Message.php index 7954f0e0901..39fce8709b0 100644 --- a/app/code/core/Mage/Core/Model/Message.php +++ b/app/code/core/Mage/Core/Model/Message.php @@ -37,17 +37,24 @@ class Mage_Core_Model_Message const WARNING = 'warning'; const NOTICE = 'notice'; const SUCCESS = 'success'; - - protected function _factory($code, $type, $class='', $method='') + + /** + * @param string $code + * @param string $type + * @param string $class + * @param string $method + * @return Mage_Core_Model_Message_Error|Mage_Core_Model_Message_Notice|Mage_Core_Model_Message_Success|Mage_Core_Model_Message_Warning + */ + protected function _factory($code, $type, $class = '', $method = '') { switch (strtolower($type)) { - case self::ERROR : + case self::ERROR: $message = new Mage_Core_Model_Message_Error($code); break; - case self::WARNING : + case self::WARNING: $message = new Mage_Core_Model_Message_Warning($code); break; - case self::SUCCESS : + case self::SUCCESS: $message = new Mage_Core_Model_Message_Success($code); break; default: @@ -59,23 +66,47 @@ protected function _factory($code, $type, $class='', $method='') return $message; } - - public function error($code, $class='', $method='') + + /** + * @param string $code + * @param string $class + * @param string $method + * @return Mage_Core_Model_Message_Error|Mage_Core_Model_Message_Notice|Mage_Core_Model_Message_Success|Mage_Core_Model_Message_Warning + */ + public function error($code, $class = '', $method = '') { return $this->_factory($code, self::ERROR, $class, $method); } - public function warning($code, $class='', $method='') + /** + * @param string $code + * @param string $class + * @param string $method + * @return Mage_Core_Model_Message_Error|Mage_Core_Model_Message_Notice|Mage_Core_Model_Message_Success|Mage_Core_Model_Message_Warning + */ + public function warning($code, $class = '', $method = '') { return $this->_factory($code, self::WARNING, $class, $method); } - public function notice($code, $class='', $method='') + /** + * @param string $code + * @param string $class + * @param string $method + * @return Mage_Core_Model_Message_Error|Mage_Core_Model_Message_Notice|Mage_Core_Model_Message_Success|Mage_Core_Model_Message_Warning + */ + public function notice($code, $class = '', $method = '') { return $this->_factory($code, self::NOTICE, $class, $method); } - public function success($code, $class='', $method='') + /** + * @param string $code + * @param string $class + * @param string $method + * @return Mage_Core_Model_Message_Error|Mage_Core_Model_Message_Notice|Mage_Core_Model_Message_Success|Mage_Core_Model_Message_Warning + */ + public function success($code, $class = '', $method = '') { return $this->_factory($code, self::SUCCESS, $class, $method); } diff --git a/app/code/core/Mage/Core/Model/Message/Abstract.php b/app/code/core/Mage/Core/Model/Message/Abstract.php index eb38ac03a80..6652886fc55 100644 --- a/app/code/core/Mage/Core/Model/Message/Abstract.php +++ b/app/code/core/Mage/Core/Model/Message/Abstract.php @@ -40,37 +40,64 @@ abstract class Mage_Core_Model_Message_Abstract protected $_identifier; protected $_isSticky = false; - public function __construct($type, $code='') + /** + * Mage_Core_Model_Message_Abstract constructor. + * @param string $type + * @param string $code + */ + public function __construct($type, $code = '') { $this->_type = $type; $this->_code = $code; } + /** + * @return string + */ public function getCode() { return $this->_code; } + /** + * @return string + */ public function getText() { return $this->getCode(); } + /** + * @return string + */ public function getType() { return $this->_type; } + /** + * @param string $class + * @return $this + */ public function setClass($class) { $this->_class = $class; + return $this; } + /** + * @param string $method + * @return $this + */ public function setMethod($method) { $this->_method = $method; + return $this; } + /** + * @return string + */ public function toString() { $out = $this->getType().': '.$this->getText(); diff --git a/app/code/core/Mage/Core/Model/Message/Collection.php b/app/code/core/Mage/Core/Model/Message/Collection.php index 4993c1eedcd..d21c1d9fa24 100644 --- a/app/code/core/Mage/Core/Model/Message/Collection.php +++ b/app/code/core/Mage/Core/Model/Message/Collection.php @@ -115,6 +115,9 @@ public function getMessageByIdentifier($identifier) } } + /** + * @param string $identifier + */ public function deleteMessageByIdentifier($identifier) { foreach ($this->_messages as $type => $messages) { @@ -170,6 +173,9 @@ public function getErrors() return $this->getItemsByType(Mage_Core_Model_Message::ERROR); } + /** + * @return string + */ public function toString() { $out = ''; @@ -184,6 +190,7 @@ public function toString() /** * Retrieve messages count * + * @param string|null $type * @return int */ public function count($type=null) diff --git a/app/code/core/Mage/Core/Model/Message/Error.php b/app/code/core/Mage/Core/Model/Message/Error.php index 00bd89e6ca7..27b7a2820bb 100644 --- a/app/code/core/Mage/Core/Model/Message/Error.php +++ b/app/code/core/Mage/Core/Model/Message/Error.php @@ -24,9 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Model_Message_Error extends Mage_Core_Model_Message_Abstract { + /** + * @param string $code + */ public function __construct($code) { parent::__construct(Mage_Core_Model_Message::ERROR, $code); diff --git a/app/code/core/Mage/Core/Model/Message/Notice.php b/app/code/core/Mage/Core/Model/Message/Notice.php index de74476298e..0debff41bb1 100644 --- a/app/code/core/Mage/Core/Model/Message/Notice.php +++ b/app/code/core/Mage/Core/Model/Message/Notice.php @@ -24,9 +24,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Model_Message_Notice extends Mage_Core_Model_Message_Abstract { + /** + * Mage_Core_Model_Message_Notice constructor. + * @param string $code + */ public function __construct($code) { parent::__construct(Mage_Core_Model_Message::NOTICE, $code); diff --git a/app/code/core/Mage/Core/Model/Message/Success.php b/app/code/core/Mage/Core/Model/Message/Success.php index 9989cd4ac24..a381bdabad5 100644 --- a/app/code/core/Mage/Core/Model/Message/Success.php +++ b/app/code/core/Mage/Core/Model/Message/Success.php @@ -24,9 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Model_Message_Success extends Mage_Core_Model_Message_Abstract { + /** + * @param string $code + */ public function __construct($code) { parent::__construct(Mage_Core_Model_Message::SUCCESS, $code); diff --git a/app/code/core/Mage/Core/Model/Message/Warning.php b/app/code/core/Mage/Core/Model/Message/Warning.php index 2ea04b96f32..1952b26a5d8 100644 --- a/app/code/core/Mage/Core/Model/Message/Warning.php +++ b/app/code/core/Mage/Core/Model/Message/Warning.php @@ -24,9 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Model_Message_Warning extends Mage_Core_Model_Message_Abstract { + /** + * @param string $code + */ public function __construct($code) { parent::__construct(Mage_Core_Model_Message::WARNING, $code); diff --git a/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php index db5540f272b..0f90f509e41 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php @@ -24,8 +24,15 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +/** + * @method array getData(string $value) + * @method $this setData(string $value, array $value) + */ class Mage_Core_Model_Mysql4_Design_Theme extends Varien_Directory_Collection { + /** + * @return $this + */ public function load() { $packages = $this->getData('themes'); @@ -37,6 +44,9 @@ public function load() return $this; } + /** + * @return array + */ public function toOptionArray() { $options = array(); diff --git a/app/code/core/Mage/Core/Model/Observer.php b/app/code/core/Mage/Core/Model/Observer.php index 675e2bb2ab7..b50a7e0ada7 100644 --- a/app/code/core/Mage/Core/Model/Observer.php +++ b/app/code/core/Mage/Core/Model/Observer.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Core Observer model * @@ -110,12 +109,12 @@ public function cleanCache(Mage_Cron_Model_Schedule $schedule) /** * Cleans cache by tags * - * @param Varien_Event_Observer $observer + * @param Varien_Event_Observer|OpenMage_Observer_CleanCacheByTags_Observer $observer * @return $this */ public function cleanCacheByTags(Varien_Event_Observer $observer) { - /** @var $tags array */ + /** @var array $tags */ $tags = $observer->getEvent()->getTags(); if (empty($tags)) { Mage::app()->cleanCache(); diff --git a/app/code/core/Mage/Core/Model/Resource.php b/app/code/core/Mage/Core/Model/Resource.php index 52f58c63d46..61787bbbbc8 100644 --- a/app/code/core/Mage/Core/Model/Resource.php +++ b/app/code/core/Mage/Core/Model/Resource.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Resources and connections registry and factory * @@ -79,7 +78,7 @@ class Mage_Core_Model_Resource * Creates a connection to resource whenever needed * * @param string $name - * @return Varien_Db_Adapter_Interface + * @return Varien_Db_Adapter_Interface|false */ public function getConnection($name) { @@ -91,6 +90,7 @@ public function getConnection($name) } return $connection; } + /** @var Mage_Core_Model_Config_Element $connConfig */ $connConfig = Mage::getConfig()->getResourceConnectionConfig($name); if (!$connConfig) { @@ -232,7 +232,7 @@ public function getConnectionTypeInstance($type) * * @param string $model * @param string $entity - * @return Varien_Simplexml_Config + * @return SimpleXMLElement|Varien_Simplexml_Config */ public function getEntity($model, $entity) { @@ -359,7 +359,7 @@ public function cleanDbRow(&$row) * @param string $name * @param string $type * @param array $config - * @return unknown + * @return Varien_Db_Adapter_Interface */ public function createConnection($name, $type, $config) { @@ -378,12 +378,19 @@ public function checkDbConnection() } } + /** + * @return int + */ public function getAutoUpdate() { return self::AUTO_UPDATE_ALWAYS; #return Mage::app()->loadCache(self::AUTO_UPDATE_CACHE_KEY); } + /** + * @param $value + * @return $this + */ public function setAutoUpdate($value) { #Mage::app()->saveCache($value, self::AUTO_UPDATE_CACHE_KEY); @@ -415,7 +422,11 @@ public function getIdxName($tableName, $fields, $indexType = Varien_Db_Adapter_I public function getFkName($priTableName, $priColumnName, $refTableName, $refColumnName) { return $this->getConnection(self::DEFAULT_READ_RESOURCE) - ->getForeignKeyName($this->getTableName($priTableName), $priColumnName, - $this->getTableName($refTableName), $refColumnName); + ->getForeignKeyName( + $this->getTableName($priTableName), + $priColumnName, + $this->getTableName($refTableName), + $refColumnName + ); } } diff --git a/app/code/core/Mage/Core/Model/Resource/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Abstract.php index 2c2e75e9b88..46fc3fd14a2 100644 --- a/app/code/core/Mage/Core/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Abstract.php @@ -58,18 +58,20 @@ abstract protected function _construct(); /** * Retrieve connection for read data + * @return Varien_Db_Adapter_Interface */ abstract protected function _getReadAdapter(); /** * Retrieve connection for write data + * @return Varien_Db_Adapter_Interface */ abstract protected function _getWriteAdapter(); /** * Start resource transaction * - * @return Mage_Core_Model_Resource_Abstract + * @return $this */ public function beginTransaction() { @@ -81,7 +83,7 @@ public function beginTransaction() * Subscribe some callback to transaction commit * * @param callback $callback - * @return Mage_Core_Model_Resource_Abstract + * @return $this */ public function addCommitCallback($callback) { @@ -93,7 +95,7 @@ public function addCommitCallback($callback) /** * Commit resource transaction * - * @return Mage_Core_Model_Resource_Abstract + * @return $this */ public function commit() { @@ -117,7 +119,7 @@ public function commit() /** * Roll back resource transaction * - * @return Mage_Core_Model_Resource_Abstract + * @return $this */ public function rollBack() { @@ -138,7 +140,7 @@ public function rollBack() * @param bool $includeTime * @return string */ - public function formatDate($date, $includeTime=true) + public function formatDate($date, $includeTime = true) { return Varien_Date::formatDate($date, $includeTime); } @@ -161,7 +163,7 @@ public function mktime($str) * @param string $field * @param mixed $defaultValue * @param bool $unsetEmpty - * @return Mage_Core_Model_Resource_Abstract + * @return $this */ protected function _serializeField(Varien_Object $object, $field, $defaultValue = null, $unsetEmpty = false) { @@ -185,7 +187,7 @@ protected function _serializeField(Varien_Object $object, $field, $defaultValue /** * Unserialize Varien_Object field in an object * - * @param Mage_Core_Model_Abstract $object + * @param Varien_Object $object * @param string $field * @param mixed $defaultValue */ diff --git a/app/code/core/Mage/Core/Model/Resource/Config/Data.php b/app/code/core/Mage/Core/Model/Resource/Config/Data.php index 8dcd86f634c..5350a983618 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config/Data.php +++ b/app/code/core/Mage/Core/Model/Resource/Config/Data.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Core config data resource model * @@ -46,8 +45,8 @@ protected function _construct() /** * Convert array to comma separated value * - * @param Mage_Core_Model_Abstract $object - * @return $this + * @param Mage_Core_Model_Config_Data $object + * {@inheritDoc} */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { @@ -66,7 +65,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object) * Set id to object if exists configuration instead of throw exception * * @param Mage_Core_Model_Config_Data $object - * @return $this + * {@inheritDoc} */ protected function _checkUnique(Mage_Core_Model_Abstract $object) { diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php index 6703239e49c..4e77afa72e2 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Abstract resource model class * @@ -197,7 +196,7 @@ protected function _setResource($connections, $tables = null) * * @param string $mainTable * @param string|null $idFieldName - * @return Mage_Core_Model_Resource_Db_Abstract + * @return $this */ protected function _setMainTable($mainTable, $idFieldName = null) { @@ -307,7 +306,7 @@ public function getValueTable($entityName, $valueType) * Get connection by name or type * * @param string $connectionName - * @return Zend_Db_Adapter_Abstract + * @return Varien_Db_Adapter_Interface */ protected function _getConnection($connectionName) { @@ -316,7 +315,8 @@ protected function _getConnection($connectionName) } if (!empty($this->_resourcePrefix)) { $this->_connections[$connectionName] = $this->_resources->getConnection( - $this->_resourcePrefix . '_' . $connectionName); + $this->_resourcePrefix . '_' . $connectionName + ); } else { $this->_connections[$connectionName] = $this->_resources->getConnection($connectionName); } @@ -327,7 +327,7 @@ protected function _getConnection($connectionName) /** * Retrieve connection for read data * - * @return Varien_Db_Adapter_Interface + * @return Varien_Db_Adapter_Interface|Zend_Db_Adapter_Abstract */ protected function _getReadAdapter() { @@ -342,7 +342,7 @@ protected function _getReadAdapter() /** * Retrieve connection for write data * - * @return Varien_Db_Adapter_Interface + * @return Varien_Db_Adapter_Interface|Zend_Db_Adapter_Abstract */ protected function _getWriteAdapter() { @@ -365,7 +365,7 @@ public function getReadConnection() * @param Mage_Core_Model_Abstract $object * @param mixed $value * @param string $field field to load by (defaults to model id) - * @return Mage_Core_Model_Resource_Db_Abstract + * @return $this */ public function load(Mage_Core_Model_Abstract $object, $value, $field = null) { @@ -395,7 +395,7 @@ public function load(Mage_Core_Model_Abstract $object, $value, $field = null) * @param string $field * @param mixed $value * @param Mage_Core_Model_Abstract $object - * @return Zend_Db_Select + * @return Varien_Db_Select */ protected function _getLoadSelect($field, $value, $object) { @@ -412,7 +412,7 @@ protected function _getLoadSelect($field, $value, $object) * Save object object data * * @param Mage_Core_Model_Abstract $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @return $this */ public function save(Mage_Core_Model_Abstract $object) { @@ -472,7 +472,7 @@ public function save(Mage_Core_Model_Abstract $object) * * @deprecated * @param Mage_Core_Model_Abstract $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @return $this */ public function forsedSave(Mage_Core_Model_Abstract $object) { @@ -497,8 +497,8 @@ public function forsedSave(Mage_Core_Model_Abstract $object) /** * Delete the object * - * @param Varien_Object $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @param Mage_Core_Model_Abstract $object + * @return $this */ public function delete(Mage_Core_Model_Abstract $object) { @@ -515,14 +515,14 @@ public function delete(Mage_Core_Model_Abstract $object) * Add unique field restriction * * @param array|string $field - * @return Mage_Core_Model_Resource_Db_Abstract + * @return $this */ public function addUniqueField($field) { if (is_null($this->_uniqueFields)) { $this->_initUniqueFields(); } - if (is_array($this->_uniqueFields) ) { + if (is_array($this->_uniqueFields)) { $this->_uniqueFields[] = $field; } return $this; @@ -531,7 +531,7 @@ public function addUniqueField($field) /** * Reset unique fields restrictions * - * @return Mage_Core_Model_Resource_Db_Abstract + * @return $this */ public function resetUniqueField() { @@ -555,7 +555,7 @@ public function unserializeFields(Mage_Core_Model_Abstract $object) /** * Initialize unique fields * - * @return Mage_Core_Model_Resource_Db_Abstract + * @return $this */ protected function _initUniqueFields() { @@ -626,7 +626,7 @@ protected function _prepareValueForSave($value, $type) * Check for unique values existence * * @param Mage_Core_Model_Abstract $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @return $this * @throws Mage_Core_Exception */ protected function _checkUnique(Mage_Core_Model_Abstract $object) @@ -692,8 +692,8 @@ public function afterLoad(Mage_Core_Model_Abstract $object) /** * Perform actions after object load * - * @param Varien_Object $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @param Mage_Core_Model_Abstract $object + * @return $this */ protected function _afterLoad(Mage_Core_Model_Abstract $object) { @@ -703,8 +703,8 @@ protected function _afterLoad(Mage_Core_Model_Abstract $object) /** * Perform actions before object save * - * @param Varien_Object $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @param Mage_Core_Model_Abstract $object + * @return $this */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { @@ -714,8 +714,8 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object) /** * Perform actions after object save * - * @param Varien_Object $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @param Mage_Core_Model_Abstract $object + * @return $this */ protected function _afterSave(Mage_Core_Model_Abstract $object) { @@ -725,8 +725,8 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) /** * Perform actions before object delete * - * @param Varien_Object $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @param Mage_Core_Model_Abstract $object + * @return $this */ protected function _beforeDelete(Mage_Core_Model_Abstract $object) { @@ -736,8 +736,8 @@ protected function _beforeDelete(Mage_Core_Model_Abstract $object) /** * Perform actions after object delete * - * @param Varien_Object $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @param Mage_Core_Model_Abstract $object + * @return $this */ protected function _afterDelete(Mage_Core_Model_Abstract $object) { @@ -774,5 +774,4 @@ public function getChecksum($table) } return $checksum; } - } diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php index a37b903d520..1a4cf16fa38 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Abstract Core Resource Collection * @@ -141,7 +140,6 @@ public function __construct($resource = null) */ protected function _construct() { - } /** @@ -162,7 +160,7 @@ public function getMainTable() * Set main collection table * * @param string $table - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ public function setMainTable($table) { @@ -185,7 +183,7 @@ public function setMainTable($table) /** * Init collection select * - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ protected function _initSelect() { @@ -210,7 +208,7 @@ public function getSelect() /** * Init fields for select * - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ protected function _initSelectFields() { @@ -253,7 +251,6 @@ protected function _initSelectFields() $columnEntry = array('main_table', $field, $alias); array_splice($columns, $insertIndex, 0, array($columnEntry)); // Insert column $insertIndex ++; - } } else { array_unshift($columns, array('main_table', '*', null)); @@ -282,7 +279,7 @@ protected function _getInitialFieldsToSelect() /** * Initialize initial fields to select like id field * - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ protected function _initInitialFieldsToSelect() { @@ -298,7 +295,7 @@ protected function _initInitialFieldsToSelect() * * @param string|array $field * @param string|null $alias - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ public function addFieldToSelect($field, $alias = null) { @@ -344,7 +341,7 @@ public function addFieldToSelect($field, $alias = null) * @param string $alias * @param string $expression * @param array $fields - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ public function addExpressionFieldToSelect($alias, $expression, $fields) { @@ -368,7 +365,7 @@ public function addExpressionFieldToSelect($alias, $expression, $fields) * * @param string|null $field * @param boolean $isAlias Alias identifier - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ public function removeFieldFromSelect($field, $isAlias = false) { @@ -392,7 +389,7 @@ public function removeFieldFromSelect($field, $isAlias = false) /** * Removes all fields from select * - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ public function removeAllFieldsFromSelect() { @@ -406,7 +403,7 @@ public function removeAllFieldsFromSelect() * * @param string $model * @param Mage_Core_Model_Resource_Db_Abstract $resourceModel - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ protected function _init($model, $resourceModel = null) { @@ -422,7 +419,7 @@ protected function _init($model, $resourceModel = null) * Set model name for collection items * * @param string $model - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ public function setModel($model) { @@ -437,7 +434,7 @@ public function setModel($model) * Get model instance * * @param array $args - * @return Varien_Object + * @return string */ public function getModelName($args = array()) { @@ -505,11 +502,12 @@ public function getAllIds() return $this->getConnection()->fetchCol($idsSelect); } + /** + * @return array + */ public function getData() { if ($this->_data === null) { - - $this->_renderFilters() ->_renderOrders() ->_renderLimit(); @@ -527,10 +525,13 @@ public function getData() /** * Prepare select for load * + * @param Varien_Db_Select $select * @return string + * @throws Zend_Db_Select_Exception */ protected function _prepareSelect(Varien_Db_Select $select) { + /** @var Mage_Core_Model_Resource_Helper_Mysql4 $helper */ $helper = Mage::getResourceHelper('core'); $unionParts = $select->getPart(Zend_Db_Select::UNION); @@ -550,7 +551,7 @@ protected function _prepareSelect(Varien_Db_Select $select) * @param string $table * @param string $cond * @param string $cols - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ public function join($table, $cond, $cols = '*') { @@ -578,7 +579,7 @@ public function join($table, $cond, $cols = '*') /** * Redeclare before load method for adding event * - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ protected function _beforeLoad() { @@ -596,7 +597,7 @@ protected function _beforeLoad() * Set reset items data changed flag * * @param boolean $flag - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ public function setResetItemsDataChanged($flag) { @@ -607,10 +608,11 @@ public function setResetItemsDataChanged($flag) /** * Set flag data has changed to all collection items * - * @return Mage_Core_Model_Mysql4_Collection_Abstract + * @return $this */ public function resetItemsDataChanged() { + /** @var Varien_Object $item */ foreach ($this->_items as $item) { $item->setDataChanges(false); } @@ -621,11 +623,12 @@ public function resetItemsDataChanged() /** * Redeclare after load method for specifying collection items original data * - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ protected function _afterLoad() { parent::_afterLoad(); + /** @var Varien_Object $item */ foreach ($this->_items as $item) { $item->setOrigData(); if ($this->_resetItemsDataChanged) { @@ -644,10 +647,11 @@ protected function _afterLoad() /** * Save all the entities in the collection * - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ public function save() { + /** @var Varien_Object $item */ foreach ($this->getItems() as $item) { $item->save(); } @@ -681,7 +685,7 @@ protected function _loadCache($select) * * @param array $data * @param Zend_Db_Select $select - * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @return $this */ protected function _saveCache($data, $select) { @@ -713,7 +717,4 @@ public function formatDate($date, $includeTime = true) { return Varien_Date::formatDate($date, $includeTime); } - - - } diff --git a/app/code/core/Mage/Core/Model/Resource/Design.php b/app/code/core/Mage/Core/Model/Resource/Design.php index d52f88ad7cf..d1ed90a61d9 100644 --- a/app/code/core/Mage/Core/Model/Resource/Design.php +++ b/app/code/core/Mage/Core/Model/Resource/Design.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Core Design Resource Model * @@ -44,11 +43,8 @@ protected function _construct() } /** - * Perform actions before object save - * - * @param Mage_Core_Model_Abstract $object - * @return Mage_Core_Model_Resource_Db_Abstract - * @throws Mage_Core_Exception + * @param Mage_Core_Model_Design $object + * @inheritDoc */ public function _beforeSave(Mage_Core_Model_Abstract $object) { @@ -73,7 +69,8 @@ public function _beforeSave(Mage_Core_Model_Abstract $object) if ($check) { Mage::throwException( - Mage::helper('core')->__('Your design change for the specified store intersects with another one, please specify another date range.')); + Mage::helper('core')->__('Your design change for the specified store intersects with another one, please specify another date range.') + ); } parent::_beforeSave($object); @@ -84,10 +81,10 @@ public function _beforeSave(Mage_Core_Model_Abstract $object) * Check intersections * * @param int $storeId - * @param date $dateFrom - * @param date $dateTo + * @param string $dateFrom + * @param string $dateTo * @param int $currentId - * @return Array + * @return string */ protected function _checkIntersection($storeId, $dateFrom, $dateTo, $currentId) { diff --git a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php index 7894f54a463..2b4ccb0cf76 100644 --- a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php @@ -50,10 +50,11 @@ protected function _construct() */ public function joinStore() { - return $this->join( + return $this->join( array('cs' => 'core/store'), 'cs.store_id = main_table.store_id', - array('cs.name')); + array('cs.name') + ); } /** diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Queue.php b/app/code/core/Mage/Core/Model/Resource/Email/Queue.php index f24bc4eb66a..0b9e40e4a3d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Queue.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Queue.php @@ -37,9 +37,8 @@ protected function _construct() /** * Load recipients, unserialize message parameters * - * @param Mage_Core_Model_Abstract $object - * - * @return $this + * @param Mage_Core_Model_Email_Queue $object + * {@inheritDoc} */ protected function _afterLoad(Mage_Core_Model_Abstract $object) { @@ -51,8 +50,8 @@ protected function _afterLoad(Mage_Core_Model_Abstract $object) /** * Prepare object data for saving * - * @param Mage_Core_Model_Email_Queue|Mage_Core_Model_Abstract $object - * @return $this + * @param Mage_Core_Model_Email_Queue $object + * {@inheritDoc} */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Template.php b/app/code/core/Mage/Core/Model/Resource/Email/Template.php index 7373f3c5d4d..012e81cccf8 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Template.php @@ -96,7 +96,7 @@ public function checkCodeUsage(Mage_Core_Model_Email_Template $template) * Set template type, added at and modified at time * * @param Mage_Core_Model_Email_Template $object - * @return $this + * {@inheritDoc} */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php b/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php index 59eb81e90fa..a34bb7214b3 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php @@ -32,7 +32,7 @@ * @package Mage_Core * @author Magento Core Team */ -class Mage_Core_Model_Resource_Email_Template_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_Core_Model_Resource_Email_Template_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract { /** * Template table name diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php index 5c54f0743c5..1ef3d08a2f9 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php @@ -81,13 +81,24 @@ public function createDatabaseScheme() ->addColumn('directory', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( 'default' => null ), 'Directory Path') - ->addIndex($adapter->getIndexName($table, array('filename', 'directory_id'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('filename', 'directory_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex( + $adapter->getIndexName( + $table, + array('filename', 'directory_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('filename', 'directory_id'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) ->addIndex($adapter->getIndexName($table, array('directory_id')), array('directory_id')) - ->addForeignKey($adapter->getForeignKeyName($table, 'directory_id', $dirStorageTable, 'directory_id'), - 'directory_id', $dirStorageTable, 'directory_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $adapter->getForeignKeyName($table, 'directory_id', $dirStorageTable, 'directory_id'), + 'directory_id', + $dirStorageTable, + 'directory_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->setComment('File Storage'); $adapter->createTable($ddlTable); @@ -298,7 +309,7 @@ public function deleteFolder($folderName = '') return; } - /* @var $resHelper Mage_Core_Model_Resource_Helper_Abstract */ + /* @var Mage_Core_Model_Resource_Helper_Abstract $resHelper */ $resHelper = Mage::getResourceHelper('core'); $likeExpression = $resHelper->addLikeEscape($folderName . '/', array('position' => 'start')); $this->_getWriteAdapter() diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php index 34825b6ecd0..1cccb7e3b03 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php @@ -45,7 +45,7 @@ protected function _construct() /** * Create database scheme for storing files * - * @return Mage_Core_Model_Mysql4_File_Storage_Database + * @return $this */ public function createDatabaseScheme() { @@ -76,13 +76,24 @@ public function createDatabaseScheme() 'default' => null, 'unsigned' => true ), 'Parent Directory Id') - ->addIndex($adapter->getIndexName($table, array('name', 'parent_id'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('name', 'parent_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex( + $adapter->getIndexName( + $table, + array('name', 'parent_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('name', 'parent_id'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) ->addIndex($adapter->getIndexName($table, array('parent_id')), array('parent_id')) - ->addForeignKey($adapter->getForeignKeyName($table, 'parent_id', $table, 'directory_id'), - 'parent_id', $table, 'directory_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $adapter->getForeignKeyName($table, 'parent_id', $table, 'directory_id'), + 'parent_id', + $table, + 'directory_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->setComment('Directory Storage'); $adapter->createTable($ddlTable); @@ -94,7 +105,7 @@ public function createDatabaseScheme() * * @param Mage_Core_Model_File_Storage_Directory_Database $object * @param string $path - * @return Mage_Core_Model_Mysql4_File_Storage_Directory_Database + * @return $this */ public function loadByPath(Mage_Core_Model_File_Storage_Directory_Database $object, $path) { @@ -150,7 +161,7 @@ public function getParentId($path) /** * Delete all directories from storage * - * @return Mage_Core_Model_Mysql4_File_Storage_Database + * @return $this */ public function clearDirectories() { diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php index 7728b14f5f7..b198d6e3435 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Model for synchronization from DB to filesystem * @@ -109,7 +108,7 @@ public function getStorageData($dir = '') * Clear files and directories in storage * * @param string $dir - * @return Mage_Core_Model_Mysql4_File_Storage_File + * @return $this */ public function clear($dir = '') { @@ -210,9 +209,8 @@ public function saveFile($filePath, $content, $overwrite = false) if (@fwrite($fp, $content) !== false && @fclose($fp)) { return true; } - } - // If overwrite is required, throw exception on failure to write file - else if (@file_put_contents($fullPath, $content, LOCK_EX) !== false) { + } // If overwrite is required, throw exception on failure to write file + elseif (@file_put_contents($fullPath, $content, LOCK_EX) !== false) { return true; } diff --git a/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php index 39ec44f6b5f..e9284d58a52 100644 --- a/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php @@ -101,7 +101,7 @@ protected function _getWriteAdapter() protected function _getConnection($name) { $connection = sprintf('%s_%s', $this->_modulePrefix, $name); - /** @var $resource Mage_Core_Model_Resource */ + /** @var Mage_Core_Model_Resource $resource */ $resource = Mage::getSingleton('core/resource'); return $resource->getConnection($connection); diff --git a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php index 4630bb2bcd6..cebce5adee6 100644 --- a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php @@ -37,7 +37,7 @@ class Mage_Core_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_He * Returns expresion for field unification * * @param string $field - * @return Zend_Db_Expr + * @return string */ public function castField($field) { @@ -73,7 +73,7 @@ public function getQueryUsingAnalyticFunction(Varien_Db_Select $select) * * @param Varien_Db_Select $select * @param string $table - * @param array $table + * @param array $fields * @return string */ public function getInsertFromSelectUsingAnalytic(Varien_Db_Select $select, $table, $fields) @@ -261,7 +261,7 @@ protected function _assembleLimit($query, $limitCount, $limitOffset, $columnList * Prepare select column list * * @param Varien_Db_Select $select - * @param $groupByCondition OPTIONAL + * @param string $groupByCondition * @return array * @throws Zend_Db_Exception */ diff --git a/app/code/core/Mage/Core/Model/Resource/Layout.php b/app/code/core/Mage/Core/Model/Resource/Layout.php index 4f778fb4cca..878087b136d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Layout.php +++ b/app/code/core/Mage/Core/Model/Resource/Layout.php @@ -71,9 +71,11 @@ public function fetchUpdatesByHandle($handle, $params = array()) if ($readAdapter) { $select = $readAdapter->select() ->from(array('layout_update' => $this->getMainTable()), array('xml')) - ->join(array('link'=>$this->getTable('core/layout_link')), - 'link.layout_update_id=layout_update.layout_update_id', - '') + ->join( + array('link'=>$this->getTable('core/layout_link')), + 'link.layout_update_id=layout_update.layout_update_id', + '' + ) ->where('link.store_id IN (0, :store_id)') ->where('link.area = :area') ->where('link.package = :package') diff --git a/app/code/core/Mage/Core/Model/Resource/Resource.php b/app/code/core/Mage/Core/Model/Resource/Resource.php index c0a0b5d62ee..98255491301 100644 --- a/app/code/core/Mage/Core/Model/Resource/Resource.php +++ b/app/code/core/Mage/Core/Model/Resource/Resource.php @@ -125,9 +125,11 @@ public function setDbVersion($resName, $version) if ($this->getDbVersion($resName)) { self::$_versions[$resName] = $version; - return $this->_getWriteAdapter()->update($this->getMainTable(), - $dbModuleInfo, - array('code = ?' => $resName)); + return $this->_getWriteAdapter()->update( + $this->getMainTable(), + $dbModuleInfo, + array('code = ?' => $resName) + ); } else { self::$_versions[$resName] = $version; return $this->_getWriteAdapter()->insert($this->getMainTable(), $dbModuleInfo); diff --git a/app/code/core/Mage/Core/Model/Resource/Setup.php b/app/code/core/Mage/Core/Model/Resource/Setup.php index c0f417dbb25..057e9053594 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup.php @@ -54,21 +54,21 @@ class Mage_Core_Model_Resource_Setup /** * Setup resource configuration object * - * @var Varien_Simplexml_Object + * @var Mage_Core_Model_Config_Element */ protected $_resourceConfig; /** * Connection configuration object * - * @var Varien_Simplexml_Object + * @var Mage_Core_Model_Config_Element */ protected $_connectionConfig; /** * Setup module configuration object * - * @var Varien_Simplexml_Object + * @var Mage_Core_Model_Config_Element */ protected $_moduleConfig; @@ -196,7 +196,6 @@ protected function _getTableCacheName($tableName) { if (is_array($tableName)) { return join('_', $tableName); - } return $tableName; } @@ -216,7 +215,7 @@ protected function _getResource() * * @return boolean */ - static public function applyAllUpdates() + public static function applyAllUpdates() { Mage::app()->setUpdateMode(true); self::$_hadUpdates = false; @@ -231,6 +230,7 @@ static public function applyAllUpdates() if (isset($resource->setup->class)) { $className = $resource->setup->getClassName(); } + /** @var Mage_Core_Model_Resource_Setup $setupClass */ $setupClass = new $className($resName); $setupClass->applyUpdates(); if ($setupClass->getCallAfterApplyAllUpdates()) { @@ -251,7 +251,7 @@ static public function applyAllUpdates() * Apply database data updates whenever needed * */ - static public function applyAllDataUpdates() + public static function applyAllDataUpdates() { if (!self::$_schemaUpdatesChecked) { return; @@ -265,6 +265,7 @@ static public function applyAllDataUpdates() if (isset($resource->setup->class)) { $className = $resource->setup->getClassName(); } + /** @var Mage_Core_Model_Resource_Setup $setupClass */ $setupClass = new $className($resName); $setupClass->applyDataUpdates(); } @@ -273,7 +274,6 @@ static public function applyAllDataUpdates() /** * Apply data updates to the system after upgrading. * - * @param string $fromVersion * @return $this */ public function applyDataUpdates() @@ -294,7 +294,7 @@ public function applyDataUpdates() /** * Apply module resource install, upgrade and data scripts * - * @return $this + * @return $this|true */ public function applyUpdates() { @@ -342,7 +342,7 @@ public function applyUpdates() protected function _hookQueries() { $this->_queriesHooked = true; - /* @var $adapter Varien_Db_Adapter_Pdo_Mysql */ + /* @var Varien_Db_Adapter_Pdo_Mysql $adapter */ $adapter = $this->getConnection(); $adapter->setQueryHook(array('object' => $this, 'method' => 'callbackQueryHook')); return $this; @@ -358,7 +358,7 @@ protected function _unhookQueries() if (!$this->_queriesHooked) { return $this; } - /* @var $adapter Varien_Db_Adapter_Pdo_Mysql */ + /* @var Varien_Db_Adapter_Pdo_Mysql $adapter */ $adapter = $this->getConnection(); $adapter->setQueryHook(null); $this->_queriesHooked = false; @@ -531,7 +531,6 @@ protected function _getAvailableDataFiles($actionType, $fromVersion, $toVersion) if (preg_match($regExp, $file, $matches)) { $files[$matches[1]] = $filesDir . DS . $file; } - } $handlerDir->close(); } @@ -576,7 +575,6 @@ protected function _setResourceVersion($actionType, $version) case self::TYPE_DATA_UPGRADE: $this->_getResource()->setDataVersion($this->_resourceName, $version); break; - } return $this; @@ -626,7 +624,6 @@ protected function _modifyResourceDb($actionType, $fromVersion, $toVersion) case 'sql': $sql = file_get_contents($fileName); if (!empty($sql)) { - $result = $this->run($sql); } else { $result = true; @@ -790,7 +787,7 @@ public function deleteTableRow($table, $idField, $id, $parentField = null, $pare * @param mixed|null $value * @param string $parentField * @param string|integer $parentId - * @return Mage_Eav_Model_Entity_Setup + * @return $this */ public function updateTableRow($table, $idField, $id, $field, $value = null, $parentField = null, $parentId = 0) { @@ -835,10 +832,12 @@ public function updateTable($table, $conditionExpr, $valueExpr) if (strpos($table, '/') !== false) { $table = $this->getTable($table); } - $query = sprintf('UPDATE %s SET %s WHERE %s', + $query = sprintf( + 'UPDATE %s SET %s WHERE %s', $this->getConnection()->quoteIdentifier($table), $conditionExpr, - $valueExpr); + $valueExpr + ); $this->getConnection()->query($query); @@ -858,7 +857,6 @@ public function tableExists($table) } return $this->getConnection()->isTableExists($table); - } /******************* CONFIG *****************/ diff --git a/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php b/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php index 0585f4c1eb5..01c662a9023 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php @@ -51,7 +51,7 @@ class Mage_Core_Model_Resource_Setup_Query_Modifier /** * Inits query modifier * - * @param $adapter Varien_Db_Adapter_Pdo_Mysql + * @param Varien_Db_Adapter_Pdo_Mysql $args * @return void */ public function __construct($args) @@ -177,7 +177,7 @@ protected function _fixColumnDefinitionInSql(&$sql, $column, $refColumnDefinitio /** * Fixes column definition in already existing table, so outgoing foreign key will be successfully set * - * @param string $sql + * @param string $table * @param string $column * @param array $refColumnDefinition * @return $this @@ -215,7 +215,7 @@ protected function _fixColumnDefinitionInTable($table, $column, $refColumnDefini /** * Returns column definition from already existing table * - * @param string $sql + * @param string $table * @param string $column * @return array|null */ diff --git a/app/code/core/Mage/Core/Model/Resource/Store.php b/app/code/core/Mage/Core/Model/Resource/Store.php index 659a7d5e885..86ff5beda0a 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store.php +++ b/app/code/core/Mage/Core/Model/Resource/Store.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Core Store Resource Model * @@ -60,14 +59,15 @@ protected function _initUniqueFields() /** * Check store code before save * - * @param Mage_Core_Model_Abstract $model - * @return $this + * @param Mage_Core_Model_Store $model + * {@inheritDoc} */ protected function _beforeSave(Mage_Core_Model_Abstract $model) { if (!preg_match('/^[a-z]+[a-z0-9_]*$/', $model->getCode())) { Mage::throwException( - Mage::helper('core')->__('The store code may contain only letters (a-z), numbers (0-9) or underscore(_), the first character must be a letter')); + Mage::helper('core')->__('The store code may contain only letters (a-z), numbers (0-9) or underscore(_), the first character must be a letter') + ); } return $this; @@ -76,8 +76,8 @@ protected function _beforeSave(Mage_Core_Model_Abstract $model) /** * Update Store Group data after save store * - * @param Mage_Core_Model_Abstract $object - * @return $this + * @param Mage_Core_Model_Store $object + * {@inheritDoc} */ protected function _afterSave(Mage_Core_Model_Abstract $object) { @@ -91,8 +91,8 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) /** * Remove core configuration data after delete store * - * @param Mage_Core_Model_Abstract $model - * @return $this + * @param Mage_Core_Model_Store $model + * {@inheritDoc} */ protected function _afterDelete(Mage_Core_Model_Abstract $model) { @@ -137,7 +137,7 @@ protected function _updateGroupDefaultStore($groupId, $storeId) /** * Change store group for store * - * @param Mage_Core_Model_Abstract $model + * @param Mage_Core_Model_Abstract|Mage_Core_Model_Store_Group $model * @return $this */ protected function _changeGroup(Mage_Core_Model_Abstract $model) diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Collection.php b/app/code/core/Mage/Core/Model/Resource/Store/Collection.php index 8c99ea8cfd2..aab294bfcf0 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Collection.php @@ -154,11 +154,7 @@ public function toOptionHash() } /** - * Load collection data - * - * @param boolean $printQuery - * @param boolean $logQuery - * @return $this + * @inheritDoc */ public function load($printQuery = false, $logQuery = false) { diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Group.php b/app/code/core/Mage/Core/Model/Resource/Store/Group.php index 704f095836f..77a686367c4 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Group.php @@ -46,8 +46,8 @@ protected function _construct() /** * Update default store group for website * - * @param Mage_Core_Model_Abstract $model - * @return $this + * @param Mage_Core_Model_Store_Group $model + * {@inheritDoc} */ protected function _afterSave(Mage_Core_Model_Abstract $model) { @@ -83,7 +83,7 @@ protected function _updateWebsiteDefaultGroup($websiteId, $groupId) /** * Change store group website * - * @param Mage_Core_Model_Abstract $model + * @param Mage_Core_Model_Abstract|Mage_Core_Model_Store_Group $model * @return $this */ protected function _changeWebsite(Mage_Core_Model_Abstract $model) diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php index bd6ef64134f..783bcfce96c 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php @@ -95,9 +95,7 @@ public function setWithoutStoreViewFilter() } /** - * Load collection data - * - * @return $this + * @inheritDoc */ public function _beforeLoad() { diff --git a/app/code/core/Mage/Core/Model/Resource/Transaction.php b/app/code/core/Mage/Core/Model/Resource/Transaction.php index 562309c1595..7246efbdf40 100644 --- a/app/code/core/Mage/Core/Model/Resource/Transaction.php +++ b/app/code/core/Mage/Core/Model/Resource/Transaction.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Resource transaction model * @@ -207,5 +206,4 @@ public function delete() } return $this; } - } diff --git a/app/code/core/Mage/Core/Model/Resource/Translate.php b/app/code/core/Mage/Core/Model/Resource/Translate.php index 33aaf4b2935..cd29f75cb27 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate.php @@ -77,14 +77,13 @@ public function getTranslationArray($storeId = null, $locale = null) ); return $adapter->fetchPairs($select, $bind); - } /** * Retrieve translations array by strings * * @param array $strings - * @param int_type $storeId + * @param int $storeId * @return array */ public function getTranslationArrayByStrings(array $strings, $storeId = null) diff --git a/app/code/core/Mage/Core/Model/Resource/Translate/String.php b/app/code/core/Mage/Core/Model/Resource/Translate/String.php index 3f107691948..3cf96e186f4 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate/String.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate/String.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * String translate resource model * @@ -44,12 +43,7 @@ protected function _construct() } /** - * Load - * - * @param Mage_Core_Model_Abstract $object - * @param String $value - * @param String $field - * @return array + * @inheritDoc */ public function load(Mage_Core_Model_Abstract $object, $value, $field = null) { @@ -84,8 +78,8 @@ protected function _getLoadSelect($field, $value, $object) /** * After translation loading * - * @param Mage_Core_Model_Abstract $object - * @return Mage_Core_Model_Resource_Db_Abstract + * @param Mage_Core_Model_Translate_String $object + * {@inheritDoc} */ public function _afterLoad(Mage_Core_Model_Abstract $object) { @@ -99,10 +93,8 @@ public function _afterLoad(Mage_Core_Model_Abstract $object) } /** - * Before save - * - * @param Mage_Core_Model_Abstract $object - * @return $this + * @param Mage_Core_Model_Translate_String $object + * {@inheritDoc} */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { @@ -122,10 +114,8 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object) } /** - * After save - * - * @param Mage_Core_Model_Abstract $object - * @return $this + * @param Mage_Core_Model_Translate_String $object + * {@inheritDoc} */ protected function _afterSave(Mage_Core_Model_Abstract $object) { @@ -154,9 +144,10 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) if (isset($stores[$storeId])) { $adapter->update( - $this->getMainTable(), - $data, - array('key_id = ?' => $stores[$storeId])); + $this->getMainTable(), + $data, + array('key_id = ?' => $stores[$storeId]) + ); } else { $adapter->insert($this->getMainTable(), $data); } diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db.php b/app/code/core/Mage/Core/Model/Resource/Type/Db.php index 45c3258266a..389356f1225 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -abstract class Mage_Core_Model_Resource_Type_Db extends Mage_Core_Model_Resource_Type_Abstract +abstract class Mage_Core_Model_Resource_Type_Db extends Mage_Core_Model_Resource_Type_Abstract { /** * Constructor diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php index 92b7599e95a..af60bd5f29a 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Mysqi Resource * @@ -37,8 +36,8 @@ class Mage_Core_Model_Resource_Type_Db_Mysqli extends Mage_Core_Model_Resource_T /** * Get Connection * - * @param Array $config - * @return Varien_Db_Adapter_Mysqli + * @param array $config + * @return Varien_Db_Adapter_Mysqli */ public function getConnection($config) { diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php index a9cffbc50eb..242e2c40703 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php @@ -24,14 +24,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Model_Resource_Type_Db_Mysqli_Setup extends Mage_Core_Model_Resource_Type_Db { /** * Get connection - * - * @param Array $config - * @return Varien_Db_Adapter_Mysqli + * + * @param array $config + * @return Varien_Db_Adapter_Mysqli */ public function getConnection($config) { diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php b/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php index 817cdd55c5a..dff4c4bed4e 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Model_Resource_Type_Db_Pdo_Mysql extends Mage_Core_Model_Resource_Type_Db { @@ -70,5 +69,4 @@ protected function _getDbAdapterClassName() { return 'Magento_Db_Adapter_Pdo_Mysql'; } - } diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php index 5f5aa168418..dd21fe21dae 100644 --- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php @@ -81,7 +81,7 @@ protected function _initUniqueFields() */ protected function _getLoadSelect($field, $value, $object) { - /** @var $select Varien_Db_Select */ + /** @var Varien_Db_Select $select */ $select = parent::_getLoadSelect($field, $value, $object); if (!is_null($object->getStoreId())) { @@ -109,7 +109,7 @@ public function getRequestPathByIdPath($idPath, $store) } $select = $this->_getReadAdapter()->select(); - /** @var $select Varien_Db_Select */ + /** @var Varien_Db_Select $select */ $select->from(array('main_table' => $this->getMainTable()), 'request_path') ->where('main_table.store_id = :store_id') ->where('main_table.id_path = :id_path') diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php index 7fbf4907682..ca38ede72f6 100644 --- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php @@ -57,7 +57,8 @@ public function addTagsFilter($tags) $this->join( array('curt' => $this->getTable('core/url_rewrite_tag')), 'main_table.url_rewrite_id = curt.url_rewrite_id', - array()); + array() + ); $this->setFlag('tag_table_joined', true); } diff --git a/app/code/core/Mage/Core/Model/Resource/Variable.php b/app/code/core/Mage/Core/Model/Resource/Variable.php index a39e92f0988..9c588e386de 100644 --- a/app/code/core/Mage/Core/Model/Resource/Variable.php +++ b/app/code/core/Mage/Core/Model/Resource/Variable.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Custom variable resource model * @@ -78,10 +77,8 @@ public function getVariableByCode($code, $withValue = false, $storeId = 0) } /** - * Perform actions after object save - * - * @param Mage_Core_Model_Abstract $object - * @return $this + * @param Mage_Core_Model_Variable $object + * @inheritDoc */ protected function _afterSave(Mage_Core_Model_Abstract $object) { @@ -91,10 +88,12 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) * remove store value */ $this->_getWriteAdapter()->delete( - $this->getTable('core/variable_value'), array( + $this->getTable('core/variable_value'), + array( 'variable_id = ?' => $object->getId(), 'store_id = ?' => $object->getStoreId() - )); + ) + ); } else { $data = array( 'variable_id' => $object->getId(), @@ -113,12 +112,8 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) } /** - * Retrieve select object for load object data - * - * @param string $field - * @param mixed $value - * @param Mage_Core_Model_Abstract $object - * @return Zend_Db_Select + * @param Mage_Core_Model_Variable $object + * @inheritDoc */ protected function _getLoadSelect($field, $value, $object) { @@ -141,13 +136,15 @@ protected function _addValueToSelect(Zend_Db_Select $select, $storeId = Mage_Cor $ifNullHtmlValue = $adapter->getCheckSql('store.html_value IS NULL', 'def.html_value', 'store.html_value'); $select->joinLeft( - array('def' => $this->getTable('core/variable_value')), - 'def.variable_id = '.$this->getMainTable().'.variable_id AND def.store_id = 0', - array()) + array('def' => $this->getTable('core/variable_value')), + 'def.variable_id = '.$this->getMainTable().'.variable_id AND def.store_id = 0', + array() + ) ->joinLeft( array('store' => $this->getTable('core/variable_value')), 'store.variable_id = def.variable_id AND store.store_id = ' . $adapter->quote($storeId), - array()) + array() + ) ->columns(array( 'plain_value' => $ifNullPlainValue, 'html_value' => $ifNullHtmlValue, diff --git a/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php b/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php index 088109f1362..df7c8eec59e 100644 --- a/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php @@ -84,7 +84,8 @@ public function addValuesToResult() ->join( array('value_table' => $this->getTable('core/variable_value')), 'value_table.variable_id = main_table.variable_id', - array('value_table.plain_value', 'value_table.html_value')); + array('value_table.plain_value', 'value_table.html_value') + ); $this->addFieldToFilter('value_table.store_id', array('eq' => $this->getStoreId())); return $this; } diff --git a/app/code/core/Mage/Core/Model/Resource/Website.php b/app/code/core/Mage/Core/Model/Resource/Website.php index c544c0a46fa..cb143a914bf 100644 --- a/app/code/core/Mage/Core/Model/Resource/Website.php +++ b/app/code/core/Mage/Core/Model/Resource/Website.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Core Website Resource Model * @@ -60,8 +59,8 @@ protected function _initUniqueFields() /** * Validate website code before object save * - * @param Mage_Core_Model_Abstract $object - * @return $this + * @param Mage_Core_Model_Website $object + * {@inheritDoc} */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { @@ -73,10 +72,8 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object) } /** - * Perform actions after object save - * - * @param Mage_Core_Model_Abstract $object - * @return $this + * @param Mage_Core_Model_Website $object + * @inheritDoc */ protected function _afterSave(Mage_Core_Model_Abstract $object) { @@ -91,8 +88,8 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) /** * Remove core configuration data after delete website * - * @param Mage_Core_Model_Abstract $model - * @return $this + * @param Mage_Core_Model_Website $model + * {@inheritDoc} */ protected function _afterDelete(Mage_Core_Model_Abstract $model) { @@ -104,13 +101,12 @@ protected function _afterDelete(Mage_Core_Model_Abstract $model) $this->_getWriteAdapter()->delete($this->getTable('core/config_data'), $where); return $this; - } /** * Retrieve default stores select object * Select fields website_id, store_id - * + * * @param boolean $withDefault include/exclude default admin website * @return Varien_Db_Select */ @@ -121,7 +117,8 @@ public function getDefaultStoresSelect($withDefault = false) $select = $this->_getReadAdapter()->select() ->from( array('website_table' => $this->getTable('core/website')), - array('website_id')) + array('website_id') + ) ->joinLeft( array('store_group_table' => $this->getTable('core/store_group')), 'website_table.website_id=store_group_table.website_id' diff --git a/app/code/core/Mage/Core/Model/Resource/Website/Collection.php b/app/code/core/Mage/Core/Model/Resource/Website/Collection.php index 4c6616398d8..02a32aa4333 100644 --- a/app/code/core/Mage/Core/Model/Resource/Website/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Website/Collection.php @@ -81,7 +81,7 @@ public function getLoadDefault() /** * Convert items array to array for select options * - * @return Array + * @return array */ public function toOptionArray() { @@ -91,7 +91,7 @@ public function toOptionArray() /** * Convert items array to hash for select options * - * @return Array + * @return array */ public function toOptionHash() { @@ -120,11 +120,7 @@ public function addIdFilter($ids) } /** - * Load collection data - * - * @param boolean $printQuery - * @param boolean $logQuery - * @return $this + * @inheritDoc */ public function load($printQuery = false, $logQuery = false) { @@ -135,7 +131,6 @@ public function load($printQuery = false, $logQuery = false) ->unshiftOrder('main_table.sort_order', Varien_Db_Select::SQL_ASC); // website sort order FIRST return parent::load($printQuery, $logQuery); - } /** diff --git a/app/code/core/Mage/Core/Model/Session.php b/app/code/core/Mage/Core/Model/Session.php index 8828cbcbb85..ef192ee360f 100644 --- a/app/code/core/Mage/Core/Model/Session.php +++ b/app/code/core/Mage/Core/Model/Session.php @@ -28,14 +28,19 @@ /** * Core session model * - * @todo extend from Mage_Core_Model_Session_Abstract - * * @method null|bool getCookieShouldBeReceived() - * @method Mage_Core_Model_Session setCookieShouldBeReceived(bool $flag) - * @method Mage_Core_Model_Session unsCookieShouldBeReceived() + * @method $this setCookieShouldBeReceived(bool $flag) + * @method $this unsCookieShouldBeReceived() + * @method $this unsSessionHosts() + * @method string getCurrencyCode() + * @method $this setCurrencyCode(string $code) + * @method $this setLastUrl(string $value) */ class Mage_Core_Model_Session extends Mage_Core_Model_Session_Abstract { + /** + * @param array $data + */ public function __construct($data = array()) { $name = isset($data['name']) ? $data['name'] : null; diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php index 7a7b7008b8d..afe5b5cfd74 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract.php @@ -24,13 +24,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Core Session Abstract model * * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method $this setMessages(Mage_Core_Model_Abstract|Mage_Core_Model_Message_Collection $value) */ class Mage_Core_Model_Session_Abstract extends Mage_Core_Model_Session_Abstract_Varien { @@ -229,10 +230,12 @@ public function getMessages($clear=false) public function addException(Exception $exception, $alternativeText) { // log exception to exceptions log - $message = sprintf('Exception message: %s%sTrace: %s', + $message = sprintf( + 'Exception message: %s%sTrace: %s', $exception->getMessage(), "\n", - $exception->getTraceAsString()); + $exception->getTraceAsString() + ); $file = Mage::getStoreConfig(self::XML_PATH_LOG_EXCEPTION_FILE); Mage::log($message, Zend_Log::DEBUG, $file); @@ -370,8 +373,7 @@ public function addUniqueMessages($messages) /** * Specify session identifier * - * @param string|null $id - * @return Mage_Core_Model_Session_Abstract + * {@inheritDoc} */ public function setSessionId($id=null) { @@ -400,6 +402,9 @@ public function getEncryptedSessionId() return self::$_encryptedSessionId; } + /** + * @return string + */ public function getSessionIdQueryParam() { $_sessionName = $this->getSessionName(); diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php index 725f25d24ed..8024224a6e8 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php @@ -22,6 +22,8 @@ * @package Mage_Core * @copyright Copyright (c) 2006-2019 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * + * @method bool getSkipEmptySessionCheck() */ @@ -65,7 +67,7 @@ public function start($sessionName=null) * backward compatibility with db argument (option is @deprecated after 1.12.0.2) */ case 'db': - /* @var $sessionResource Mage_Core_Model_Resource_Session */ + /* @var Mage_Core_Model_Resource_Session $sessionResource */ $sessionResource = Mage::getResourceSingleton('core/session'); $sessionResource->setSaveHandler(); break; @@ -432,9 +434,8 @@ public function validate() } if (!isset($_SESSION[self::VALIDATOR_KEY])) { $_SESSION[self::VALIDATOR_KEY] = $this->getValidatorData(); - } - else { - if ( ! self::$isValidated && ! $this->_validate()) { + } else { + if (! self::$isValidated && ! $this->_validate()) { $this->getCookie()->delete(session_name()); // throw core session exception throw new Mage_Core_Model_Session_Exception(''); diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php b/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php index cb655c02311..f6830e720a1 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php @@ -30,6 +30,10 @@ * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method string getCookieDomain() + * @method string getCookiePath() + * @method string getCookieLifetime() */ abstract class Mage_Core_Model_Session_Abstract_Zend extends Varien_Object { @@ -40,11 +44,17 @@ abstract class Mage_Core_Model_Session_Abstract_Zend extends Varien_Object */ protected $_namespace; + /** + * @return Zend_Session_Namespace + */ public function getNamespace() { return $this->_namespace; } + /** + * @return $this + */ public function start() { Varien_Profiler::start(__METHOD__.'/setOptions'); @@ -83,6 +93,7 @@ public function start() * Initialization session namespace * * @param string $namespace + * @return $this */ public function init($namespace) { @@ -99,11 +110,12 @@ public function init($namespace) /** * Redeclaration object setter * - * @param string $key - * @param mixed $value - * @return Mage_Core_Model_Session_Abstract + * @param string $key + * @param mixed $value + * @param bool $isChanged + * @return $this */ - public function setData($key, $value='', $isChanged = false) + public function setData($key, $value = '', $isChanged = false) { if (!$this->_namespace->data) { $this->_namespace->data = new Varien_Object(); @@ -137,7 +149,7 @@ public function getData($var=null, $clear=false) /** * Cleare session data * - * @return Mage_Core_Model_Session_Abstract + * @return $this */ public function unsetAll() { @@ -155,7 +167,11 @@ public function getSessionId() return Zend_Session::getId(); } - public function setSessionId($id=null) + /** + * @param null $id + * @return $this + */ + public function setSessionId($id = null) { if (!is_null($id)) { Zend_Session::setId($id); @@ -166,7 +182,7 @@ public function setSessionId($id=null) /** * Regenerate session Id * - * @return Mage_Core_Model_Session_Abstract_Zend + * @return $this */ public function regenerateSessionId() { diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 86bfc2ba7c2..4cfae253b00 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -29,13 +29,19 @@ * * @method Mage_Core_Model_Resource_Store _getResource() * @method Mage_Core_Model_Resource_Store getResource() - * @method Mage_Core_Model_Store setCode(string $value) - * @method Mage_Core_Model_Store setWebsiteId(int $value) - * @method Mage_Core_Model_Store setGroupId(int $value) - * @method Mage_Core_Model_Store setName(string $value) + * @method $this setCode(string $value) + * @method $this setWebsiteId(int $value) + * @method $this setGroupId(int $value) + * @method $this setName(string $value) * @method int getSortOrder() - * @method Mage_Core_Model_Store setSortOrder(int $value) - * @method Mage_Core_Model_Store setIsActive(int $value) + * @method $this setSortOrder(int $value) + * @method $this setIsActive(int $value) + * @method string getHomeUrl() + * @method $this setHomeUrl(string $value) + * @method $this setLocaleCode(string $value) + * @method int getStoreId() + * @method $this setStoreId(int $value) + * @method string getLocaleCode() * * @category Mage * @package Mage_Core @@ -299,7 +305,7 @@ protected function _construct() /** * Retrieve store session object * - * @return Mage_Core_Model_Session_Abstract + * @return Mage_Core_Model_Session */ protected function _getSession() { @@ -311,11 +317,7 @@ protected function _getSession() } /** - * Loading store data - * - * @param mixed $id - * @param string $field - * @return Mage_Core_Model_Store + * @inheritDoc */ public function load($id, $field = null) { @@ -330,7 +332,7 @@ public function load($id, $field = null) * Loading store configuration data * * @param string $code - * @return Mage_Core_Model_Store + * @return $this */ public function loadConfig($code) { @@ -458,7 +460,7 @@ public function setWebsite(Mage_Core_Model_Website $website) /** * Retrieve store website * - * @return Mage_Core_Model_Website + * @return Mage_Core_Model_Website|false */ public function getWebsite() { @@ -477,7 +479,7 @@ public function getWebsite() * @param string $fullPath * @param string $path * @param Varien_Simplexml_Element $node - * @return string + * @return array|string */ protected function _processConfigValue($fullPath, $path, $node) { @@ -534,7 +536,6 @@ public function processSubst($value) if (strpos($value, '{{unsecure_base_url}}') !== false) { $unsecureBaseUrl = $this->getConfig(self::XML_PATH_UNSECURE_BASE_URL); $value = str_replace('{{unsecure_base_url}}', $unsecureBaseUrl, $value); - } elseif (strpos($value, '{{secure_base_url}}') !== false) { $secureBaseUrl = $this->getConfig(self::XML_PATH_SECURE_BASE_URL); $value = str_replace('{{secure_base_url}}', $secureBaseUrl, $value); @@ -566,7 +567,7 @@ public function getDefaultBasePath() */ public function getUrl($route = '', $params = array()) { - /** @var $url Mage_Core_Model_Url */ + /** @var Mage_Core_Model_Url $url */ $url = Mage::getModel('core/url') ->setStore($this); if (Mage::app()->getStore()->getId() != $this->getId()) { @@ -747,8 +748,10 @@ public function isAdminUrlSecure() public function isFrontUrlSecure() { if ($this->_isFrontSecure === null) { - $this->_isFrontSecure = Mage::getStoreConfigFlag(Mage_Core_Model_Url::XML_PATH_SECURE_IN_FRONT, - $this->getId()); + $this->_isFrontSecure = Mage::getStoreConfigFlag( + Mage_Core_Model_Url::XML_PATH_SECURE_IN_FRONT, + $this->getId() + ); } return $this->_isFrontSecure; } @@ -1022,11 +1025,11 @@ public function getPriceFilter() $this->_priceFilter = $this->getCurrentCurrency()->getFilter(); $this->_priceFilter->setRate($this->getBaseCurrency()->getRate($this->getCurrentCurrency())); } - } elseif ($this->getDefaultCurrency()) { - $this->_priceFilter = $this->getDefaultCurrency()->getFilter(); - } else { - $this->_priceFilter = new Varien_Filter_Sprintf('%s', 2); - } + } elseif ($this->getDefaultCurrency()) { + $this->_priceFilter = $this->getDefaultCurrency()->getFilter(); + } else { + $this->_priceFilter = new Varien_Filter_Sprintf('%s', 2); + } return $this->_priceFilter; } @@ -1056,7 +1059,7 @@ public function setGroup($group) /** * Retrieve group model * - * @return Mage_Core_Model_Store_Group + * @return Mage_Core_Model_Store_Group|false */ public function getGroup() { @@ -1123,7 +1126,8 @@ public function getCurrentUrl($fromStore = true) { $sidQueryParam = $this->_getSession()->getSessionIdQueryParam(); $requestString = Mage::getSingleton('core/url')->escape( - ltrim(Mage::app()->getRequest()->getRequestString(), '/')); + ltrim(Mage::app()->getRequest()->getRequestString(), '/') + ); $storeUrl = Mage::app()->getStore()->isCurrentlySecure() ? $this->getUrl('', array('_secure' => true)) @@ -1184,7 +1188,7 @@ public function getName() * * Register indexing event before delete store * - * @return $this + * {@inheritDoc} */ protected function _beforeDelete() { diff --git a/app/code/core/Mage/Core/Model/Store/Group.php b/app/code/core/Mage/Core/Model/Store/Group.php index 7c25c6717b3..86eb0ac14e6 100644 --- a/app/code/core/Mage/Core/Model/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Store/Group.php @@ -29,17 +29,22 @@ * * @method Mage_Core_Model_Resource_Store_Group _getResource() * @method Mage_Core_Model_Resource_Store_Group getResource() - * @method Mage_Core_Model_Store_Group setWebsiteId(int $value) + * @method $this setWebsiteId(int $value) * @method string getName() - * @method Mage_Core_Model_Store_Group setName(string $value) - * @method Mage_Core_Model_Store_Group setRootCategoryId(int $value) - * @method Mage_Core_Model_Store_Group setDefaultStoreId(int $value) + * @method $this setName(string $value) + * @method $this setRootCategoryId(int $value) + * @method $this setDefaultStoreId(int $value) + * @method $this setHomeUrl(string $value) + * @method bool hasDefaultStoreId() + * @method bool hasGroupId() + * @method int getGroupId() + * @method int getOriginalGroupId() + * @method int getOriginalWebsiteId() * * @category Mage * @package Mage_Core * @author Magento Core Team */ - class Mage_Core_Model_Store_Group extends Mage_Core_Model_Abstract { const ENTITY = 'store_group'; @@ -115,12 +120,12 @@ protected function _construct() /** * Load store collection and set internal data - * */ protected function _loadStores() { $this->_stores = array(); $this->_storesCount = 0; + /** @var Mage_Core_Model_Store $store */ foreach ($this->getStoreCollection() as $store) { $this->_stores[$store->getId()] = $store; $this->_storeIds[$store->getId()] = $store->getId(); @@ -167,7 +172,7 @@ public function getStoreCollection() /** * Retrieve wersite store objects * - * @return array + * @return Mage_Core_Model_Store[] */ public function getStores() { @@ -203,6 +208,9 @@ public function getStoreCodes() return $this->_storeCodes; } + /** + * @return int + */ public function getStoresCount() { if (is_null($this->_stores)) { @@ -214,7 +222,7 @@ public function getStoresCount() /** * Retrieve default store model * - * @return Mage_Core_Model_Store + * @return Mage_Core_Model_Store|false */ public function getDefaultStore() { @@ -259,7 +267,6 @@ public function getStoresByLocale($locale) { $stores = array(); foreach ($this->getStores() as $store) { - /* @var $store Mage_Core_Model_Store */ if ($store->getLocaleCode() == $locale) { array_push($stores, $store); } @@ -280,7 +287,7 @@ public function setWebsite(Mage_Core_Model_Website $website) /** * Retrieve website model * - * @return Mage_Core_Model_Website + * @return Mage_Core_Model_Website|false */ public function getWebsite() { @@ -307,21 +314,33 @@ public function isCanDelete() return $this->getWebsite()->getDefaultGroupId() != $this->getId(); } + /** + * @return int + */ public function getDefaultStoreId() { return $this->_getData('default_store_id'); } + /** + * @return int + */ public function getRootCategoryId() { return $this->_getData('root_category_id'); } + /** + * @return int + */ public function getWebsiteId() { return $this->_getData('website_id'); } + /** + * @inheritDoc + */ protected function _beforeDelete() { $this->_protectFromNonAdmin(); diff --git a/app/code/core/Mage/Core/Model/Template.php b/app/code/core/Mage/Core/Model/Template.php index d13827aeca9..c5ca3be6a07 100644 --- a/app/code/core/Mage/Core/Model/Template.php +++ b/app/code/core/Mage/Core/Model/Template.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Template model class * @@ -71,7 +70,7 @@ abstract class Mage_Core_Model_Template extends Mage_Core_Model_Abstract /** * Applying of design config * - * @return Mage_Core_Model_Template + * @return $this */ protected function _applyDesignConfig() { @@ -89,7 +88,7 @@ protected function _applyDesignConfig() /** * Revert design settings to previous * - * @return Mage_Core_Model_Template + * @return $this */ protected function _cancelDesignConfig() { @@ -123,7 +122,7 @@ protected function getDesignConfig() * Initialize design information for template processing * * @param array $config - * @return Mage_Core_Model_Template + * @return $this */ public function setDesignConfig(array $config) { diff --git a/app/code/core/Mage/Core/Model/Translate.php b/app/code/core/Mage/Core/Model/Translate.php index f468481e0ee..28073d81b08 100644 --- a/app/code/core/Mage/Core/Model/Translate.php +++ b/app/code/core/Mage/Core/Model/Translate.php @@ -111,8 +111,9 @@ public function __construct() /** * Initialization translation data * - * @param string $area - * @return Mage_Core_Model_Translate + * @param string $area + * @param bool $forceReload + * @return $this */ public function init($area, $forceReload = false) { @@ -151,7 +152,7 @@ public function init($area, $forceReload = false) /** * Retrieve modules configuration by translation * - * @return Mage_Core_Model_Config_Element + * @return array|SimpleXMLElement */ public function getModulesConfig() { @@ -170,7 +171,7 @@ public function getModulesConfig() * Initialize configuration * * @param array $config - * @return Mage_Core_Model_Translate + * @return $this */ public function setConfig($config) { @@ -207,9 +208,10 @@ public function getConfig($key) /** * Loading data from module translation files * - * @param string $moduleName - * @param string $files - * @return Mage_Core_Model_Translate + * @param string $moduleName + * @param string $files + * @param bool $forceReload + * @return $this */ protected function _loadModuleTranslation($moduleName, $files, $forceReload=false) { @@ -225,6 +227,7 @@ protected function _loadModuleTranslation($moduleName, $files, $forceReload=fals * * @param array $data * @param string $scope + * @param bool $forceReload * @return $this */ protected function _addData($data, $scope, $forceReload=false) @@ -253,8 +256,7 @@ protected function _addData($data, $scope, $forceReload=false) } $scopeKey = $scope . self::SCOPE_SEPARATOR . $key; $this->_data[$scopeKey] = $value; - } - else { + } else { $this->_data[$key] = $value; $this->_dataScope[$key]= $scope; } @@ -262,6 +264,10 @@ protected function _addData($data, $scope, $forceReload=false) return $this; } + /** + * @param string $string + * @return string + */ protected function _prepareDataString($string) { return str_replace('""', '"', $string); @@ -270,6 +276,7 @@ protected function _prepareDataString($string) /** * Loading current theme translation * + * @param bool $forceReload * @return $this */ protected function _loadThemeTranslation($forceReload = false) @@ -282,6 +289,7 @@ protected function _loadThemeTranslation($forceReload = false) /** * Loading current store translation from DB * + * @param bool $forceReload * @return $this */ protected function _loadDbTranslation($forceReload = false) @@ -294,8 +302,9 @@ protected function _loadDbTranslation($forceReload = false) /** * Retrieve translation file for module * - * @param string $module - * @return string + * @param string $module + * @param string $fileName + * @return string */ protected function _getModuleFilePath($module, $fileName) { @@ -349,7 +358,11 @@ public function getLocale() return $this->_locale; } - public function setLocale( $locale ) + /** + * @param string $locale + * @return $this + */ + public function setLocale($locale) { $this->_locale = $locale; return $this; @@ -358,7 +371,7 @@ public function setLocale( $locale ) /** * Retrieve DB resource model * - * @return unknown + * @return Mage_Core_Model_Resource_Translate */ public function getResource() { @@ -399,8 +412,7 @@ public function translate($args) $module = $text->getModule(); $text = $text->getText(); $translated = $this->_getTranslatedString($text, $code); - } - else { + } else { if (!empty($_REQUEST['theme'])) { $module = 'frontend/default/'.$_REQUEST['theme']; } else { @@ -412,7 +424,16 @@ public function translate($args) //array_unshift($args, $translated); //$result = @call_user_func_array('sprintf', $args); - + if (substr_count($translated, '%') != count($args)) { + echo $translated; + Mage::log( + __METHOD__ . '() possible argument count mismatch! for ' . $translated + . ' Backtrace: ' . mageDebugBacktrace(true, false, true), + null, + 'translated.log', + true + ); + } $result = @vsprintf($translated, $args); if ($result === false) { $result = $translated; @@ -515,8 +536,7 @@ public function getCacheId() /** * Loading data cache * - * @param string $area - * @return array | false + * @return array|false */ protected function _loadCache() { @@ -531,8 +551,7 @@ protected function _loadCache() /** * Saving data cache * - * @param string $area - * @return Mage_Core_Model_Translate + * @return $this */ protected function _saveCache() { @@ -565,11 +584,9 @@ protected function _getTranslatedString($text, $code) $translated = ''; if (array_key_exists($code, $this->getData())) { $translated = $this->_data[$code]; - } - elseif (array_key_exists($text, $this->getData())) { + } elseif (array_key_exists($text, $this->getData())) { $translated = $this->_data[$text]; - } - else { + } else { $translated = $text; } return $translated; diff --git a/app/code/core/Mage/Core/Model/Translate/Expr.php b/app/code/core/Mage/Core/Model/Translate/Expr.php index bbd9f97285b..a6b57c1b2f4 100644 --- a/app/code/core/Mage/Core/Model/Translate/Expr.php +++ b/app/code/core/Mage/Core/Model/Translate/Expr.php @@ -33,19 +33,31 @@ class Mage_Core_Model_Translate_Expr { protected $_text; protected $_module; - - public function __construct($text='', $module='') + + /** + * @param string $text + * @param string $module + */ + public function __construct($text = '', $module = '') { $this->_text = $text; $this->_module = $module; } - + + /** + * @param string $text + * @return $this + */ public function setText($text) { $this->_text = $text; return $this; } - + + /** + * @param string $module + * @return $this + */ public function setModule($module) { $this->_module = $module; @@ -78,7 +90,7 @@ public function getModule() * @param string $separator * @return string */ - public function getCode($separator='::') + public function getCode($separator = '::') { return $this->getModule().$separator.$this->getText(); } diff --git a/app/code/core/Mage/Core/Model/Translate/Inline.php b/app/code/core/Mage/Core/Model/Translate/Inline.php index 599700004e6..f56ceba53cb 100644 --- a/app/code/core/Mage/Core/Model/Translate/Inline.php +++ b/app/code/core/Mage/Core/Model/Translate/Inline.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Inline Translations PHP part * @@ -155,7 +154,7 @@ public function isAllowed($store = null) $this->_isAllowed = $active && Mage::helper('core')->isDevAllowed($store); } - /* @var $translate Mage_Core_Model_Translate */ + /* @var Mage_Core_Model_Translate $translate */ $translate = Mage::getSingleton('core/translate'); return $translate->getTranslateInline() && $this->_isAllowed; @@ -173,7 +172,7 @@ public function processAjaxPost($translate) return $this; } - /* @var $resource Mage_Core_Model_Mysql4_Translate_String */ + /* @var Mage_Core_Model_Mysql4_Translate_String $resource */ $resource = Mage::getResourceModel('core/translate_string'); foreach ($translate as $t) { if (Mage::getDesign()->getArea() == 'adminhtml') { @@ -253,8 +252,10 @@ protected function _insertInlineScriptsHtml() $baseJsUrl = Mage::getBaseUrl('js'); $url_prefix = Mage::app()->getStore()->isAdmin() ? 'adminhtml' : 'core'; - $ajaxUrl = Mage::getUrl($url_prefix . '/ajax/translate', - array('_secure'=>Mage::app()->getStore()->isCurrentlySecure())); + $ajaxUrl = Mage::getUrl( + $url_prefix . '/ajax/translate', + array('_secure'=>Mage::app()->getStore()->isCurrentlySecure()) + ); $trigImg = Mage::getDesign()->getSkinUrl('images/fam_book_open.png'); ob_start(); @@ -415,7 +416,8 @@ protected function _getHtmlQuote() /** * Prepare special tags */ - protected function _specialTags() { + protected function _specialTags() + { $this->_translateTags($this->_content, $this->_allowedTagsGlobal, '_applySpecialTagsFormat', false); $this->_translateTags($this->_content, $this->_allowedTagsSimple, '_applySimpleTagsFormat', true); } @@ -567,7 +569,6 @@ protected function _otherText() $this->_content = substr_replace($this->_content, $spanHtml, $m[0][1], strlen($m[0][0])); $next = $m[0][1] + strlen($spanHtml) - 1; } - } /** diff --git a/app/code/core/Mage/Core/Model/Translate/String.php b/app/code/core/Mage/Core/Model/Translate/String.php index a5f2e9283da..37a9dd22911 100644 --- a/app/code/core/Mage/Core/Model/Translate/String.php +++ b/app/code/core/Mage/Core/Model/Translate/String.php @@ -30,11 +30,13 @@ * @method Mage_Core_Model_Resource_Translate_String _getResource() * @method Mage_Core_Model_Resource_Translate_String getResource() * @method int getStoreId() - * @method Mage_Core_Model_Translate_String setStoreId(int $value) + * @method $this setStoreId(int $value) * @method string getTranslate() - * @method Mage_Core_Model_Translate_String setTranslate(string $value) + * @method $this setTranslate(string $value) + * @method array getStoreTranslations() + * @method $this setStoreTranslations(array $value) * @method string getLocale() - * @method Mage_Core_Model_Translate_String setLocale(string $value) + * @method $this setLocale(string $value) * * @category Mage * @package Mage_Core @@ -46,7 +48,11 @@ protected function _construct() { $this->_init('core/translate_string'); } - + + /** + * @param string $string + * @return $this + */ public function setString($string) { $this->setData('string', $string); diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index 9cf3c2e422c..c067a659a68 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -75,6 +75,14 @@ * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method $this setType(string $value) + * @method $this setSecure(bool $value) + * @method $this setSecureIsForced(bool $value) + * @method string getScheme() + * @method string getHost() + * @method string getPort() + * @method string getPath() */ class Mage_Core_Model_Url extends Varien_Object { @@ -294,7 +302,7 @@ public function setRequest(Zend_Controller_Request_Http $request) /** * Zend request object * - * @return Zend_Controller_Request_Http + * @return Mage_Core_Controller_Request_Http */ public function getRequest() { @@ -487,7 +495,7 @@ public function getActionPath() /** * Retrieve route path * - * @param array $routParams + * @param array $routeParams * @return string */ public function getRoutePath($routeParams = array()) @@ -1062,7 +1070,7 @@ protected function _prepareSessionUrlWithParams($url, array $params) return $this; } - /** @var $session Mage_Core_Model_Session */ + /** @var Mage_Core_Model_Session $session */ $session = Mage::getSingleton('core/session', $params); $sessionId = $session->getSessionIdForHost($url); @@ -1128,7 +1136,8 @@ public function escape($value) * @param array $params * @return string */ - public function getDirectUrl($url, $params = array()) { + public function getDirectUrl($url, $params = array()) + { $params['_direct'] = $url; return $this->getUrl('', $params); } @@ -1144,8 +1153,11 @@ public function sessionUrlVar($html) if (strpos($html, '__SID') === false) { return $html; } else { - return preg_replace_callback('#(\?|&|&)___SID=([SU])(&|&)?#', - array($this, "sessionVarCallback"), $html); + return preg_replace_callback( + '#(\?|&|&)___SID=([SU])(&|&)?#', + array($this, "sessionVarCallback"), + $html + ); } } @@ -1160,8 +1172,10 @@ public function useSessionIdForUrl($secure = false) $key = 'use_session_id_for_url_' . (int) $secure; if (is_null($this->getData($key))) { $httpHost = Mage::app()->getFrontController()->getRequest()->getHttpHost(); - $urlHost = parse_url(Mage::app()->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, $secure), - PHP_URL_HOST); + $urlHost = parse_url( + Mage::app()->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, $secure), + PHP_URL_HOST + ); if ($httpHost != $urlHost) { $this->setData($key, true); @@ -1182,7 +1196,7 @@ public function sessionVarCallback($match) { if ($this->useSessionIdForUrl($match[2] == 'S' ? true : false)) { $session = Mage::getSingleton('core/session'); - /* @var $session Mage_Core_Model_Session */ + /* @var Mage_Core_Model_Session $session */ return $match[1] . $session->getSessionIdQueryParam() . '=' . $session->getEncryptedSessionId() diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Url/Rewrite.php index 7982b12c52e..579e78a9860 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite.php @@ -24,29 +24,31 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * Url rewrite model class * * @method Mage_Core_Model_Resource_Url_Rewrite _getResource() * @method Mage_Core_Model_Resource_Url_Rewrite getResource() - * @method Mage_Core_Model_Url_Rewrite setStoreId(int $value) + * @method $this setStoreId(int $value) * @method int getCategoryId() - * @method Mage_Core_Model_Url_Rewrite setCategoryId(int $value) + * @method $this setCategoryId(int $value) * @method int getProductId() - * @method Mage_Core_Model_Url_Rewrite setProductId(int $value) + * @method $this setProductId(int $value) * @method string getIdPath() - * @method Mage_Core_Model_Url_Rewrite setIdPath(string $value) + * @method $this setIdPath(string $value) * @method string getRequestPath() - * @method Mage_Core_Model_Url_Rewrite setRequestPath(string $value) + * @method $this setRequestPath(string $value) * @method string getTargetPath() - * @method Mage_Core_Model_Url_Rewrite setTargetPath(string $value) + * @method $this setTargetPath(string $value) * @method int getIsSystem() - * @method Mage_Core_Model_Url_Rewrite setIsSystem(int $value) + * @method $this setIsSystem(int $value) * @method string getOptions() - * @method Mage_Core_Model_Url_Rewrite setOptions(string $value) + * @method $this setOptions(string $value) * @method string getDescription() - * @method Mage_Core_Model_Url_Rewrite setDescription(string $value) + * @method $this setDescription(string $value) + * @method string|array getTags() + * @method $this setTags(string|array $value) + * @method bool hasCategoryId() * * @category Mage * @package Mage_Core @@ -104,12 +106,20 @@ public function loadByRequestPath($path) return $this; } + /** + * @param string $path + * @return $this + */ public function loadByIdPath($path) { $this->setId(null)->load($path, 'id_path'); return $this; } + /** + * @param string|array $tags + * @return $this + */ public function loadByTags($tags) { $this->setId(null); @@ -138,6 +148,10 @@ public function loadByTags($tags) return $this; } + /** + * @param string $key + * @return bool + */ public function hasOption($key) { $optArr = explode(',', $this->getOptions()); @@ -145,6 +159,10 @@ public function hasOption($key) return array_search($key, $optArr) !== false; } + /** + * @param string|array $tags + * @return $this + */ public function addTag($tags) { $curTags = $this->getTags(); @@ -165,6 +183,10 @@ public function addTag($tags) return $this; } + /** + * @param string|array $tags + * @return $this + */ public function removeTag($tags) { $curTags = $this->getTags(); @@ -188,9 +210,10 @@ public function removeTag($tags) /** * Implement logic of custom rewrites * - * @param Zend_Controller_Request_Http $request - * @param Zend_Controller_Response_Http $response - * @return Mage_Core_Model_Url + * @param Zend_Controller_Request_Http $request + * @param Zend_Controller_Response_Http $response + * @return bool + * @throws Mage_Core_Model_Store_Exception * @deprecated since 1.7.0.2. Refactored and moved to Mage_Core_Controller_Request_Rewrite */ public function rewrite(Zend_Controller_Request_Http $request=null, Zend_Controller_Response_Http $response=null) @@ -237,8 +260,7 @@ public function rewrite(Zend_Controller_Request_Http $request=null, Zend_Control if (!$this->getId() && isset($_GET['___from_store'])) { try { $fromStoreId = Mage::app()->getStore($_GET['___from_store'])->getId(); - } - catch (Exception $e) { + } catch (Exception $e) { return false; } @@ -282,7 +304,7 @@ public function rewrite(Zend_Controller_Request_Http $request=null, Zend_Control if (Mage::getStoreConfig('web/url/use_store') && $storeCode = Mage::app()->getStore()->getCode()) { $targetUrl = $request->getBaseUrl(). '/' . $storeCode . '/' .$this->getTargetPath(); - } + } $queryString = $this->_getQueryString(); if ($queryString) { @@ -315,14 +337,16 @@ protected function _getQueryString() } if ($hasChanges) { return http_build_query($queryParams); - } - else { + } else { return $_SERVER['QUERY_STRING']; } } return false; } + /** + * @return int + */ public function getStoreId() { return $this->_getData('store_id'); diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php index 67cb68fbc0e..6edae5aa895 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php @@ -142,7 +142,7 @@ protected function _rewriteDb() if (!$this->_rewrite->getId() && $fromStore) { $stores = $this->_app->getStores(false, true); if (!empty($stores[$fromStore])) { - /** @var $store Mage_Core_Model_Store */ + /** @var Mage_Core_Model_Store $store */ $store = $stores[$fromStore]; $fromStoreId = $store->getId(); } else { @@ -168,8 +168,10 @@ protected function _rewriteDb() return false; } - $this->_request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, - $this->_rewrite->getRequestPath()); + $this->_request->setAlias( + Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, + $this->_rewrite->getRequestPath() + ); $this->_processRedirectOptions(); return true; diff --git a/app/code/core/Mage/Core/Model/Variable.php b/app/code/core/Mage/Core/Model/Variable.php index 09016bae59f..b68a8bf4f7c 100644 --- a/app/code/core/Mage/Core/Model/Variable.php +++ b/app/code/core/Mage/Core/Model/Variable.php @@ -30,9 +30,12 @@ * @method Mage_Core_Model_Resource_Variable _getResource() * @method Mage_Core_Model_Resource_Variable getResource() * @method string getCode() - * @method Mage_Core_Model_Variable setCode(string $value) + * @method $this setCode(string $value) * @method string getName() - * @method Mage_Core_Model_Variable setName(string $value) + * @method $this setName(string $value) + * @method bool getUseDefaultValue() + * @method string getHtmlValue() + * @method string getPlainValue() * * @category Mage * @package Mage_Core @@ -130,12 +133,12 @@ public function validate() /** * Retrieve variables option array * - * @param boolean $withValues + * @param boolean $withGroup * @return array */ public function getVariablesOptionArray($withGroup = false) { - /* @var $collection Mage_Core_Model_Mysql4_Variable_Collection */ + /* @var Mage_Core_Model_Mysql4_Variable_Collection $collection */ $collection = $this->getCollection(); $variables = array(); foreach ($collection->toOptionArray() as $variable) { @@ -143,8 +146,8 @@ public function getVariablesOptionArray($withGroup = false) 'value' => '{{customVar code=' . $variable['value'] . '}}', 'label' => Mage::helper('core')->__( '%s', - Mage::helper('core')->escapeHtml($variable['label'] - )) + Mage::helper('core')->escapeHtml($variable['label']) + ) ); } if ($withGroup && $variables) { @@ -155,5 +158,4 @@ public function getVariablesOptionArray($withGroup = false) } return $variables; } - } diff --git a/app/code/core/Mage/Core/Model/Website.php b/app/code/core/Mage/Core/Model/Website.php index 6739ecfa559..f2d29b5b8a3 100644 --- a/app/code/core/Mage/Core/Model/Website.php +++ b/app/code/core/Mage/Core/Model/Website.php @@ -29,14 +29,20 @@ * * @method Mage_Core_Model_Resource_Website _getResource() * @method Mage_Core_Model_Resource_Website getResource() - * @method Mage_Core_Model_Website setCode(string $value) + * @method $this setCode(string $value) * @method string getName() - * @method Mage_Core_Model_Website setName(string $value) + * @method $this setName(string $value) * @method int getSortOrder() - * @method Mage_Core_Model_Website setSortOrder(int $value) - * @method Mage_Core_Model_Website setDefaultGroupId(int $value) + * @method $this setSortOrder(int $value) + * @method $this setDefaultGroupId(int $value) * @method int getIsDefault() - * @method Mage_Core_Model_Website setIsDefault(int $value) + * @method $this setIsDefault(int $value) + * @method int getGroupId() + * @method int getStoreId() + * @method $this setStoreId(int $value) + * @method bool hasWebsiteId() + * @method int getWebsiteId() + * @method bool hasDefaultGroupId() * * @category Mage * @package Mage_Core @@ -151,11 +157,7 @@ protected function _construct() } /** - * Custom load - * - * @param int|string $id - * @param string $field - * @return $this + * @inheritDoc */ public function load($id, $field = null) { @@ -201,9 +203,9 @@ public function loadConfig($code) * @param string $path * @return mixed */ - public function getConfig($path) { + public function getConfig($path) + { if (!isset($this->_configCache[$path])) { - $config = Mage::getConfig()->getNode('websites/'.$this->getCode().'/'.$path); if (!$config) { return false; @@ -244,6 +246,7 @@ protected function _loadGroups() * Set website groups * * @param array $groups + * @return $this */ public function setGroups($groups) { @@ -275,7 +278,7 @@ public function getGroupCollection() /** * Retrieve website groups * - * @return array + * @return Mage_Core_Model_Store_Group[] */ public function getGroups() { @@ -314,7 +317,7 @@ public function getGroupsCount() /** * Retrieve default group model * - * @return Mage_Core_Model_Store_Group + * @return Mage_Core_Model_Store_Group|false */ public function getDefaultGroup() { @@ -381,7 +384,7 @@ public function getStoreCollection() /** * Retrieve wersite store objects * - * @return array + * @return Mage_Core_Model_Store[] */ public function getStores() { @@ -457,16 +460,25 @@ public function getWebsiteGroupStore() return join('-', array($this->getWebsiteId(), $this->getGroupId(), $this->getStoreId())); } + /** + * @return int + */ public function getDefaultGroupId() { return $this->_getData('default_group_id'); } + /** + * @return string + */ public function getCode() { return $this->_getData('code'); } + /** + * @inheritDoc + */ protected function _beforeDelete() { $this->_protectFromNonAdmin(); @@ -534,7 +546,7 @@ public function getDefaultStore() * Retrieve default stores select object * Select fields website_id, store_id * - * @param $withDefault include/exclude default admin website + * @param bool $withDefault include/exclude default admin website * @return Varien_Db_Select */ public function getDefaultStoresSelect($withDefault = false) diff --git a/app/code/core/Mage/Core/controllers/AjaxController.php b/app/code/core/Mage/Core/controllers/AjaxController.php index 6aa576fd682..6d94303a9c7 100644 --- a/app/code/core/Mage/Core/controllers/AjaxController.php +++ b/app/code/core/Mage/Core/controllers/AjaxController.php @@ -35,15 +35,14 @@ class Mage_Core_AjaxController extends Mage_Core_Controller_Front_Action { /** * Ajax action for inline translation - * */ - public function translateAction () + public function translateAction() { $translation = $this->getRequest()->getPost('translate'); $area = $this->getRequest()->getPost('area'); //filtering - /** @var $filter Mage_Core_Model_Input_Filter_MaliciousCode */ + /** @var Mage_Core_Model_Input_Filter_MaliciousCode $filter */ $filter = Mage::getModel('core/input_filter_maliciousCode'); foreach ($translation as &$item) { $item['custom'] = $filter->filter($item['custom']); diff --git a/app/code/core/Mage/Core/controllers/IndexController.php b/app/code/core/Mage/Core/controllers/IndexController.php index 2986d5e8434..ade5e634559 100644 --- a/app/code/core/Mage/Core/controllers/IndexController.php +++ b/app/code/core/Mage/Core/controllers/IndexController.php @@ -25,7 +25,8 @@ */ -class Mage_Core_IndexController extends Mage_Core_Controller_Front_Action { +class Mage_Core_IndexController extends Mage_Core_Controller_Front_Action +{ function indexAction() { diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index 63daa414ff0..466d80a79fc 100644 --- a/app/code/core/Mage/Core/functions.php +++ b/app/code/core/Mage/Core/functions.php @@ -30,7 +30,13 @@ * @link http://us3.php.net/manual/en/security.magicquotes.disabling.php */ if (get_magic_quotes_gpc()) { - function mageUndoMagicQuotes($array, $topLevel=true) { + /** + * @param array $array + * @param bool $topLevel + * @return array + */ + function mageUndoMagicQuotes($array, $topLevel = true) + { $newArray = array(); foreach($array as $key => $value) { if (!$topLevel) { @@ -68,9 +74,8 @@ function destruct($object) /** * Translator function * + * @return string * @deprecated 1.3 - * @param string $text the text to translate - * @param mixed optional parameters to use in sprintf */ function __() { @@ -95,10 +100,10 @@ function uc_words($str, $destSep='_', $srcSep='_') /** * Simple sql format date * - * @param string $format + * @param bool $dayOnly * @return string */ -function now($dayOnly=false) +function now($dayOnly = false) { return date($dayOnly ? 'Y-m-d' : 'Y-m-d H:i:s'); } @@ -114,6 +119,10 @@ function is_empty_date($date) return preg_replace('#[ 0:-]#', '', $date)===''; } +/** + * @param string $class + * @return bool|string + */ function mageFindClassFile($class) { $classFile = uc_words($class, DIRECTORY_SEPARATOR).'.php'; @@ -135,8 +144,10 @@ function mageFindClassFile($class) * @param string $errstr * @param string $errfile * @param integer $errline + * @return bool */ -function mageCoreErrorHandler($errno, $errstr, $errfile, $errline){ +function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) +{ if (strpos($errstr, 'DateTimeZone::__construct')!==false) { // there's no way to distinguish between caught system exceptions and warnings return false; @@ -231,19 +242,29 @@ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline){ } } -function mageDebugBacktrace($return=false, $html=true, $showFirst=false) +/** + * @param bool $return + * @param bool $html + * @param bool $showFirst + * @return string + */ +function mageDebugBacktrace($return = false, $html = true, $showFirst = false) { $d = debug_backtrace(); $out = ''; - if ($html) $out .= "
";
-    foreach ($d as $i=>$r) {
+    if ($html) {
+        $out .= "
";
+    }
+    foreach ($d as $i => $r) {
         if (!$showFirst && $i==0) {
             continue;
         }
         // sometimes there is undefined index 'file'
         @$out .= "[$i] {$r['file']}:{$r['line']}\n";
     }
-    if ($html) $out .= "
"; + if ($html) { + $out .= "
"; + } if ($return) { return $out; } else { @@ -271,7 +292,11 @@ function mageSendErrorFooter() exit; } -function mageDelTree($path) { +/** + * @param string $path + */ +function mageDelTree($path) +{ if (is_dir($path)) { $entries = scandir($path); foreach ($entries as $entry) { @@ -285,7 +310,14 @@ function mageDelTree($path) { } } -function mageParseCsv($string, $delimiter=",", $enclosure='"', $escape='\\') +/** + * @param string $string + * @param string $delimiter + * @param string $enclosure + * @param string $escape + * @return array + */ +function mageParseCsv($string, $delimiter = ",", $enclosure = '"', $escape = '\\') { $elements = explode($delimiter, $string); for ($i = 0; $i < count($elements); $i++) { @@ -294,8 +326,12 @@ function mageParseCsv($string, $delimiter=",", $enclosure='"', $escape='\\') for ($j = $i+1; $j < count($elements); $j++) { if (substr_count($elements[$j], $enclosure) > 0) { // Put the quoted string's pieces back together again - array_splice($elements, $i, $j-$i+1, - implode($delimiter, array_slice($elements, $i, $j-$i+1))); + array_splice( + $elements, + $i, + $j-$i+1, + implode($delimiter, array_slice($elements, $i, $j-$i+1)) + ); break; } } @@ -311,6 +347,10 @@ function mageParseCsv($string, $delimiter=",", $enclosure='"', $escape='\\') return $elements; } +/** + * @param string $dir + * @return bool + */ function is_dir_writeable($dir) { if (is_dir($dir) && is_writable($dir)) { @@ -335,6 +375,9 @@ function is_dir_writeable($dir) if ( !function_exists('sys_get_temp_dir') ) { // Based on http://www.phpit.net/ // article/creating-zip-tar-archives-dynamically-php/2/ + /** + * @return bool|string + */ function sys_get_temp_dir() { // Try to get from environment variable diff --git a/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php b/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php index 4741aa86163..f5f197a03f0 100644 --- a/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php @@ -25,7 +25,7 @@ */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); @@ -75,12 +75,19 @@ 'unsigned' => true, 'default' => '0', ), 'Defines Is Website Default') - ->addIndex($installer->getIdxName('core/website', array('code'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('code'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) - ->addIndex($installer->getIdxName('core/website', array('sort_order')), - array('sort_order')) - ->addIndex($installer->getIdxName('core/website', array('default_group_id')), - array('default_group_id')) + ->addIndex( + $installer->getIdxName('core/website', array('code'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), + array('code'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) + ->addIndex( + $installer->getIdxName('core/website', array('sort_order')), + array('sort_order') + ) + ->addIndex( + $installer->getIdxName('core/website', array('default_group_id')), + array('default_group_id') + ) ->setComment('Websites'); $installer->getConnection()->createTable($table); @@ -113,13 +120,22 @@ 'nullable' => false, 'default' => '0', ), 'Default Store Id') - ->addIndex($installer->getIdxName('core/store_group', array('website_id')), - array('website_id')) - ->addIndex($installer->getIdxName('core/store_group', array('default_store_id')), - array('default_store_id')) - ->addForeignKey($installer->getFkName('core/store_group', 'website_id', 'core/website', 'website_id'), - 'website_id', $installer->getTable('core/website'), 'website_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addIndex( + $installer->getIdxName('core/store_group', array('website_id')), + array('website_id') + ) + ->addIndex( + $installer->getIdxName('core/store_group', array('default_store_id')), + array('default_store_id') + ) + ->addForeignKey( + $installer->getFkName('core/store_group', 'website_id', 'core/website', 'website_id'), + 'website_id', + $installer->getTable('core/website'), + 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->setComment('Store Groups'); $installer->getConnection()->createTable($table); @@ -159,20 +175,39 @@ 'nullable' => false, 'default' => '0', ), 'Store Activity') - ->addIndex($installer->getIdxName('core/store', array('code'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('code'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) - ->addIndex($installer->getIdxName('core/store', array('website_id')), - array('website_id')) - ->addIndex($installer->getIdxName('core/store', array('is_active', 'sort_order')), - array('is_active', 'sort_order')) - ->addIndex($installer->getIdxName('core/store', array('group_id')), - array('group_id')) - ->addForeignKey($installer->getFkName('core/store', 'group_id', 'core/store_group', 'group_id'), - 'group_id', $installer->getTable('core/store_group'), 'group_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) - ->addForeignKey($installer->getFkName('core/store', 'website_id', 'core/website', 'website_id'), - 'website_id', $installer->getTable('core/website'), 'website_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addIndex( + $installer->getIdxName('core/store', array('code'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), + array('code'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) + ->addIndex( + $installer->getIdxName('core/store', array('website_id')), + array('website_id') + ) + ->addIndex( + $installer->getIdxName('core/store', array('is_active', 'sort_order')), + array('is_active', 'sort_order') + ) + ->addIndex( + $installer->getIdxName('core/store', array('group_id')), + array('group_id') + ) + ->addForeignKey( + $installer->getFkName('core/store', 'group_id', 'core/store_group', 'group_id'), + 'group_id', + $installer->getTable('core/store_group'), + 'group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey( + $installer->getFkName('core/store', 'website_id', 'core/website', 'website_id'), + 'website_id', + $installer->getTable('core/website'), + 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->setComment('Stores'); $installer->getConnection()->createTable($table); @@ -200,9 +235,15 @@ 'default' => 'general', ), 'Config Path') ->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(), 'Config Value') - ->addIndex($installer->getIdxName('core/config_data', array('scope', 'scope_id', 'path'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('scope', 'scope_id', 'path'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex( + $installer->getIdxName( + 'core/config_data', + array('scope', 'scope_id', 'path'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('scope', 'scope_id', 'path'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) ->setComment('Config Data'); $installer->getConnection()->createTable($table); @@ -243,13 +284,23 @@ ), 'Original Template Code') ->addColumn('orig_template_variables', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array( ), 'Original Template Variables') - ->addIndex($installer->getIdxName('core/email_template', array('template_code'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('template_code'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) - ->addIndex($installer->getIdxName('core/email_template', array('added_at')), - array('added_at')) - ->addIndex($installer->getIdxName('core/email_template', array('modified_at')), - array('modified_at')) + ->addIndex( + $installer->getIdxName( + 'core/email_template', + array('template_code'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('template_code'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) + ->addIndex( + $installer->getIdxName('core/email_template', array('added_at')), + array('added_at') + ) + ->addIndex( + $installer->getIdxName('core/email_template', array('modified_at')), + array('modified_at') + ) ->setComment('Email Templates'); $installer->getConnection()->createTable($table); @@ -272,8 +323,10 @@ 'nullable' => false, 'default' => '0', ), 'Sort Order') - ->addIndex($installer->getIdxName('core/layout_update', array('handle')), - array('handle')) + ->addIndex( + $installer->getIdxName('core/layout_update', array('handle')), + array('handle') + ) ->setComment('Layout Updates'); $installer->getConnection()->createTable($table); @@ -304,19 +357,34 @@ 'nullable' => false, 'default' => '0', ), 'Layout Update Id') - ->addIndex($installer->getIdxName('core/layout_link', array('store_id', 'package', 'theme', 'layout_update_id'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), + ->addIndex( + $installer->getIdxName( + 'core/layout_link', + array('store_id', 'package', 'theme', 'layout_update_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), array('store_id', 'package', 'theme', 'layout_update_id'), - array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) - ->addIndex($installer->getIdxName('core/layout_link', array('layout_update_id')), - array('layout_update_id')) - ->addForeignKey($installer->getFkName('core/layout_link', 'store_id', 'core/store', 'store_id'), - 'store_id', $installer->getTable('core/store'), 'store_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) + ->addIndex( + $installer->getIdxName('core/layout_link', array('layout_update_id')), + array('layout_update_id') + ) + ->addForeignKey( + $installer->getFkName('core/layout_link', 'store_id', 'core/store', 'store_id'), + 'store_id', + $installer->getTable('core/store'), + 'store_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->addForeignKey( $installer->getFkName('core/layout_link', 'layout_update_id', 'core/layout_update', 'layout_update_id'), - 'layout_update_id', $installer->getTable('core/layout_update'), 'layout_update_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + 'layout_update_id', + $installer->getTable('core/layout_update'), + 'layout_update_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE ) ->setComment('Layout Link'); $installer->getConnection()->createTable($table); @@ -367,14 +435,27 @@ 'nullable' => false, 'default' => 'en_US', ), 'Locale') - ->addIndex($installer->getIdxName('core/translate', array('store_id', 'locale', 'string'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('store_id', 'locale', 'string'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) - ->addIndex($installer->getIdxName('core/translate', array('store_id')), - array('store_id')) - ->addForeignKey($installer->getFkName('core/translate', 'store_id', 'core/store', 'store_id'), - 'store_id', $installer->getTable('core/store'), 'store_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addIndex( + $installer->getIdxName( + 'core/translate', + array('store_id', 'locale', 'string'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('store_id', 'locale', 'string'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) + ->addIndex( + $installer->getIdxName('core/translate', array('store_id')), + array('store_id') + ) + ->addForeignKey( + $installer->getFkName('core/translate', 'store_id', 'core/store', 'store_id'), + 'store_id', + $installer->getTable('core/store'), + 'store_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->setComment('Translations'); $installer->getConnection()->createTable($table); @@ -409,21 +490,44 @@ ), 'Options') ->addColumn('description', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( ), 'Deascription') - ->addIndex($installer->getIdxName('core/url_rewrite', array('request_path', 'store_id'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('request_path', 'store_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) - ->addIndex($installer->getIdxName('core/url_rewrite', array('id_path', 'is_system', 'store_id'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('id_path', 'is_system', 'store_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) - ->addIndex($installer->getIdxName('core/url_rewrite', array('target_path', 'store_id')), - array('target_path', 'store_id')) - ->addIndex($installer->getIdxName('core/url_rewrite', array('id_path')), - array('id_path')) - ->addIndex($installer->getIdxName('core/url_rewrite', array('store_id')), - array('store_id')) - ->addForeignKey($installer->getFkName('core/url_rewrite', 'store_id', 'core/store', 'store_id'), - 'store_id', $installer->getTable('core/store'), 'store_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addIndex( + $installer->getIdxName( + 'core/url_rewrite', + array('request_path', 'store_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('request_path', 'store_id'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) + ->addIndex( + $installer->getIdxName( + 'core/url_rewrite', + array('id_path', 'is_system', 'store_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('id_path', 'is_system', 'store_id'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) + ->addIndex( + $installer->getIdxName('core/url_rewrite', array('target_path', 'store_id')), + array('target_path', 'store_id') + ) + ->addIndex( + $installer->getIdxName('core/url_rewrite', array('id_path')), + array('id_path') + ) + ->addIndex( + $installer->getIdxName('core/url_rewrite', array('store_id')), + array('store_id') + ) + ->addForeignKey( + $installer->getFkName('core/url_rewrite', 'store_id', 'core/store', 'store_id'), + 'store_id', + $installer->getTable('core/store'), + 'store_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->setComment('Url Rewrites'); $installer->getConnection()->createTable($table); @@ -448,11 +552,18 @@ ), 'First Date of Design Activity') ->addColumn('date_to', Varien_Db_Ddl_Table::TYPE_DATE, null, array( ), 'Last Date of Design Activity') - ->addIndex($installer->getIdxName('core/design_change', array('store_id')), - array('store_id')) - ->addForeignKey($installer->getFkName('core/design_change', 'store_id', 'core/store', 'store_id'), - 'store_id', $installer->getTable('core/store'), 'store_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addIndex( + $installer->getIdxName('core/design_change', array('store_id')), + array('store_id') + ) + ->addForeignKey( + $installer->getFkName('core/design_change', 'store_id', 'core/store', 'store_id'), + 'store_id', + $installer->getTable('core/store'), + 'store_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->setComment('Design Changes'); $installer->getConnection()->createTable($table); @@ -471,8 +582,11 @@ ), 'Variable Code') ->addColumn('name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( ), 'Variable Name') - ->addIndex($installer->getIdxName('core/variable', array('code'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('code'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex( + $installer->getIdxName('core/variable', array('code'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), + array('code'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) ->setComment('Variables'); $installer->getConnection()->createTable($table); @@ -501,19 +615,39 @@ ), 'Plain Text Value') ->addColumn('html_value', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array( ), 'Html Value') - ->addIndex($installer->getIdxName('core/variable_value', array('variable_id', 'store_id'), - Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), - array('variable_id', 'store_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) - ->addIndex($installer->getIdxName('core/variable_value', array('variable_id')), - array('variable_id')) - ->addIndex($installer->getIdxName('core/variable_value', array('store_id')), - array('store_id')) - ->addForeignKey($installer->getFkName('core/variable_value', 'store_id', 'core/store', 'store_id'), - 'store_id', $installer->getTable('core/store'), 'store_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) - ->addForeignKey($installer->getFkName('core/variable_value', 'variable_id', 'core/variable', 'variable_id'), - 'variable_id', $installer->getTable('core/variable'), 'variable_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addIndex( + $installer->getIdxName( + 'core/variable_value', + array('variable_id', 'store_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('variable_id', 'store_id'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) + ->addIndex( + $installer->getIdxName('core/variable_value', array('variable_id')), + array('variable_id') + ) + ->addIndex( + $installer->getIdxName('core/variable_value', array('store_id')), + array('store_id') + ) + ->addForeignKey( + $installer->getFkName('core/variable_value', 'store_id', 'core/store', 'store_id'), + 'store_id', + $installer->getTable('core/store'), + 'store_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey( + $installer->getFkName('core/variable_value', 'variable_id', 'core/variable', 'variable_id'), + 'variable_id', + $installer->getTable('core/variable'), + 'variable_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->setComment('Variable Value'); $installer->getConnection()->createTable($table); @@ -534,8 +668,10 @@ ), 'Time of Cache Updating') ->addColumn('expire_time', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( ), 'Cache Expiration Time') - ->addIndex($installer->getIdxName('core/cache', array('expire_time')), - array('expire_time')) + ->addIndex( + $installer->getIdxName('core/cache', array('expire_time')), + array('expire_time') + ) ->setComment('Caches'); $installer->getConnection()->createTable($table); @@ -552,8 +688,10 @@ 'nullable' => false, 'primary' => true, ), 'Cache Id') - ->addIndex($installer->getIdxName('core/cache_tag', array('cache_id')), - array('cache_id')) + ->addIndex( + $installer->getIdxName('core/cache_tag', array('cache_id')), + array('cache_id') + ) ->setComment('Tag Caches'); $installer->getConnection()->createTable($table); @@ -596,8 +734,10 @@ 'nullable' => false, 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT_UPDATE, ), 'Date of Last Flag Update') - ->addIndex($installer->getIdxName('core/flag', array('last_update')), - array('last_update')) + ->addIndex( + $installer->getIdxName('core/flag', array('last_update')), + array('last_update') + ) ->setComment('Flag'); $installer->getConnection()->createTable($table); @@ -663,4 +803,3 @@ )); $installer->endSetup(); - diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-data-upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-data-upgrade-1.6.0.2-1.6.0.3.php index 4167942755b..5cb414dfe6b 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-data-upgrade-1.6.0.2-1.6.0.3.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-data-upgrade-1.6.0.2-1.6.0.3.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $connection = $installer->getConnection(); $connection->update($installer->getTable('core/translate'), array( diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php index 7f067d0f3f0..b23d1776b48 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.7.0.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php index 1b3c5be9730..2f55007afc8 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-install-0.8.0.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php index 1c5f88b83cc..7ea7ef78926 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.6.26-0.7.0.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php index 6cfc8a93b6b..b3209b51115 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php index 470e38ad4ad..68958c6e60a 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.2-0.7.3.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php index 30e75d21463..9400f5bec58 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.3-0.7.4.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php index 19539b1f96a..d30e880296f 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); @@ -93,8 +93,7 @@ $rootCategoryId = 2; if (isset($rootCategoryIds['website'][$websiteRow['website_id']])) { $rootCategoryId = $rootCategoryIds['website'][$websiteRow['website_id']]; - } - elseif (isset($rootCategoryIds['default'][0])) { + } elseif (isset($rootCategoryIds['default'][0])) { $rootCategoryId = $rootCategoryIds['default'][0]; } $defaultStoreId = (int)$installer->getConnection() @@ -114,13 +113,15 @@ $groupId = $installer->getConnection()->lastInsertId(); // set group for store(s) $installer->getConnection() - ->update($this->getTable('core_store'), + ->update( + $this->getTable('core_store'), array('group_id'=>$groupId), $installer->getConnection()->quoteInto('website_id=?', $websiteRow['website_id']) ); // set created group as default for website $installer->getConnection() - ->update($this->getTable('core_website'), + ->update( + $this->getTable('core_website'), array('default_group_id'=>$groupId), $installer->getConnection()->quoteInto('website_id=?', $websiteRow['website_id']) ); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php index 7e87f1bc8cb..92195dcfedf 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.5-0.7.6.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php index 69d219e230a..415ba49b94d 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.6-0.7.7.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php index 5c53be2a6ac..1c8ce0507cf 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php index 55de4657fae..693a7afa394 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.7.8-0.7.9.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $configValuesMap = array( 'catalog/productalert/email_stock_template' => 'catalog_productalert_email_stock_template', @@ -51,6 +51,6 @@ 'wishlist/email/email_template' => 'wishlist_email_email_template', ); -foreach ($configValuesMap as $configPath=>$configValue) { +foreach ($configValuesMap as $configPath => $configValue) { $installer->setConfigData($configPath, $configValue); } diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php index f760f59d82c..3457da949ff 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.0-0.8.1.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php index d8a63f98fd2..ee0fabd46e2 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.1-0.8.2.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php index 6984a455082..5b88c2ebfa6 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.10-0.8.11.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); @@ -42,8 +42,10 @@ $installer->getConnection()->addConstraint( 'FK_DESIGN_CHANGE_STORE', - $installer->getTable('design_change'), 'store_id', - $installer->getTable('core_store'), 'store_id' + $installer->getTable('design_change'), + 'store_id', + $installer->getTable('core_store'), + 'store_id' ); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php index 07a96d91e23..f270053ed65 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.11-0.8.12.php @@ -26,16 +26,24 @@ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); $installer->getConnection()->changeColumn( - $installer->getTable('core_store'), 'name', 'name', 'varchar(255) not null', true + $installer->getTable('core_store'), + 'name', + 'name', + 'varchar(255) not null', + true ); $installer->getConnection()->changeColumn( - $installer->getTable('core_store_group'), 'name', 'name', 'varchar(255) not null', true + $installer->getTable('core_store_group'), + 'name', + 'name', + 'varchar(255) not null', + true ); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php index 6735d34c045..c0c8ec8794d 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.12-0.8.13.php @@ -26,11 +26,17 @@ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); -$installer->getConnection()->addConstraint('FK_CORE_URL_REWRITE_STORE', - $installer->getTable('core/url_rewrite'), 'store_id', - $installer->getTable('core/store'), 'store_id', - 'CASCADE', 'CASCADE', true); +$installer->getConnection()->addConstraint( + 'FK_CORE_URL_REWRITE_STORE', + $installer->getTable('core/url_rewrite'), + 'store_id', + $installer->getTable('core/store'), + 'store_id', + 'CASCADE', + 'CASCADE', + true +); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php index cf756d52550..e1cc43251fa 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.13-0.8.14.php @@ -26,7 +26,7 @@ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); $installer->getConnection()->addColumn($installer->getTable('core/layout_update'), 'sort_order', "smallint(5) NOT NULL DEFAULT '0'"); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php index cd18fbb7c9b..88466879d2b 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php @@ -26,7 +26,7 @@ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); $installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_code', "VARCHAR(200) DEFAULT NULL"); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php index 0e631e27416..826c2d414bd 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php @@ -24,10 +24,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); $installer->getConnection()->addColumn( - $installer->getTable('core_email_template'), 'template_styles', "text AFTER `template_text`" + $installer->getTable('core_email_template'), + 'template_styles', + "text AFTER `template_text`" ); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php index 57a27bce76e..e07623b1851 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php index bb4f64ddd30..10948ddeea6 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.17-0.8.18.php @@ -24,12 +24,19 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('core_email_variable'), - 'is_html', "tinyint(1) NOT NULL DEFAULT '0'"); -$installer->getConnection()->changeColumn($installer->getTable('core_email_variable_value'), - 'value', 'value', 'TEXT NOT NULL'); +$installer->getConnection()->addColumn( + $installer->getTable('core_email_variable'), + 'is_html', + "tinyint(1) NOT NULL DEFAULT '0'" +); +$installer->getConnection()->changeColumn( + $installer->getTable('core_email_variable_value'), + 'value', + 'value', + 'TEXT NOT NULL' +); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php index dfe4ad9715e..4cdf885527c 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.18-0.8.19.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); @@ -36,9 +36,19 @@ $installer->getConnection()->dropForeignKey($installer->getTable('core/variable_value'), 'FK_CORE_EMAIL_VARIABLE_VALUE_STORE_ID'); $installer->getConnection()->dropForeignKey($installer->getTable('core/variable_value'), 'FK_CORE_EMAIL_VARIABLE_VALUE_VARIABLE_ID'); -$installer->getConnection()->addConstraint('FK_CORE_VARIABLE_VALUE_STORE_ID', $installer->getTable('core/variable_value'), - 'store_id', $installer->getTable('core/store'), 'store_id'); -$installer->getConnection()->addConstraint('FK_CORE_VARIABLE_VALUE_VARIABLE_ID', $installer->getTable('core/variable_value'), - 'variable_id', $installer->getTable('core/variable'), 'variable_id'); +$installer->getConnection()->addConstraint( + 'FK_CORE_VARIABLE_VALUE_STORE_ID', + $installer->getTable('core/variable_value'), + 'store_id', + $installer->getTable('core/store'), + 'store_id' +); +$installer->getConnection()->addConstraint( + 'FK_CORE_VARIABLE_VALUE_VARIABLE_ID', + $installer->getTable('core/variable_value'), + 'variable_id', + $installer->getTable('core/variable'), + 'variable_id' +); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php index e95ce76c616..03d9f944080 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.19-0.8.20.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); @@ -34,8 +34,11 @@ $select = $installer->getConnection()->select() ->from(array('main_table' => $installer->getTable('core/variable')), array()) - ->join(array('value_table' => $installer->getTable('core/variable_value')), - 'value_table.variable_id = main_table.variable_id', array()) + ->join( + array('value_table' => $installer->getTable('core/variable_value')), + 'value_table.variable_id = main_table.variable_id', + array() + ) ->columns(array('main_table.variable_id', 'main_table.is_html', 'value_table.value')); $data = array(); @@ -49,8 +52,11 @@ } foreach ($data as $variableId => $value) { - $installer->getConnection()->update($installer->getTable('core/variable_value'), $value, - array('variable_id = ?' => $variableId)); + $installer->getConnection()->update( + $installer->getTable('core/variable_value'), + $value, + array('variable_id = ?' => $variableId) + ); } $installer->getConnection()->dropColumn($installer->getTable('core/variable'), 'is_html'); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php index a704a918d8c..1323c8d1847 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.2-0.8.3.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php index 99dc142f442..23e2d8e0381 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.20-0.8.21.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->getConnection()->addColumn($installer->getTable('core/resource'), 'data_version', 'varchar(50)'); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php index 819700c7b60..99a37aa36a0 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.21-0.8.22.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->run(" CREATE TABLE IF NOT EXISTS `{$installer->getTable('core/cache')}` ( diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php index 82822f7117a..6d1a1a3bd38 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.22-0.8.23.php @@ -24,15 +24,20 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('core/layout_link'), - 'area', "VARCHAR(64) NOT NULL DEFAULT '' AFTER `store_id`"); +$installer->getConnection()->addColumn( + $installer->getTable('core/layout_link'), + 'area', + "VARCHAR(64) NOT NULL DEFAULT '' AFTER `store_id`" +); -$installer->getConnection()->update($installer->getTable('core/layout_link'), - array('area' => Mage::getSingleton('core/design_package')->getArea())); +$installer->getConnection()->update( + $installer->getTable('core/layout_link'), + array('area' => Mage::getSingleton('core/design_package')->getArea()) +); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php index 4ecac2343a1..de66b879ee5 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.23-0.8.24.php @@ -25,7 +25,7 @@ */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php index 51d81b91e01..cc81b9d8911 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.24-0.8.25.php @@ -24,13 +24,15 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** @var Mage_Core_Model_Resource_Setup */ +/** @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); $installer->getConnection()->modifyColumn( - $this->getTable('core/flag'), 'flag_id', 'INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT' + $this->getTable('core/flag'), + 'flag_id', + 'INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT' ); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.26-0.8.27.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.26-0.8.27.php index 676802f2cad..ebfdc77b810 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.26-0.8.27.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.26-0.8.27.php @@ -24,6 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->getConnection()->dropForeignKey($installer->getTable('core/cache_tag'), 'FK_CORE_CACHE_TAG'); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php index 1cea5d0b804..18c2e14b794 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.27-0.8.28.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $tagsTableName = $installer->getTable('core/cache_tag'); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php index 88b12e18555..ef7160f2075 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.3-0.8.4.php @@ -33,7 +33,7 @@ * @author Magento Core Team */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); $installer->run(" diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php index 97ed8819e8d..3ba90160bd7 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.4-0.8.5.php @@ -26,7 +26,7 @@ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $conn = $installer->getConnection(); $table = $this->getTable('design_change'); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php index 7e12877af15..ffd92adf6c1 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.5-0.8.6.php @@ -33,7 +33,7 @@ * @author Magento Core Team */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); @@ -47,7 +47,8 @@ if ($row) { $whereBind = $installer->getConnection()->quoteInto('website_id=?', $row['website_id']); - $installer->getConnection()->update($installer->getTable('core_website'), + $installer->getConnection()->update( + $installer->getTable('core_website'), array('is_default' => 1), $whereBind ); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php index bdcdbc8e043..dae95b5c7f9 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.6-0.8.7.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php index cde381a0ad1..7cb0423f06d 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.7-0.8.8.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php index aa01568170b..e42a2af1db7 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.8-0.8.9.php @@ -25,12 +25,15 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); $installer->getConnection()->changeColumn( - $this->getTable('core_session'), 'session_data', 'session_data', 'MEDIUMBLOB NOT NULL' + $this->getTable('core_session'), + 'session_data', + 'session_data', + 'MEDIUMBLOB NOT NULL' ); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php index 683074b35a6..c2733703da0 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php @@ -25,7 +25,7 @@ */ $installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php index 162dfb1590c..7f4c097508d 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php index ecbdb208d1d..7bc56678002 100644 --- a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.2-1.6.0.3.php index 288c2757962..293b33983cd 100644 --- a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.2-1.6.0.3.php +++ b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.2-1.6.0.3.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php index e95d0ac0dd4..058e475439a 100644 --- a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php +++ b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php index 221a6ac043e..97073867eef 100644 --- a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php +++ b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); @@ -65,7 +65,8 @@ 'core/email_queue', array('entity_id', 'entity_type', 'event_type', 'message_body_hash') ), - array('entity_id', 'entity_type', 'event_type', 'message_body_hash')) + array('entity_id', 'entity_type', 'event_type', 'message_body_hash') + ) ->setComment('Email Queue'); $installer->getConnection()->createTable($table); @@ -94,10 +95,14 @@ 'nullable' => false, 'default' => '0', ), 'Email Type') - ->addIndex($installer->getIdxName('core/email_recipients', array('recipient_email')), - array('recipient_email')) - ->addIndex($installer->getIdxName('core/email_recipients', array('email_type')), - array('email_type')) + ->addIndex( + $installer->getIdxName('core/email_recipients', array('recipient_email')), + array('recipient_email') + ) + ->addIndex( + $installer->getIdxName('core/email_recipients', array('email_type')), + array('email_type') + ) ->addIndex( $installer->getIdxName( 'core/email_recipients', @@ -105,12 +110,17 @@ Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE ), array('message_id', 'recipient_email', 'email_type'), - array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) - ->addForeignKey($installer->getFkName('core/email_recipients', 'message_id', 'core/email_queue', 'message_id'), - 'message_id', $installer->getTable('core/email_queue'), 'message_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE) + ) + ->addForeignKey( + $installer->getFkName('core/email_recipients', 'message_id', 'core/email_queue', 'message_id'), + 'message_id', + $installer->getTable('core/email_queue'), + 'message_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, + Varien_Db_Ddl_Table::ACTION_CASCADE + ) ->setComment('Email Queue'); $installer->getConnection()->createTable($table); $installer->endSetup(); - diff --git a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php index f1a094630be..9155fdff658 100644 --- a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php +++ b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php index e5ac8a811fe..85b2f4e49ff 100644 --- a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php +++ b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/* @var $installer Mage_Core_Model_Resource_Setup */ +/* @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); From cec86b477544427c7b088a6a5d8e32795a9960fb Mon Sep 17 00:00:00 2001 From: sreichel Date: Mon, 3 Jun 2019 20:27:33 +0200 Subject: [PATCH 2/5] Removed new code --- app/code/core/Mage/Core/Model/Translate.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/code/core/Mage/Core/Model/Translate.php b/app/code/core/Mage/Core/Model/Translate.php index 28073d81b08..14c07b4057a 100644 --- a/app/code/core/Mage/Core/Model/Translate.php +++ b/app/code/core/Mage/Core/Model/Translate.php @@ -424,16 +424,7 @@ public function translate($args) //array_unshift($args, $translated); //$result = @call_user_func_array('sprintf', $args); - if (substr_count($translated, '%') != count($args)) { - echo $translated; - Mage::log( - __METHOD__ . '() possible argument count mismatch! for ' . $translated - . ' Backtrace: ' . mageDebugBacktrace(true, false, true), - null, - 'translated.log', - true - ); - } + $result = @vsprintf($translated, $args); if ($result === false) { $result = $translated; From 956cbb3871dcae36fb4812840ee4d9f4d4fe41c1 Mon Sep 17 00:00:00 2001 From: sreichel Date: Wed, 5 Jun 2019 15:11:22 +0200 Subject: [PATCH 3/5] Mage_Core fixes - changes from reviews - added some @methods - reverted some changes in code style for less diffs --- app/code/core/Mage/Core/Block/Abstract.php | 15 ++++++++----- app/code/core/Mage/Core/Block/Html/Date.php | 8 +++++++ app/code/core/Mage/Core/Block/Html/Select.php | 9 ++++---- app/code/core/Mage/Core/Block/Template.php | 2 +- app/code/core/Mage/Core/Model/Abstract.php | 6 +++-- .../core/Mage/Core/Model/App/Emulation.php | 2 +- app/code/core/Mage/Core/Model/Config.php | 14 ++++-------- app/code/core/Mage/Core/Model/Observer.php | 2 +- app/code/core/Mage/Core/Model/Session.php | 9 ++++++-- app/code/core/Mage/Core/Model/Store.php | 22 +++++++++---------- 10 files changed, 50 insertions(+), 39 deletions(-) diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index 9e96f819f97..69e741b2951 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -33,6 +33,11 @@ * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method $this setAdditionalHtml(string $value) + * @method string getFormKey() + * @method string getPosition() + * @method $this setTemplate(string $value) */ abstract class Mage_Core_Block_Abstract extends Varien_Object { @@ -941,12 +946,10 @@ final public function toHtml() if (self::$_transportObject === null) { self::$_transportObject = new Varien_Object; } - self::$_transportObject->setData('html', $html); - Mage::dispatchEvent( - 'core_block_abstract_to_html_after', - array('block' => $this, 'transport' => self::$_transportObject) - ); - $html = self::$_transportObject->getData('html'); + self::$_transportObject->setHtml($html); + Mage::dispatchEvent('core_block_abstract_to_html_after', + array('block' => $this, 'transport' => self::$_transportObject)); + $html = self::$_transportObject->getHtml(); return $html; } diff --git a/app/code/core/Mage/Core/Block/Html/Date.php b/app/code/core/Mage/Core/Block/Html/Date.php index 7e20a580449..d4e02c688ad 100644 --- a/app/code/core/Mage/Core/Block/Html/Date.php +++ b/app/code/core/Mage/Core/Block/Html/Date.php @@ -24,6 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + /** * HTML select element block * @@ -32,13 +33,20 @@ * @author Magento Core Team * * @method string getClass() + * @method $this setClass(string $value) * @method string getExtraParams() + * @method $this setExtraParams(string $value) * @method string getFormat() + * @method $this setFormat(string $value) * @method string getImage() + * @method $this setImage(string $value) * @method string getName() + * @method $this setName(string $value) * @method string getTime() * @method string getValue() + * @method $this setValue(string $value) * @method string getYearsRange() + * @method $this setYearsRange(string $value) */ class Mage_Core_Block_Html_Date extends Mage_Core_Block_Template { diff --git a/app/code/core/Mage/Core/Block/Html/Select.php b/app/code/core/Mage/Core/Block/Html/Select.php index 7dde8c50c11..8f588b8ab9a 100644 --- a/app/code/core/Mage/Core/Block/Html/Select.php +++ b/app/code/core/Mage/Core/Block/Html/Select.php @@ -24,6 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + /** * HTML select element block * @@ -33,7 +34,9 @@ * * @method string getExtraParams() * @method string getName() + * @method $this setName(string $value) * @method string getValue() + * @method $this setValue(string $value) * @method bool getIsRenderToJsTemplate() */ class Mage_Core_Block_Html_Select extends Mage_Core_Block_Abstract @@ -235,13 +238,11 @@ protected function _optionToHtml($option, $selected = false) } } - return sprintf( - '', + return sprintf('', $this->escapeHtml($option['value']), $selectedHtml, $params, - $this->escapeHtml($option['label']) - ); + $this->escapeHtml($option['label'])); } /** diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php index c3a6ba51a57..1e570ab5cee 100644 --- a/app/code/core/Mage/Core/Block/Template.php +++ b/app/code/core/Mage/Core/Block/Template.php @@ -80,7 +80,7 @@ protected function _construct() { parent::_construct(); - /* + /** * In case template was passed through constructor * we assign it to block's property _template * Mainly for those cases when block created diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index 87468db9fdb..5e529470213 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -35,6 +35,7 @@ * @method string getCreatedAt() * @method $this setCreatedAt(string $currentTime) * @method $this setUpdatedAt(string $currentTime) + * @method $this setAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $value) * @method bool hasErrors() */ abstract class Mage_Core_Model_Abstract extends Varien_Object @@ -212,7 +213,7 @@ public function getResourceCollection() } /** - * @return object + * @return Mage_Core_Model_Mysql4_Collection_Abstract|object */ public function getCollection() { @@ -488,7 +489,8 @@ public function delete() $this->_afterDelete(); $this->_getResource()->commit(); - } catch (Exception $e) { + } + catch (Exception $e){ $this->_getResource()->rollBack(); throw $e; } diff --git a/app/code/core/Mage/Core/Model/App/Emulation.php b/app/code/core/Mage/Core/Model/App/Emulation.php index 7d7bfea7cbf..21d3102f14f 100644 --- a/app/code/core/Mage/Core/Model/App/Emulation.php +++ b/app/code/core/Mage/Core/Model/App/Emulation.php @@ -102,7 +102,7 @@ public function startEnvironmentEmulation( * * Function restores initial store environment * - * @param Varien_Object|OpenMage_Object_AppEmulation $initialEnvironmentInfo information about environment of the initial store + * @param Varien_Object $initialEnvironmentInfo information about environment of the initial store * * @return $this */ diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index a7c8b20ddfb..a149828e9df 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -24,6 +24,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + /** * Core configuration class * @@ -418,9 +419,7 @@ protected function _canUseCacheForInit() $retries = 10; do { if ($this->_loadCache($this->_getCacheLockId())) { - if ($retries) { - usleep(500000); // 0.5 seconds - } + if ($retries) usleep(500000); // 0.5 seconds } else { return TRUE; } @@ -510,11 +509,7 @@ protected function _saveSectionCache($idPrefix, $sectionName, $source, $recursio if ($recursionLevel > 0) { foreach ($source->$sectionName->children() as $subSectionName => $node) { $this->_saveSectionCache( - $cacheId, - $subSectionName, - $source->$sectionName, - $recursionLevel-1, - $tags + $cacheId, $subSectionName, $source->$sectionName, $recursionLevel-1, $tags ); } } @@ -1015,8 +1010,7 @@ public function getDistroServerVars() $hostArr = explode(':', $_SERVER['HTTP_HOST']); $host = $hostArr[0]; $port = isset( - $hostArr[1] - ) && (!$secure && $hostArr[1]!=80 || $secure && $hostArr[1]!=443 + $hostArr[1]) && (!$secure && $hostArr[1]!=80 || $secure && $hostArr[1]!=443 ) ? ':'.$hostArr[1] : ''; $path = Mage::app()->getRequest()->getBasePath(); diff --git a/app/code/core/Mage/Core/Model/Observer.php b/app/code/core/Mage/Core/Model/Observer.php index b50a7e0ada7..e24e271ac5d 100644 --- a/app/code/core/Mage/Core/Model/Observer.php +++ b/app/code/core/Mage/Core/Model/Observer.php @@ -109,7 +109,7 @@ public function cleanCache(Mage_Cron_Model_Schedule $schedule) /** * Cleans cache by tags * - * @param Varien_Event_Observer|OpenMage_Observer_CleanCacheByTags_Observer $observer + * @param Varien_Event_Observer $observer * @return $this */ public function cleanCacheByTags(Varien_Event_Observer $observer) diff --git a/app/code/core/Mage/Core/Model/Session.php b/app/code/core/Mage/Core/Model/Session.php index ef192ee360f..283751b8e6c 100644 --- a/app/code/core/Mage/Core/Model/Session.php +++ b/app/code/core/Mage/Core/Model/Session.php @@ -28,12 +28,17 @@ /** * Core session model * + * @todo extend from Mage_Core_Model_Session_Abstract + * * @method null|bool getCookieShouldBeReceived() - * @method $this setCookieShouldBeReceived(bool $flag) + * @method $this setCookieShouldBeReceived(bool $value) * @method $this unsCookieShouldBeReceived() * @method $this unsSessionHosts() * @method string getCurrencyCode() - * @method $this setCurrencyCode(string $code) + * @method $this setCurrencyCode(string $value) + * @method $this setFormData(array $value) + * @method int getJustVotedPoll() + * @method $this setJustVotedPoll(int $value) * @method $this setLastUrl(string $value) */ class Mage_Core_Model_Session extends Mage_Core_Model_Session_Abstract diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 4cfae253b00..095bd5b8832 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -30,18 +30,19 @@ * @method Mage_Core_Model_Resource_Store _getResource() * @method Mage_Core_Model_Resource_Store getResource() * @method $this setCode(string $value) - * @method $this setWebsiteId(int $value) * @method $this setGroupId(int $value) - * @method $this setName(string $value) - * @method int getSortOrder() - * @method $this setSortOrder(int $value) - * @method $this setIsActive(int $value) * @method string getHomeUrl() * @method $this setHomeUrl(string $value) + * @method $this setIsActive(int $value) * @method $this setLocaleCode(string $value) + * @method string getLanguageCode() + * @method string getLocaleCode() + * @method $this setName(string $value) + * @method int getSortOrder() + * @method $this setSortOrder(int $value) * @method int getStoreId() * @method $this setStoreId(int $value) - * @method string getLocaleCode() + * @method $this setWebsiteId(int $value) * * @category Mage * @package Mage_Core @@ -748,10 +749,8 @@ public function isAdminUrlSecure() public function isFrontUrlSecure() { if ($this->_isFrontSecure === null) { - $this->_isFrontSecure = Mage::getStoreConfigFlag( - Mage_Core_Model_Url::XML_PATH_SECURE_IN_FRONT, - $this->getId() - ); + $this->_isFrontSecure = Mage::getStoreConfigFlag(Mage_Core_Model_Url::XML_PATH_SECURE_IN_FRONT, + $this->getId()); } return $this->_isFrontSecure; } @@ -1126,8 +1125,7 @@ public function getCurrentUrl($fromStore = true) { $sidQueryParam = $this->_getSession()->getSessionIdQueryParam(); $requestString = Mage::getSingleton('core/url')->escape( - ltrim(Mage::app()->getRequest()->getRequestString(), '/') - ); + ltrim(Mage::app()->getRequest()->getRequestString(), '/')); $storeUrl = Mage::app()->getStore()->isCurrentlySecure() ? $this->getUrl('', array('_secure' => true)) From 6865799d031b6d47700d83e375b9bf07bcae1d91 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 23 Jun 2019 17:48:49 +0200 Subject: [PATCH 4/5] DOC update --- app/code/core/Mage/Core/Block/Abstract.php | 18 ++++- app/code/core/Mage/Core/Block/Html/Date.php | 4 +- app/code/core/Mage/Core/Block/Html/Link.php | 2 +- app/code/core/Mage/Core/Block/Html/Select.php | 12 +-- app/code/core/Mage/Core/Block/Messages.php | 12 +-- app/code/core/Mage/Core/Block/Profiler.php | 12 +-- app/code/core/Mage/Core/Block/Template.php | 12 ++- .../core/Mage/Core/Block/Template/Facade.php | 2 +- .../core/Mage/Core/Block/Text/List/Item.php | 2 +- .../core/Mage/Core/Block/Text/List/Link.php | 4 +- app/code/core/Mage/Core/Block/Text/Tag.php | 4 +- .../Mage/Core/Controller/Front/Action.php | 2 +- .../Mage/Core/Controller/Front/Router.php | 2 +- .../Mage/Core/Controller/Response/Http.php | 11 ++- .../Mage/Core/Controller/Varien/Action.php | 20 +++-- .../Mage/Core/Controller/Varien/Front.php | 2 +- .../Core/Controller/Varien/Router/Admin.php | 4 +- .../Controller/Varien/Router/Standard.php | 7 +- app/code/core/Mage/Core/Helper/Abstract.php | 10 +-- app/code/core/Mage/Core/Helper/Data.php | 25 +++--- .../Core/Helper/File/Storage/Database.php | 6 +- app/code/core/Mage/Core/Helper/Http.php | 8 +- app/code/core/Mage/Core/Helper/String.php | 14 ++-- app/code/core/Mage/Core/Helper/Url.php | 2 +- app/code/core/Mage/Core/Model/Abstract.php | 22 +++--- app/code/core/Mage/Core/Model/App.php | 24 +++--- app/code/core/Mage/Core/Model/App/Area.php | 2 +- app/code/core/Mage/Core/Model/Cache.php | 6 +- app/code/core/Mage/Core/Model/Config.php | 78 +++++++++++-------- app/code/core/Mage/Core/Model/Config/Base.php | 2 +- .../core/Mage/Core/Model/Config/Element.php | 4 +- app/code/core/Mage/Core/Model/Date.php | 8 +- .../core/Mage/Core/Model/Design/Fallback.php | 6 +- .../core/Mage/Core/Model/Design/Package.php | 18 ++--- .../Mage/Core/Model/Design/Source/Apply.php | 2 +- .../Mage/Core/Model/Design/Source/Design.php | 2 +- .../core/Mage/Core/Model/Domainpolicy.php | 12 ++- app/code/core/Mage/Core/Model/Email.php | 7 +- app/code/core/Mage/Core/Model/Email/Queue.php | 6 +- .../core/Mage/Core/Model/Email/Template.php | 18 ++--- .../Core/Model/Email/Template/Abstract.php | 8 +- app/code/core/Mage/Core/Model/Encryption.php | 2 +- .../Model/File/Storage/Database/Abstract.php | 2 +- .../Model/File/Storage/Directory/Database.php | 2 +- .../Mage/Core/Model/File/Storage/File.php | 2 +- app/code/core/Mage/Core/Model/Layout.php | 17 ++-- .../core/Mage/Core/Model/Layout/Element.php | 9 +-- .../core/Mage/Core/Model/Layout/Update.php | 6 +- app/code/core/Mage/Core/Model/Locale.php | 28 +++---- app/code/core/Mage/Core/Model/Log/Adapter.php | 2 +- .../Mage/Core/Model/Message/Collection.php | 4 +- .../Model/Mysql4/Design/Theme/Collection.php | 2 +- .../Model/Mysql4/File/Storage/Abstract.php | 2 +- app/code/core/Mage/Core/Model/Resource.php | 8 +- .../Mage/Core/Model/Resource/Abstract.php | 8 +- .../core/Mage/Core/Model/Resource/Config.php | 2 +- .../Mage/Core/Model/Resource/Config/Data.php | 4 +- .../Mage/Core/Model/Resource/Db/Abstract.php | 20 ++--- .../Model/Resource/Db/Collection/Abstract.php | 3 +- .../Mage/Core/Model/Resource/Email/Queue.php | 4 +- .../Core/Model/Resource/Email/Template.php | 2 +- .../Core/Model/Resource/File/Storage/File.php | 2 +- .../Core/Model/Resource/Helper/Mysql4.php | 4 +- .../Mage/Core/Model/Resource/Iterator.php | 2 +- .../core/Mage/Core/Model/Resource/Setup.php | 24 +++--- .../Model/Resource/Setup/Query/Modifier.php | 2 +- .../core/Mage/Core/Model/Resource/Store.php | 6 +- .../Mage/Core/Model/Resource/Store/Group.php | 2 +- .../Model/Resource/Store/Group/Collection.php | 2 +- .../Mage/Core/Model/Resource/Transaction.php | 6 +- .../Mage/Core/Model/Resource/Translate.php | 2 +- .../Core/Model/Resource/Translate/String.php | 7 +- .../core/Mage/Core/Model/Resource/Website.php | 4 +- app/code/core/Mage/Core/Model/Session.php | 2 + .../core/Mage/Core/Model/Session/Abstract.php | 34 ++++---- .../Core/Model/Session/Abstract/Varien.php | 12 +-- .../Mage/Core/Model/Session/Abstract/Zend.php | 2 +- .../Mage/Core/Model/Session/Exception.php | 4 +- app/code/core/Mage/Core/Model/Store.php | 20 +++-- app/code/core/Mage/Core/Model/Store/Api.php | 1 - .../core/Mage/Core/Model/Store/Exception.php | 4 +- app/code/core/Mage/Core/Model/Store/Group.php | 6 +- app/code/core/Mage/Core/Model/Template.php | 9 +-- app/code/core/Mage/Core/Model/Translate.php | 18 ++--- .../core/Mage/Core/Model/Translate/Inline.php | 18 ++--- app/code/core/Mage/Core/Model/Url.php | 2 +- app/code/core/Mage/Core/Model/Url/Rewrite.php | 13 ++-- .../Mage/Core/Model/Url/Rewrite/Request.php | 4 +- app/code/core/Mage/Core/Model/Website.php | 11 ++- app/code/core/Mage/Core/functions.php | 30 +++---- 90 files changed, 436 insertions(+), 368 deletions(-) diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index 69e741b2951..fe61b137924 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -35,9 +35,19 @@ * @author Magento Core Team * * @method $this setAdditionalHtml(string $value) + * @method $this setBlockParams(array $value) + * @method $this setCacheLifetime(int|false $value) + * @method $this setCacheKey(string $value) + * @method $this setCacheTags(array $value) + * @method $this setClass(string $value) + * @method $this setDisabled(bool $value) * @method string getFormKey() + * @method $this setLabel(string $value) + * @method $this setOnclick(string $value) * @method string getPosition() * @method $this setTemplate(string $value) + * @method $this setType(string $value) + * @method bool hasWrapperMustBeVisible() */ abstract class Mage_Core_Block_Abstract extends Varien_Object { @@ -613,7 +623,7 @@ public function getChildChildHtml($name, $childName = '', $useCache = true, $sor /** * Obtain sorted child blocks * - * @return array + * @return Mage_Core_Block_Abstract[] */ public function getSortedChildBlocks() { @@ -947,8 +957,10 @@ final public function toHtml() self::$_transportObject = new Varien_Object; } self::$_transportObject->setHtml($html); - Mage::dispatchEvent('core_block_abstract_to_html_after', - array('block' => $this, 'transport' => self::$_transportObject)); + Mage::dispatchEvent( + 'core_block_abstract_to_html_after', + array('block' => $this, 'transport' => self::$_transportObject) + ); $html = self::$_transportObject->getHtml(); return $html; diff --git a/app/code/core/Mage/Core/Block/Html/Date.php b/app/code/core/Mage/Core/Block/Html/Date.php index d4e02c688ad..2a4252306de 100644 --- a/app/code/core/Mage/Core/Block/Html/Date.php +++ b/app/code/core/Mage/Core/Block/Html/Date.php @@ -43,6 +43,8 @@ * @method string getName() * @method $this setName(string $value) * @method string getTime() + * @method $this setTime(string $value) + * @method $this setTitle(string $value) * @method string getValue() * @method $this setValue(string $value) * @method string getYearsRange() @@ -98,7 +100,7 @@ protected function _toHtml() public function getEscapedValue($index = null) { - if($this->getFormat() && $this->getValue()) { + if ($this->getFormat() && $this->getValue()) { return strftime($this->getFormat(), strtotime($this->getValue())); } diff --git a/app/code/core/Mage/Core/Block/Html/Link.php b/app/code/core/Mage/Core/Block/Html/Link.php index de290f980f2..1eb94a46d6a 100644 --- a/app/code/core/Mage/Core/Block/Html/Link.php +++ b/app/code/core/Mage/Core/Block/Html/Link.php @@ -83,7 +83,7 @@ public function getLinkAttributes() * @param string $quote * @return string */ - public function serialize($attributes = array(), $valueSeparator='=', $fieldSeparator=' ', $quote='"') + public function serialize($attributes = array(), $valueSeparator = '=', $fieldSeparator = ' ', $quote = '"') { $res = ''; $data = array(); diff --git a/app/code/core/Mage/Core/Block/Html/Select.php b/app/code/core/Mage/Core/Block/Html/Select.php index 8f588b8ab9a..29956a188c3 100644 --- a/app/code/core/Mage/Core/Block/Html/Select.php +++ b/app/code/core/Mage/Core/Block/Html/Select.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - /** * HTML select element block * @@ -33,6 +32,7 @@ * @author Magento Core Team * * @method string getExtraParams() + * @method $this setExtraParams(string $value) * @method string getName() * @method $this setName(string $value) * @method string getValue() @@ -73,7 +73,7 @@ public function setOptions($options) * @param array $params HTML attributes * @return $this */ - public function addOption($value, $label, $params=array()) + public function addOption($value, $label, $params = array()) { $this->_options[] = array('value' => $value, 'label' => $label, 'params' => $params); return $this; @@ -160,7 +160,7 @@ protected function _toHtml() . $this->getClass() . '" title="' . $this->getTitle() . '" ' . $this->getExtraParams() . '>'; $values = $this->getValue(); - if (!is_array($values)){ + if (!is_array($values)) { if (!is_null($values)) { $values = array($values); } else { @@ -238,11 +238,13 @@ protected function _optionToHtml($option, $selected = false) } } - return sprintf('', + return sprintf( + '', $this->escapeHtml($option['value']), $selectedHtml, $params, - $this->escapeHtml($option['label'])); + $this->escapeHtml($option['label']) + ); } /** diff --git a/app/code/core/Mage/Core/Block/Messages.php b/app/code/core/Mage/Core/Block/Messages.php index b0f2a358e26..c1e54cb1bc8 100644 --- a/app/code/core/Mage/Core/Block/Messages.php +++ b/app/code/core/Mage/Core/Block/Messages.php @@ -200,7 +200,7 @@ public function addSuccess($message) * @param string $type * @return array */ - public function getMessages($type=null) + public function getMessages($type = null) { return $this->getMessageCollection()->getItems($type); } @@ -211,7 +211,7 @@ public function getMessages($type=null) * @param string $type * @return string */ - public function getHtml($type=null) + public function getHtml($type = null) { $html = '<' . $this->_messagesFirstLevelTagName . ' id="admin_messages">'; foreach ($this->getMessages($type) as $message) { @@ -238,14 +238,14 @@ public function getGroupedHtml() ); $html = ''; foreach ($types as $type) { - if ( $messages = $this->getMessages($type) ) { - if ( !$html ) { + if ($messages = $this->getMessages($type)) { + if (!$html) { $html .= '<' . $this->_messagesFirstLevelTagName . ' class="messages">'; } $html .= '<' . $this->_messagesSecondLevelTagName . ' class="' . $type . '-msg">'; $html .= '<' . $this->_messagesFirstLevelTagName . '>'; - foreach ( $messages as $message ) { + foreach ($messages as $message) { $html.= '<' . $this->_messagesSecondLevelTagName . '>'; $html.= '<' . $this->_messagesContentWrapperTagName . '>'; $html.= ($this->_escapeMessageFlag) ? $this->escapeHtml($message->getText()) : $message->getText(); @@ -256,7 +256,7 @@ public function getGroupedHtml() $html .= '_messagesSecondLevelTagName . '>'; } } - if ( $html) { + if ($html) { $html .= '_messagesFirstLevelTagName . '>'; } return $html; diff --git a/app/code/core/Mage/Core/Block/Profiler.php b/app/code/core/Mage/Core/Block/Profiler.php index 1e65fab5c8f..ba14c520f7d 100644 --- a/app/code/core/Mage/Core/Block/Profiler.php +++ b/app/code/core/Mage/Core/Block/Profiler.php @@ -46,17 +46,17 @@ protected function _toHtml() $out .= '
Memory usage: real: '.memory_get_usage(true).', emalloc: '.memory_get_usage().'
'; $out .= ''; $out .= ''; - foreach ($timers as $name=>$timer) { - $sum = Varien_Profiler::fetch($name,'sum'); - $count = Varien_Profiler::fetch($name,'count'); - $realmem = Varien_Profiler::fetch($name,'realmem'); - $emalloc = Varien_Profiler::fetch($name,'emalloc'); + foreach ($timers as $name => $timer) { + $sum = Varien_Profiler::fetch($name, 'sum'); + $count = Varien_Profiler::fetch($name, 'count'); + $realmem = Varien_Profiler::fetch($name, 'realmem'); + $emalloc = Varien_Profiler::fetch($name, 'emalloc'); if ($sum<.0010 && $count<10 && $emalloc<10000) { continue; } $out .= '' .'' - .'' + .'' .'' .'' .'' diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php index 1e570ab5cee..13842f0d803 100644 --- a/app/code/core/Mage/Core/Block/Template.php +++ b/app/code/core/Mage/Core/Block/Template.php @@ -30,6 +30,12 @@ * @category Mage * @package Mage_Core * @author Magento Core Team + * + * @method $this setContentHeading(string $value) + * @method $this setFormAction(string $value) + * @method $this setIdSuffix(string $value) + * @method $this setProduct(Mage_Catalog_Model_Product $value) + * @method $this setDisplayMinimalPrice(bool $value) */ class Mage_Core_Block_Template extends Mage_Core_Block_Abstract { @@ -145,10 +151,10 @@ public function getArea() * @param mixed $value * @return Mage_Core_Block_Template */ - public function assign($key, $value=null) + public function assign($key, $value = null) { if (is_array($key)) { - foreach ($key as $k=>$v) { + foreach ($key as $k => $v) { $this->assign($k, $v); } } else { @@ -309,7 +315,7 @@ public function getBaseUrl() * @param string $fileName * @return string */ - public function getJsUrl($fileName='') + public function getJsUrl($fileName = '') { if (!$this->_jsUrl) { $this->_jsUrl = Mage::getBaseUrl('js'); diff --git a/app/code/core/Mage/Core/Block/Template/Facade.php b/app/code/core/Mage/Core/Block/Template/Facade.php index 9a2f5b24da1..aa684cad175 100644 --- a/app/code/core/Mage/Core/Block/Template/Facade.php +++ b/app/code/core/Mage/Core/Block/Template/Facade.php @@ -86,7 +86,7 @@ public function ifEquals($conditionKeys) } $lastValue = $this->_data[$key]; foreach ($conditionKeys as $key) { - if ($this->_data[$key] !== $lastValue) { + if ($this->_data[$key] !== $lastValue) { return false; } } diff --git a/app/code/core/Mage/Core/Block/Text/List/Item.php b/app/code/core/Mage/Core/Block/Text/List/Item.php index e2dd476aa37..7e0a7dbe526 100644 --- a/app/code/core/Mage/Core/Block/Text/List/Item.php +++ b/app/code/core/Mage/Core/Block/Text/List/Item.php @@ -52,7 +52,7 @@ protected function _toHtml() $this->setText('getLiParams(); if (!empty($params) && is_array($params)) { - foreach ($params as $key=>$value) { + foreach ($params as $key => $value) { $this->addText(' '.$key.'="'.addslashes($value).'"'); } } elseif (is_string($params)) { diff --git a/app/code/core/Mage/Core/Block/Text/List/Link.php b/app/code/core/Mage/Core/Block/Text/List/Link.php index b964048bd1d..4f6ed1f4a5b 100644 --- a/app/code/core/Mage/Core/Block/Text/List/Link.php +++ b/app/code/core/Mage/Core/Block/Text/List/Link.php @@ -57,7 +57,7 @@ protected function _toHtml() $this->setText('getLiParams(); if (!empty($params) && is_array($params)) { - foreach ($params as $key=>$value) { + foreach ($params as $key => $value) { $this->addText(' '.$key.'="'.addslashes($value).'"'); } } elseif (is_string($params)) { @@ -67,7 +67,7 @@ protected function _toHtml() $params = $this->getAParams(); if (!empty($params) && is_array($params)) { - foreach ($params as $key=>$value) { + foreach ($params as $key => $value) { $this->addText(' '.$key.'="'.addslashes($value).'"'); } } elseif (is_string($params)) { diff --git a/app/code/core/Mage/Core/Block/Text/Tag.php b/app/code/core/Mage/Core/Block/Text/Tag.php index d942f317e8e..aa5ce5a1e1e 100644 --- a/app/code/core/Mage/Core/Block/Text/Tag.php +++ b/app/code/core/Mage/Core/Block/Text/Tag.php @@ -52,7 +52,7 @@ protected function _construct() public function setTagParam($param, $value = null) { if (is_array($param) && is_null($value)) { - foreach ($param as $k=>$v) { + foreach ($param as $k => $v) { $this->setTagParam($k, $v); } } else { @@ -80,7 +80,7 @@ protected function _toHtml() { $this->setText('<'.$this->getTagName().' '); if ($this->getTagParams()) { - foreach ($this->getTagParams() as $k=>$v) { + foreach ($this->getTagParams() as $k => $v) { $this->addText($k.'="'.$v.'" '); } } diff --git a/app/code/core/Mage/Core/Controller/Front/Action.php b/app/code/core/Mage/Core/Controller/Front/Action.php index e266f42df15..8de40572dff 100644 --- a/app/code/core/Mage/Core/Controller/Front/Action.php +++ b/app/code/core/Mage/Core/Controller/Front/Action.php @@ -78,7 +78,7 @@ public function preDispatch() public function postDispatch() { parent::postDispatch(); - if (!$this->getFlag('', self::FLAG_NO_START_SESSION )) { + if (!$this->getFlag('', self::FLAG_NO_START_SESSION)) { Mage::getSingleton('core/session')->setLastUrl(Mage::getUrl('*/*/*', array('_current'=>true))); } return $this; diff --git a/app/code/core/Mage/Core/Controller/Front/Router.php b/app/code/core/Mage/Core/Controller/Front/Router.php index 844328e21f0..9e62666b2b8 100644 --- a/app/code/core/Mage/Core/Controller/Front/Router.php +++ b/app/code/core/Mage/Core/Controller/Front/Router.php @@ -83,7 +83,7 @@ public function getUrl($params = array()) if (!empty($params)) { $paramsStr = ''; - foreach ($params as $key=>$value) { + foreach ($params as $key => $value) { if (!isset($reservedKeys[$key]) && '_'!==$key{0} && !empty($value)) { $paramsStr .= $key.'/'.$value.'/'; } diff --git a/app/code/core/Mage/Core/Controller/Response/Http.php b/app/code/core/Mage/Core/Controller/Response/Http.php index ed9b4c5eccc..4f2ce2c0a1d 100644 --- a/app/code/core/Mage/Core/Controller/Response/Http.php +++ b/app/code/core/Mage/Core/Controller/Response/Http.php @@ -44,7 +44,7 @@ class Mage_Core_Controller_Response_Http extends Zend_Controller_Response_Http * * @link http://bugs.php.net/bug.php?id=36705 * - * {@inheritDoc} + * @inheritDoc */ public function sendHeaders() { @@ -55,7 +55,7 @@ public function sendHeaders() if (substr(php_sapi_name(), 0, 3) == 'cgi') { $statusSent = false; - foreach ($this->_headersRaw as $i=>$header) { + foreach ($this->_headersRaw as $i => $header) { if (stripos($header, 'status:')===0) { if ($statusSent) { unset($this->_headersRaw[$i]); @@ -64,7 +64,7 @@ public function sendHeaders() } } } - foreach ($this->_headers as $i=>$header) { + foreach ($this->_headers as $i => $header) { if (strcasecmp($header['name'], 'status')===0) { if ($statusSent) { unset($this->_headers[$i]); @@ -78,6 +78,9 @@ public function sendHeaders() return parent::sendHeaders(); } + /** + * @inheritDoc + */ public function sendResponse() { Mage::dispatchEvent('http_response_send_before', array('response'=>$this)); @@ -87,7 +90,7 @@ public function sendResponse() /** * Additionally check for session messages in several domains case * - * {@inheritDoc} + * @inheritDoc */ public function setRedirect($url, $code = 302) { diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index 59002ba5c96..43f25a34749 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -185,7 +185,7 @@ public function getResponse() * @param string $flag * @return array|bool */ - public function getFlag($action, $flag='') + public function getFlag($action, $flag = '') { if (''===$action) { $action = $this->getRequest()->getActionName(); @@ -223,7 +223,7 @@ public function setFlag($action, $flag, $value) * @param string $delimiter * @return string */ - public function getFullActionName($delimiter='_') + public function getFullActionName($delimiter = '_') { return $this->getRequest()->getRequestedRouteName().$delimiter. $this->getRequest()->getRequestedControllerName().$delimiter. @@ -326,7 +326,7 @@ public function generateLayoutXml() { $_profilerKey = self::PROFILER_KEY . '::' . $this->getFullActionName(); // dispatch event for adding text layouts - if(!$this->getFlag('', self::FLAG_NO_DISPATCH_BLOCK_EVENT)) { + if (!$this->getFlag('', self::FLAG_NO_DISPATCH_BLOCK_EVENT)) { Mage::dispatchEvent( 'controller_action_layout_generate_xml_before', array('action'=>$this, 'layout'=>$this->getLayout()) @@ -348,7 +348,7 @@ public function generateLayoutBlocks() { $_profilerKey = self::PROFILER_KEY . '::' . $this->getFullActionName(); // dispatch event for adding xml layout elements - if(!$this->getFlag('', self::FLAG_NO_DISPATCH_BLOCK_EVENT)) { + if (!$this->getFlag('', self::FLAG_NO_DISPATCH_BLOCK_EVENT)) { Mage::dispatchEvent( 'controller_action_layout_generate_blocks_before', array('action'=>$this, 'layout'=>$this->getLayout()) @@ -360,7 +360,7 @@ public function generateLayoutBlocks() $this->getLayout()->generateBlocks(); Varien_Profiler::stop("$_profilerKey::layout_generate_blocks"); - if(!$this->getFlag('', self::FLAG_NO_DISPATCH_BLOCK_EVENT)) { + if (!$this->getFlag('', self::FLAG_NO_DISPATCH_BLOCK_EVENT)) { Mage::dispatchEvent( 'controller_action_layout_generate_blocks_after', array('action'=>$this, 'layout'=>$this->getLayout()) @@ -376,7 +376,7 @@ public function generateLayoutBlocks() * @param string $output * @return $this|void */ - public function renderLayout($output='') + public function renderLayout($output = '') { $_profilerKey = self::PROFILER_KEY . '::' . $this->getFullActionName(); @@ -607,11 +607,9 @@ public function noCookiesAction() if ($url = $redirect->getRedirectUrl()) { $this->_redirectUrl($url); - } - elseif ($redirect->getRedirect()) { + } elseif ($redirect->getRedirect()) { $this->_redirect($redirect->getPath(), $redirect->getArguments()); - } - else { + } else { $this->loadLayout(array('default', 'noCookie')); $this->renderLayout(); } @@ -780,7 +778,7 @@ protected function _redirectError($defaultUrl) * @param string $defaultUrl * @return $this */ - protected function _redirectReferer($defaultUrl=null) + protected function _redirectReferer($defaultUrl = null) { $refererUrl = $this->_getRefererUrl(); diff --git a/app/code/core/Mage/Core/Controller/Varien/Front.php b/app/code/core/Mage/Core/Controller/Varien/Front.php index 47916eef668..880e4e0a556 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Front.php +++ b/app/code/core/Mage/Core/Controller/Varien/Front.php @@ -248,7 +248,7 @@ public function getRouterByRoute($routeName) /** * @param string $frontName - * @return false|Mage_Core_Controller_Varien_Router_Abstract + * @return false|Mage_Core_Controller_Varien_Router_Standard */ public function getRouterByFrontName($frontName) { diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php index 6eb68f81494..ff5b9acf174 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php @@ -133,7 +133,7 @@ public function collectRoutes($configArea, $useRouterName) /** * Add module definition to routes. * - * {@inheritDoc} + * @inheritDoc */ public function addModule($frontName, $moduleName, $routeName) { @@ -154,7 +154,7 @@ public function addModule($frontName, $moduleName, $routeName) * Check if current controller instance is allowed in current router. * * @param Mage_Core_Controller_Varien_Action $controllerInstance - * @return boolean + * @return true */ protected function _validateControllerInstance($controllerInstance) { diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php index a522d089994..55ed4552fd3 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php @@ -38,14 +38,15 @@ public function collectRoutes($configArea, $useRouterName) { $routers = array(); $routersConfigNode = Mage::getConfig()->getNode($configArea.'/routers'); - if($routersConfigNode) { + if ($routersConfigNode) { $routers = $routersConfigNode->children(); } - foreach ($routers as $routerName=>$routerConfig) { + foreach ($routers as $routerName => $routerConfig) { $use = (string)$routerConfig->use; if ($use == $useRouterName) { $modules = array((string)$routerConfig->args->module); if ($routerConfig->args->modules) { + /** @var Varien_Simplexml_Element $customModule */ foreach ($routerConfig->args->modules->children() as $customModule) { if ((string)$customModule) { if ($before = $customModule->getAttribute('before')) { @@ -109,7 +110,7 @@ protected function _afterModuleMatch() * Match the request * * @param Mage_Core_Controller_Request_Http $request - * {@inheritDoc} + * @inheritDoc */ public function match(Zend_Controller_Request_Http $request) { diff --git a/app/code/core/Mage/Core/Helper/Abstract.php b/app/code/core/Mage/Core/Helper/Abstract.php index 9adef6366b3..3683691e500 100644 --- a/app/code/core/Mage/Core/Helper/Abstract.php +++ b/app/code/core/Mage/Core/Helper/Abstract.php @@ -55,7 +55,7 @@ abstract class Mage_Core_Helper_Abstract /** * Retrieve request object * - * @return Zend_Controller_Request_Http + * @return Mage_Core_Controller_Request_Http */ protected function _getRequest() { @@ -85,7 +85,7 @@ protected function _loadCache($id) * @param null|false|int $lifeTime * @return Mage_Core_Helper_Abstract */ - protected function _saveCache($data, $id, $tags=array(), $lifeTime=false) + protected function _saveCache($data, $id, $tags = array(), $lifeTime = false) { Mage::app()->saveCache($data, $id, $tags, $lifeTime); return $this; @@ -109,7 +109,7 @@ protected function _removeCache($id) * @param array $tags * @return Mage_Core_Helper_Abstract */ - protected function _cleanCache($tags=array()) + protected function _cleanCache($tags = array()) { Mage::app()->cleanCache($tags); return $this; @@ -188,7 +188,7 @@ public function __() } /** - * @param $data + * @param array $data * @param array $allowedTags * @return mixed * @see self::escapeHtml() @@ -331,7 +331,7 @@ public function escapeScriptIdentifiers($data) * @param string $quote * @return mixed */ - public function jsQuoteEscape($data, $quote='\'') + public function jsQuoteEscape($data, $quote = '\'') { if (is_array($data)) { $result = array(); diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index 7397ec175bf..b8cefa94fb3 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -170,7 +170,7 @@ public function formatDate($date = null, $format = Mage_Core_Model_Locale::FORMA } if (is_null($date)) { $date = Mage::app()->getLocale()->date(Mage::getSingleton('core/date')->gmtTimestamp(), null, null); - } else if (!$date instanceof Zend_Date) { + } elseif (!$date instanceof Zend_Date) { $date = Mage::app()->getLocale()->date(strtotime($date), null, null); } @@ -199,7 +199,7 @@ public function formatTime($time = null, $format = Mage_Core_Model_Locale::FORMA if (is_null($time)) { $date = Mage::app()->getLocale()->date(time()); - } else if ($time instanceof Zend_Date) { + } elseif ($time instanceof Zend_Date) { $date = $time; } else { $date = Mage::app()->getLocale()->date(strtotime($time)); @@ -343,7 +343,7 @@ public function removeAccents($string, $german = false) } $replacements[$german] = array(); - foreach ($subst as $k=>$v) { + foreach ($subst as $k => $v) { $replacements[$german][$k<256 ? chr($k) : '&#'.$k.';'] = $v; } } @@ -390,7 +390,7 @@ public function getCacheTypes() { $types = array(); $config = Mage::getConfig()->getNode(Mage_Core_Model_Cache::XML_PATH_TYPES); - foreach ($config->children() as $type=>$node) { + foreach ($config->children() as $type => $node) { $types[$type] = (string)$node->label; } return $types; @@ -406,7 +406,7 @@ public function getCacheBetaTypes() $types = array(); $config = Mage::getConfig()->getNode(self::XML_PATH_CACHE_BETA_TYPES); if ($config) { - foreach ($config->children() as $type=>$node) { + foreach ($config->children() as $type => $node) { $types[$type] = (string)$node->label; } } @@ -427,11 +427,10 @@ public function getCacheBetaTypes() * @param string $root * @return boolean */ - public function copyFieldset($fieldset, $aspect, $source, $target, $root='global') + public function copyFieldset($fieldset, $aspect, $source, $target, $root = 'global') { if (!(is_array($source) || $source instanceof Varien_Object) || !(is_array($target) || $target instanceof Varien_Object)) { - return false; } $fields = Mage::getConfig()->getFieldset($fieldset, $root); @@ -443,7 +442,7 @@ public function copyFieldset($fieldset, $aspect, $source, $target, $root='global $targetIsArray = is_array($target); $result = false; - foreach ($fields as $code=>$node) { + foreach ($fields as $code => $node) { if (empty($node->$aspect)) { continue; } @@ -491,7 +490,7 @@ public function copyFieldset($fieldset, $aspect, $source, $target, $root='global * $forceSetAll true will cause to set all possible values for all elements. * When false (default), only non-empty values will be set. * - * @param mixed $array + * @param Varien_Object[] $array * @param string $prefix * @param bool $forceSetAll * @return mixed @@ -707,7 +706,7 @@ public function jsonDecode($encodedValue, $objectDecodeType = Zend_Json::TYPE_AR /** * Generate a hash from unique ID - * @param $prefix + * @param string $prefix * @return string */ public function uniqHash($prefix = '') @@ -730,7 +729,7 @@ public function uniqHash($prefix = '') * @param array $srcFiles * @param string|false $targetFile - file path to be written * @param bool $mustMerge - * @param callback $beforeMergeCallback + * @param callable $beforeMergeCallback * @param array|string $extensionsFilter * @return bool|string */ @@ -770,7 +769,7 @@ public function mergeFiles( if (!is_array($extensionsFilter)) { $extensionsFilter = array($extensionsFilter); } - if (!empty($srcFiles)){ + if (!empty($srcFiles)) { foreach ($srcFiles as $key => $file) { $fileExt = strtolower(pathinfo($file, PATHINFO_EXTENSION)); if (!in_array($fileExt, $extensionsFilter)) { @@ -933,7 +932,7 @@ public function getExactDivision($dividend, $divisor) * Security enchancement for CSV data processing by Excel-like applications. * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702 * - * @param $data + * @param array $data * @return array */ public function getEscapedCSVData(array $data) diff --git a/app/code/core/Mage/Core/Helper/File/Storage/Database.php b/app/code/core/Mage/Core/Helper/File/Storage/Database.php index e275a14284b..2d984ea9c02 100644 --- a/app/code/core/Mage/Core/Helper/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Helper/File/Storage/Database.php @@ -41,7 +41,7 @@ class Mage_Core_Helper_File_Storage_Database extends Mage_Core_Helper_Abstract /** * Storage resource model - * @var null|Mage_Core_Model_Mysql4_File_Storage_Database + * @var Mage_Core_Model_Resource_File_Storage_Database */ protected $_resourceModel = null; @@ -103,7 +103,7 @@ public function getStorageFileModel() /** * Get storage model * - * @return Mage_Core_Model_Mysql4_File_Storage_Database + * @return Mage_Core_Model_Resource_File_Storage_Database */ public function getResourceStorageModel() { @@ -196,7 +196,7 @@ public function getUniqueFilename($directory, $filename) * Save database file to file system * * @param string $filename - * @return bool|int + * @return bool */ public function saveFileToFilesystem($filename) { diff --git a/app/code/core/Mage/Core/Helper/Http.php b/app/code/core/Mage/Core/Helper/Http.php index 0bc67da0207..d8afe687d7f 100644 --- a/app/code/core/Mage/Core/Helper/Http.php +++ b/app/code/core/Mage/Core/Helper/Http.php @@ -50,7 +50,7 @@ class Mage_Core_Helper_Http extends Mage_Core_Helper_Abstract */ public function authValidate($headers = null) { - if(!is_null($headers)) { + if (!is_null($headers)) { $_SERVER = $headers; } @@ -59,7 +59,7 @@ public function authValidate($headers = null) // moshe's fix for CGI if (empty($_SERVER['HTTP_AUTHORIZATION'])) { - foreach ($_SERVER as $k=>$v) { + foreach ($_SERVER as $k => $v) { if (substr($k, -18)==='HTTP_AUTHORIZATION' && !empty($v)) { $_SERVER['HTTP_AUTHORIZATION'] = $v; break; @@ -94,8 +94,8 @@ public function authValidate($headers = null) public function authFailed() { Mage::app()->getResponse() - ->setHeader('HTTP/1.1','401 Unauthorized') - ->setHeader('WWW-Authenticate','Basic realm="RSS Feeds"') + ->setHeader('HTTP/1.1', '401 Unauthorized') + ->setHeader('WWW-Authenticate', 'Basic realm="RSS Feeds"') ->setBody('

401 Unauthorized

') ->sendResponse(); exit; diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 88b80bdffd4..04db927fe02 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -310,7 +310,7 @@ public function ksortMultibyte(array &$sort) $oldLocale = setlocale(LC_COLLATE, "0"); $localeCode = Mage::app()->getLocale()->getLocaleCode(); // use fallback locale if $localeCode is not available - setlocale(LC_COLLATE, $localeCode . '.UTF8', 'C.UTF-8', 'en_US.utf8'); + setlocale(LC_COLLATE, $localeCode . '.UTF8', 'C.UTF-8', 'en_US.utf8'); ksort($sort, SORT_LOCALE_STRING); setlocale(LC_COLLATE, $oldLocale); @@ -463,7 +463,7 @@ protected function _getLastSubkey($key, $withBrackets = true) /** * Set array helper * - * @param Mage_Core_Helper_Abstract $helper + * @param Mage_Core_Helper_Abstract|Mage_Core_Helper_Array $helper * @return $this */ public function setArrayHelper(Mage_Core_Helper_Abstract $helper) @@ -498,13 +498,13 @@ public function uniOrd($c) if ($h <= 0x7F) { $ord = $h; - } else if ($h < 0xC2) { + } elseif ($h < 0xC2) { $ord = 0; - } else if ($h <= 0xDF) { + } elseif ($h <= 0xDF) { $ord = (($h & 0x1F) << 6 | (ord($c[1]) & 0x3F)); - } else if ($h <= 0xEF) { + } elseif ($h <= 0xEF) { $ord = (($h & 0x0F) << 12 | (ord($c[1]) & 0x3F) << 6 | (ord($c[2]) & 0x3F)); - } else if ($h <= 0xF4) { + } elseif ($h <= 0xF4) { $ord = (($h & 0x0F) << 18 | (ord($c[1]) & 0x3F) << 12 | (ord($c[2]) & 0x3F) << 6 | (ord($c[3]) & 0x3F)); } @@ -514,7 +514,7 @@ public function uniOrd($c) /** * UnSerialize string - * @param $str + * @param string $str * @return mixed|null * @throws Exception */ diff --git a/app/code/core/Mage/Core/Helper/Url.php b/app/code/core/Mage/Core/Helper/Url.php index 0fa1775c75d..ffa54c1e863 100644 --- a/app/code/core/Mage/Core/Helper/Url.php +++ b/app/code/core/Mage/Core/Helper/Url.php @@ -113,7 +113,7 @@ protected function _prepareString($string) */ public function addRequestParam($url, $param) { - $startDelimiter = (false === strpos($url,'?'))? '?' : '&'; + $startDelimiter = (false === strpos($url, '?'))? '?' : '&'; $arrQueryParams = array(); foreach ($param as $key => $value) { diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index 5e529470213..b171b34b860 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -37,6 +37,8 @@ * @method $this setUpdatedAt(string $currentTime) * @method $this setAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $value) * @method bool hasErrors() + * @method Mage_Customer_Model_Address_Abstract getBillingAddress() + * @method Mage_Customer_Model_Address_Abstract getShippingAddress() */ abstract class Mage_Core_Model_Abstract extends Varien_Object { @@ -82,7 +84,7 @@ abstract class Mage_Core_Model_Abstract extends Varien_Object * * When you use true - all cache will be clean * - * @var string || true + * @var string|true */ protected $_cacheTag = false; @@ -120,7 +122,7 @@ protected function _init($resourceModel) * @param string $resourceName * @param string|null $resourceCollectionName */ - protected function _setResourceModel($resourceName, $resourceCollectionName=null) + protected function _setResourceModel($resourceName, $resourceCollectionName = null) { $this->_resourceName = $resourceName; if (is_null($resourceCollectionName)) { @@ -132,7 +134,7 @@ protected function _setResourceModel($resourceName, $resourceCollectionName=null /** * Get resource instance * - * @return Mage_Core_Model_Mysql4_Abstract + * @return Mage_Core_Model_Resource_Db_Abstract|object|string */ protected function _getResource() { @@ -202,7 +204,8 @@ public function getResourceName() /** * Get collection instance * - * @return object + * @return Mage_Core_Model_Resource_Db_Collection_Abstract + * @throws Mage_Core_Exception */ public function getResourceCollection() { @@ -213,7 +216,7 @@ public function getResourceCollection() } /** - * @return Mage_Core_Model_Mysql4_Collection_Abstract|object + * @return Mage_Core_Model_Resource_Db_Collection_Abstract|object */ public function getCollection() { @@ -227,7 +230,7 @@ public function getCollection() * @param string|null $field * @return $this */ - public function load($id, $field=null) + public function load($id, $field = null) { $this->_beforeLoad($id, $field); $this->_getResource()->load($this, $id, $field); @@ -375,7 +378,7 @@ protected function _afterSaveCommit() * @param bool $flag * @return bool */ - public function isObjectNew($flag=null) + public function isObjectNew($flag = null) { if ($flag !== null) { $this->_isObjectNew = $flag; @@ -489,8 +492,7 @@ public function delete() $this->_afterDelete(); $this->_getResource()->commit(); - } - catch (Exception $e){ + } catch (Exception $e) { $this->_getResource()->rollBack(); throw $e; } @@ -553,7 +555,7 @@ protected function _afterDeleteCommit() /** * Retrieve model resource * - * @return Mage_Core_Model_Mysql4_Abstract + * @return Mage_Core_Model_Resource_Db_Abstract */ public function getResource() { diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index aac39e5d1e5..8f80abb4aa6 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -192,7 +192,7 @@ class Mage_Core_Model_App /** * Request object * - * @var Zend_Controller_Request_Http + * @var Mage_Core_Controller_Request_Http */ protected $_request; @@ -955,7 +955,7 @@ public function getDistroLocaleCode() * @param null|Mage_Core_Model_Website|true|int|string $id * @return Mage_Core_Model_Website */ - public function getWebsite($id=null) + public function getWebsite($id = null) { if (is_null($id)) { $id = $this->getStore()->getWebsiteId(); @@ -1015,7 +1015,7 @@ public function getWebsites($withDefault = false, $codeKey = false) * @param null|Mage_Core_Model_Store_Group|int|string $id * @return Mage_Core_Model_Store_Group */ - public function getGroup($id=null) + public function getGroup($id = null) { if (is_null($id)) { $id = $this->getStore()->getGroup()->getId(); @@ -1171,7 +1171,7 @@ public function loadCache($id) * @param null|false|int $lifeTime * @return $this */ - public function saveCache($data, $id, $tags=array(), $lifeTime=false) + public function saveCache($data, $id, $tags = array(), $lifeTime = false) { $this->_cache->save($data, $id, $tags, $lifeTime); return $this; @@ -1195,7 +1195,7 @@ public function removeCache($id) * @param array $tags * @return $this */ - public function cleanCache($tags=array()) + public function cleanCache($tags = array()) { $this->_cache->clean($tags); Mage::dispatchEvent('application_clean_cache', array('tags' => $tags)); @@ -1206,9 +1206,9 @@ public function cleanCache($tags=array()) * Check whether to use cache for specific component * * @param null|string $type - * @return bool|array + * @return false|array */ - public function useCache($type=null) + public function useCache($type = null) { return $this->_cache->canUse($type); } @@ -1311,7 +1311,7 @@ public function addEventArea($area) public function dispatchEvent($eventName, $args) { $eventName = strtolower($eventName); - foreach ($this->_events as $area=>$events) { + foreach ($this->_events as $area => $events) { if (!isset($events[$eventName])) { $eventConfig = $this->getConfig()->getEventConfig($area, $eventName); if (!$eventConfig) { @@ -1342,7 +1342,7 @@ public function dispatchEvent($eventName, $args) $observer = new Varien_Event_Observer(); } - foreach ($events[$eventName]['observers'] as $obsName=>$obs) { + foreach ($events[$eventName]['observers'] as $obsName => $obs) { $observer->setData(array('event'=>$event)); Varien_Profiler::start('OBSERVER: '.$obsName); switch ($obs['type']) { @@ -1526,9 +1526,9 @@ public function isInstalled() * @return array * @deprecated after 1.4.0.0-alpha3, functionality implemented in Mage_Core_Model_Cache */ - protected function _getCacheTags($tags=array()) + protected function _getCacheTags($tags = array()) { - foreach ($tags as $index=>$value) { + foreach ($tags as $index => $value) { $tags[$index] = $this->_getCacheId($value); } return $tags; @@ -1552,7 +1552,7 @@ public function getUseCacheFilename() * @param string $id * @return string */ - protected function _getCacheId($id=null) + protected function _getCacheId($id = null) { if ($id) { $id = $this->prepareCacheId($id); diff --git a/app/code/core/Mage/Core/Model/App/Area.php b/app/code/core/Mage/Core/Model/App/Area.php index c7d9181dbbb..cffb0886ad1 100644 --- a/app/code/core/Mage/Core/Model/App/Area.php +++ b/app/code/core/Mage/Core/Model/App/Area.php @@ -89,7 +89,7 @@ public function getApplication() * @param string|null $part * @return Mage_Core_Model_App_Area */ - public function load($part=null) + public function load($part = null) { if (is_null($part)) { $this->_loadPart(self::PART_CONFIG) diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index e263fac3507..13367f7f868 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -426,7 +426,7 @@ public function remove($id) * @param array $tags * @return bool */ - public function clean($tags=array()) + public function clean($tags = array()) { $mode = Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG; if (!empty($tags)) { @@ -518,7 +518,7 @@ public function saveOptions($options) * Check if cache can be used for specific data type * * @param string $typeCode - * @return bool|array + * @return false|array */ public function canUse($typeCode) { @@ -578,7 +578,7 @@ public function getTypes() $types = array(); $config = Mage::getConfig()->getNode(self::XML_PATH_TYPES); if ($config) { - foreach ($config->children() as $type=>$node) { + foreach ($config->children() as $type => $node) { $types[$type] = new Varien_Object(array( 'id' => $type, 'cache_type' => Mage::helper('core')->__((string)$node->label), diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index a149828e9df..3a37fabd82e 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -36,6 +36,13 @@ class Mage_Core_Model_Config extends Mage_Core_Model_Config_Base { const CACHE_TAG = 'CONFIG'; + /** + * Configuration xml + * + * @var Mage_Core_Model_Config_Element + */ + protected $_xml = null; + /** * Flag which allow use cache logic * @@ -194,7 +201,7 @@ class Mage_Core_Model_Config extends Mage_Core_Model_Config_Base * * @param mixed $sourceData */ - public function __construct($sourceData=null) + public function __construct($sourceData = null) { $this->setCacheId('config_global'); $this->_options = new Mage_Core_Model_Config_Options($sourceData); @@ -246,7 +253,7 @@ public function setOptions($options) * @param array $options * @return $this */ - public function init($options=array()) + public function init($options = array()) { $this->setCacheChecksum(null); $this->_cacheLoadedSections = array(); @@ -419,14 +426,16 @@ protected function _canUseCacheForInit() $retries = 10; do { if ($this->_loadCache($this->_getCacheLockId())) { - if ($retries) usleep(500000); // 0.5 seconds + if ($retries) { + usleep(500000); // 0.5 seconds + } } else { - return TRUE; + return true; } } while ($retries--); } - return FALSE; + return false; } /** @@ -455,7 +464,7 @@ protected function _getCacheLockId() * @param array $tags cache tags * @return Mage_Core_Model_Config */ - public function saveCache($tags=array()) + public function saveCache($tags = array()) { if (!Mage::app()->useCache('config')) { return $this; @@ -502,14 +511,18 @@ public function saveCache($tags=array()) * @param array $tags * @return Mage_Core_Model_Config */ - protected function _saveSectionCache($idPrefix, $sectionName, $source, $recursionLevel=0, $tags=array()) + protected function _saveSectionCache($idPrefix, $sectionName, $source, $recursionLevel = 0, $tags = array()) { if ($source && $source->$sectionName) { $cacheId = $idPrefix . '_' . $sectionName; if ($recursionLevel > 0) { foreach ($source->$sectionName->children() as $subSectionName => $node) { $this->_saveSectionCache( - $cacheId, $subSectionName, $source->$sectionName, $recursionLevel-1, $tags + $cacheId, + $subSectionName, + $source->$sectionName, + $recursionLevel-1, + $tags ); } } @@ -562,7 +575,7 @@ protected function _loadCache($id) * @param false|int $lifetime * @return Mage_Core_Model_App */ - protected function _saveCache($data, $id, $tags=array(), $lifetime=false) + protected function _saveCache($data, $id, $tags = array(), $lifetime = false) { return Mage::app()->saveCache($data, $id, $tags, $lifetime); } @@ -646,9 +659,10 @@ public function getSectionNode($path) /** * Returns node found by the $path and scope info * - * {@inheritDoc} + * @inheritDoc + * @return Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false */ - public function getNode($path=null, $scope='', $scopeCode=null) + public function getNode($path = null, $scope = '', $scopeCode = null) { if ($scope !== '') { if (('store' === $scope) || ('website' === $scope)) { @@ -731,7 +745,7 @@ protected function _getDeclaredModuleFiles() if ($name == 'Mage_All') { $collectModuleFiles['base'][] = $v; - } else if (substr($name, 0, 5) == 'Mage_') { + } elseif (substr($name, 0, 5) == 'Mage_') { $collectModuleFiles['mage'][] = $v; } else { $collectModuleFiles['custom'][] = $v; @@ -929,7 +943,7 @@ public function determineOmittedNamespace($name, $asFullModuleName = false) } } // assume namespace is qualified - if(isset($name[1])) { + if (isset($name[1])) { $fullNS = $name[0] . '_' . $name[1]; if (2 <= $partsNum && isset($namespace[$fullNS])) { return $asFullModuleName ? $namespace[$fullNS] : $fullNS; @@ -948,7 +962,7 @@ public function determineOmittedNamespace($name, $asFullModuleName = false) * @param null $mergeModel * @return Mage_Core_Model_Config_Base */ - public function loadModulesConfiguration($fileName, $mergeToObject = null, $mergeModel=null) + public function loadModulesConfiguration($fileName, $mergeToObject = null, $mergeModel = null) { $disableLocalModules = !$this->_canUseLocalModules(); @@ -960,7 +974,7 @@ public function loadModulesConfiguration($fileName, $mergeToObject = null, $merg $mergeModel = clone $this->_prototype; } $modules = $this->getNode('modules')->children(); - foreach ($modules as $modName=>$module) { + foreach ($modules as $modName => $module) { if ($module->is('active')) { if ($disableLocalModules && ('local' === (string)$module->codePool)) { continue; @@ -1010,7 +1024,8 @@ public function getDistroServerVars() $hostArr = explode(':', $_SERVER['HTTP_HOST']); $host = $hostArr[0]; $port = isset( - $hostArr[1]) && (!$secure && $hostArr[1]!=80 || $secure && $hostArr[1]!=443 + $hostArr[1] + ) && (!$secure && $hostArr[1]!=80 || $secure && $hostArr[1]!=443 ) ? ':'.$hostArr[1] : ''; $path = Mage::app()->getRequest()->getBasePath(); @@ -1027,7 +1042,7 @@ public function getDistroServerVars() 'base_url' => $baseUrl, ); - foreach ($this->_distroServerVars as $k=>$v) { + foreach ($this->_distroServerVars as $k => $v) { $this->_substServerVars['{{'.$k.'}}'] = $v; } } @@ -1054,7 +1069,7 @@ public function substDistroServerVars($data) * @param string $moduleName * @return Mage_Core_Model_Config_Element|SimpleXMLElement */ - function getModuleConfig($moduleName='') + function getModuleConfig($moduleName = '') { $modules = $this->getNode('modules'); if (''===$moduleName) { @@ -1072,7 +1087,7 @@ function getModuleConfig($moduleName='') * @param string|Mage_Core_Model_Config_Element $module * @return object */ - function getModuleSetup($module='') + function getModuleSetup($module = '') { $className = 'Mage_Core_Setup'; if (''!==$module) { @@ -1099,7 +1114,7 @@ function getModuleSetup($module='') * @param string $type * @return string */ - public function getBaseDir($type='base') + public function getBaseDir($type = 'base') { return $this->getOptions()->getDir($type); } @@ -1111,7 +1126,7 @@ public function getBaseDir($type='base') * @param string $type * @return string */ - public function getVarDir($path=null, $type='var') + public function getVarDir($path = null, $type = 'var') { $dir = Mage::getBaseDir($type).($path!==null ? DS.$path : ''); if (!$this->createDirIfNotExists($dir)) { @@ -1220,7 +1235,7 @@ public function loadEventObservers($area) * @param array|string $args Module name if string * @return array */ - public function getPathVars($args=null) + public function getPathVars($args = null) { $path = array(); @@ -1238,7 +1253,7 @@ public function getPathVars($args=null) * @param string $groupRootNode optional config path for group config * @return string */ - public function getGroupedClassName($groupType, $classId, $groupRootNode=null) + public function getGroupedClassName($groupType, $classId, $groupRootNode = null) { if (empty($groupRootNode)) { $groupRootNode = 'global/'.$groupType.'s'; @@ -1368,7 +1383,7 @@ public function getModelClassName($modelClass) * @param array|object $constructArguments * @return Mage_Core_Model_Abstract|false */ - public function getModelInstance($modelClass='', $constructArguments=array()) + public function getModelInstance($modelClass = '', $constructArguments = array()) { $className = $this->getModelClassName($modelClass); if (class_exists($className)) { @@ -1401,9 +1416,9 @@ public function getNodeClassInstance($path) * * @param string $modelClass * @param array $constructArguments - * @return object|false + * @return Mage_Core_Model_Resource_Db_Collection_Abstract|false */ - public function getResourceModelInstance($modelClass='', $constructArguments=array()) + public function getResourceModelInstance($modelClass = '', $constructArguments = array()) { $factoryName = $this->_getResourceModelFactoryClassName($modelClass); if (!$factoryName) { @@ -1416,7 +1431,7 @@ public function getResourceModelInstance($modelClass='', $constructArguments=arr * Get resource configuration for resource name * * @param string $name - * @return SimpleXMLElement|Varien_Simplexml_Element + * @return Mage_Core_Model_Config_Element|SimpleXMLElement */ public function getResourceConfig($name) { @@ -1426,13 +1441,14 @@ public function getResourceConfig($name) /** * Get connection configuration * - * @param string $name - * @return false|SimpleXMLElement|Varien_Simplexml_Element + * @param string $name + * @return false|Mage_Core_Model_Config_Element */ public function getResourceConnectionConfig($name) { $config = $this->getResourceConfig($name); if ($config) { + /** @var Mage_Core_Model_Config_Element $conn */ $conn = $config->connection; if ($conn) { if (!empty($conn->use)) { @@ -1449,7 +1465,7 @@ public function getResourceConnectionConfig($name) * Retrieve resource type configuration for resource name * * @param string $type - * @return SimpleXMLElement|Varien_Simplexml_Element + * @return SimpleXMLElement|Varien_Simplexml_Element|Mage_Core_Model_Config_Element */ public function getResourceTypeConfig($type) { @@ -1497,7 +1513,7 @@ public function getStoresConfigByPath($path, $allowValues = array(), $useAsKey = if (empty($allowValues)) { $storeValues[$key] = $pathValue; - } else if (in_array($pathValue, $allowValues)) { + } elseif (in_array($pathValue, $allowValues)) { $storeValues[$key] = $pathValue; } } diff --git a/app/code/core/Mage/Core/Model/Config/Base.php b/app/code/core/Mage/Core/Model/Config/Base.php index 800f80dde1e..824efa63681 100644 --- a/app/code/core/Mage/Core/Model/Config/Base.php +++ b/app/code/core/Mage/Core/Model/Config/Base.php @@ -40,7 +40,7 @@ class Mage_Core_Model_Config_Base extends Varien_Simplexml_Config /** * @param string|null $sourceData */ - public function __construct($sourceData=null) + public function __construct($sourceData = null) { $this->_elementClass = 'Mage_Core_Model_Config_Element'; parent::__construct($sourceData); diff --git a/app/code/core/Mage/Core/Model/Config/Element.php b/app/code/core/Mage/Core/Model/Config/Element.php index bfc53bf99a9..978550d8aa4 100644 --- a/app/code/core/Mage/Core/Model/Config/Element.php +++ b/app/code/core/Mage/Core/Model/Config/Element.php @@ -36,8 +36,8 @@ class Mage_Core_Model_Config_Element extends Varien_Simplexml_Element * Enter description here... * * @param string $var - * @param boolean $value - * @return boolean + * @param string|true $value + * @return bool */ public function is($var, $value = true) { diff --git a/app/code/core/Mage/Core/Model/Date.php b/app/code/core/Mage/Core/Model/Date.php index 4b66c4501e1..255d4061b17 100644 --- a/app/code/core/Mage/Core/Model/Date.php +++ b/app/code/core/Mage/Core/Model/Date.php @@ -76,7 +76,7 @@ public function calculateOffset($timezone = null) $result = true; $offset = 0; - if (!is_null($timezone)){ + if (!is_null($timezone)) { $oldzone = @date_default_timezone_get(); $result = date_default_timezone_set($timezone); } @@ -85,7 +85,7 @@ public function calculateOffset($timezone = null) $offset = (int)date('Z'); } - if (!is_null($timezone)){ + if (!is_null($timezone)) { date_default_timezone_set($oldzone); } @@ -143,7 +143,7 @@ public function gmtTimestamp($input = null) { if (is_null($input)) { return gmdate('U'); - } else if (is_numeric($input)) { + } elseif (is_numeric($input)) { $result = $input; } else { $result = strtotime($input); @@ -172,7 +172,7 @@ public function timestamp($input = null) { if (is_null($input)) { $result = $this->gmtTimestamp(); - } else if (is_numeric($input)) { + } elseif (is_numeric($input)) { $result = $input; } else { $result = strtotime($input); diff --git a/app/code/core/Mage/Core/Model/Design/Fallback.php b/app/code/core/Mage/Core/Model/Design/Fallback.php index 6cd0ed451c4..4044e911189 100644 --- a/app/code/core/Mage/Core/Model/Design/Fallback.php +++ b/app/code/core/Mage/Core/Model/Design/Fallback.php @@ -122,9 +122,9 @@ public function getFallbackScheme($area, $package, $theme) /** * Check if inheritance defined in theme config * - * @param $area - * @param $package - * @param $theme + * @param string $area + * @param string $package + * @param string $theme * @return bool */ protected function _isInheritanceDefined($area, $package, $theme) diff --git a/app/code/core/Mage/Core/Model/Design/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php index 8e53e4a81b6..f5f16e2d66a 100644 --- a/app/code/core/Mage/Core/Model/Design/Package.php +++ b/app/code/core/Mage/Core/Model/Design/Package.php @@ -408,7 +408,7 @@ public function validateFile($file, array $params) * Get filename by specified theme parameters * * @param array $file - * @param $params + * @param array $params * @return string */ protected function _renderFilename($file, array $params) @@ -437,7 +437,7 @@ protected function _renderFilename($file, array $params) * If disabled, the lookup won't be performed to spare filesystem calls. * * @param string $file - * @param array &$params + * @param array $params * @param array $fallbackScheme * @return string */ @@ -568,8 +568,8 @@ public function getThemeList($package = null) { $result = array(); - if (is_null($package)){ - foreach ($this->getPackageList() as $package){ + if (is_null($package)) { + foreach ($this->getPackageList() as $package) { $result[$package] = $this->getThemeList($package); } } else { @@ -593,7 +593,7 @@ private function _listDirectories($path, $fullPath = false) $dir = opendir($path); if ($dir) { while ($entry = readdir($dir)) { - if (substr($entry, 0, 1) == '.' || !is_dir($path . DS . $entry)){ + if (substr($entry, 0, 1) == '.' || !is_dir($path . DS . $entry)) { continue; } if ($fullPath) { @@ -672,7 +672,7 @@ public static function getPackageByUserAgent(array $rules, $regexpsConfigPath = /** * Merge specified javascript files and return URL to the merged file on success * - * @param $files + * @param array $files * @return string */ public function getMergedJsUrl($files) @@ -691,7 +691,7 @@ public function getMergedJsUrl($files) /** * Merge specified css files and return URL to the merged file on success * - * @param $files + * @param array $files * @return string */ public function getMergedCssUrl($files) @@ -734,7 +734,7 @@ public function getMergedCssUrl($files) * @param array $srcFiles * @param string|bool $targetFile - file path to be written * @param bool $mustMerge - * @param callback $beforeMergeCallback + * @param callable $beforeMergeCallback * @param array|string $extensionsFilter * @return bool|string */ @@ -908,7 +908,7 @@ protected function _prepareUrl($uri) $baseUrl = Mage::getBaseUrl('web', $secure); } - foreach ($pathParts as $key=>$part) { + foreach ($pathParts as $key => $part) { if ($part == '.' || $part == '..') { unset($pathParts[$key]); } diff --git a/app/code/core/Mage/Core/Model/Design/Source/Apply.php b/app/code/core/Mage/Core/Model/Design/Source/Apply.php index c83a43cb755..7f9370fdbd2 100644 --- a/app/code/core/Mage/Core/Model/Design/Source/Apply.php +++ b/app/code/core/Mage/Core/Model/Design/Source/Apply.php @@ -42,7 +42,7 @@ public function getAllOptions() 2 => Mage::helper('core')->__('This category only') ); - foreach ($optionArray as $k=>$label) { + foreach ($optionArray as $k => $label) { $this->_options[] = array('value'=>$k, 'label'=>$label); } } diff --git a/app/code/core/Mage/Core/Model/Design/Source/Design.php b/app/code/core/Mage/Core/Model/Design/Source/Design.php index 9dd6375cc12..eca9c049b7d 100644 --- a/app/code/core/Mage/Core/Model/Design/Source/Design.php +++ b/app/code/core/Mage/Core/Model/Design/Source/Design.php @@ -63,7 +63,7 @@ public function getAllOptions($withEmpty = true) if (is_null($this->_options)) { $design = Mage::getModel('core/design_package')->getThemeList(); $options = array(); - foreach ($design as $package => $themes){ + foreach ($design as $package => $themes) { $packageOption = array('label' => $package); $themeOptions = array(); foreach ($themes as $theme) { diff --git a/app/code/core/Mage/Core/Model/Domainpolicy.php b/app/code/core/Mage/Core/Model/Domainpolicy.php index 9f35af7e6f4..a300fc6ea96 100644 --- a/app/code/core/Mage/Core/Model/Domainpolicy.php +++ b/app/code/core/Mage/Core/Model/Domainpolicy.php @@ -71,23 +71,21 @@ public function __construct($options = array()) /** * Add X-Frame-Options header to response, depends on config settings * - * @var Varien_Object $observer + * @var Varien_Event_Observer $observer * @return $this */ - public function addDomainPolicyHeader($observer) + public function addDomainPolicyHeader(Varien_Event_Observer $observer) { - /** @var Mage_Core_Controller_Varien_Action $action */ $action = $observer->getControllerAction(); $policy = null; if ('adminhtml' == $action->getLayout()->getArea()) { $policy = $this->getBackendPolicy(); - } elseif('frontend' == $action->getLayout()->getArea()) { + } elseif ('frontend' == $action->getLayout()->getArea()) { $policy = $this->getFrontendPolicy(); } if ($policy) { - /** @var Mage_Core_Controller_Response_Http $response */ $response = $action->getResponse(); $response->setHeader('X-Frame-Options', $policy, true); } @@ -118,12 +116,12 @@ public function getFrontendPolicy() /** * Return string representation for policy code * - * @param $policyCode + * @param string $policyCode * @return string|null */ protected function _getDomainPolicyByCode($policyCode) { - switch($policyCode) { + switch ($policyCode) { case self::FRAME_POLICY_ALLOW: $policy = null; break; diff --git a/app/code/core/Mage/Core/Model/Email.php b/app/code/core/Mage/Core/Model/Email.php index e7a3eca5de0..c3b60dfd392 100644 --- a/app/code/core/Mage/Core/Model/Email.php +++ b/app/code/core/Mage/Core/Model/Email.php @@ -39,8 +39,11 @@ * @method getFromName() * @method $this setFromName(string $string) * @method string getTemplate() + * @method $this setTemplate(string $string) * @method string|array getToEmail() + * @method $this setToEmail(string|array $string) * @method getToName() + * @method $this setToName(string $string) * @method string getType() * @method $this setType(string $string) */ @@ -69,7 +72,7 @@ public function __construct() public function setTemplateVar($var, $value = null) { if (is_array($var)) { - foreach ($var as $index=>$value) { + foreach ($var as $index => $value) { $this->_tplVars[$index] = $value; } } else { @@ -96,7 +99,7 @@ public function getBody() $this->_block = Mage::getModel('core/layout')->createBlock('core/template', 'email') ->setArea('frontend') ->setTemplate($this->getTemplate()); - foreach ($this->getTemplateVars() as $var=>$value) { + foreach ($this->getTemplateVars() as $var => $value) { $this->_block->assign($var, $value); } $this->_block->assign('_type', strtolower($this->getType())) diff --git a/app/code/core/Mage/Core/Model/Email/Queue.php b/app/code/core/Mage/Core/Model/Email/Queue.php index 53962e00261..2448715e02e 100644 --- a/app/code/core/Mage/Core/Model/Email/Queue.php +++ b/app/code/core/Mage/Core/Model/Email/Queue.php @@ -80,7 +80,7 @@ protected function _construct() /** * Save bind recipients to message * - * {@inheritDoc} + * @inheritDoc */ protected function _afterSave() { @@ -91,7 +91,7 @@ protected function _afterSave() /** * Validate recipients before saving * - * {@inheritDoc} + * @inheritDoc */ protected function _beforeSave() { @@ -188,14 +188,12 @@ public function getRecipients() */ public function send() { - /** @var Mage_Core_Model_Resource_Email_Queue_Collection $collection */ $collection = Mage::getModel('core/email_queue')->getCollection() ->addOnlyForSendingFilter() ->setPageSize(self::MESSAGES_LIMIT_PER_CRON_RUN) ->setCurPage(1) ->load(); - ini_set('SMTP', Mage::getStoreConfig('system/smtp/host')); ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port')); diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index de44a5494f1..cc1a3440fe5 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -125,7 +125,7 @@ public function getMail() * Declare template processing filter * * @param Varien_Filter_Template $filter - * @return Mage_Core_Model_Email_Template + * @return $this */ public function setTemplateFilter(Varien_Filter_Template $filter) { @@ -152,7 +152,7 @@ public function getTemplateFilter() * Load template by code * * @param string $templateCode - * @return Mage_Core_Model_Email_Template + * @return $this */ public function loadByCode($templateCode) { @@ -216,7 +216,7 @@ public function loadDefault($templateId, $locale = null) */ public static function getDefaultTemplates() { - if(is_null(self::$_defaultTemplates)) { + if (is_null(self::$_defaultTemplates)) { self::$_defaultTemplates = Mage::getConfig()->getNode(self::XML_PATH_TEMPLATE_EMAIL)->asArray(); } @@ -480,10 +480,10 @@ public function send($email, $name = null, array $variables = array()) /** * Send transactional email to recipient * - * @param int $templateId - * @param string|array $sender sender information, can be declared as part of config path + * @param string|int $templateId + * @param array|string $sender sender information, can be declared as part of config path * @param string $email recipient email - * @param string $name recipient name + * @param array|string|null $name recipient name * @param array $vars variables which can be used in template * @param int|null $storeId * @@ -491,7 +491,7 @@ public function send($email, $name = null, array $variables = array()) * * @return $this */ - public function sendTransactional($templateId, $sender, $email, $name, $vars=array(), $storeId=null) + public function sendTransactional($templateId, $sender, $email, $name, $vars = array(), $storeId = null) { $this->setSentSuccess(false); if (($storeId === null) && $this->getDesignConfig()->getStore()) { @@ -536,7 +536,7 @@ public function getProcessedTemplateSubject(array $variables) { $processor = $this->getTemplateFilter(); - if(!$this->_preprocessFlag) { + if (!$this->_preprocessFlag) { $variables['this'] = $this; } @@ -649,7 +649,7 @@ protected function _beforeSave() if (empty($code)) { Mage::throwException(Mage::helper('core')->__('The template Name must not be empty.')); } - if($this->_getResource()->checkCodeUsage($this)) { + if ($this->_getResource()->checkCodeUsage($this)) { Mage::throwException(Mage::helper('core')->__('Duplicate Of Template Name')); } return parent::_beforeSave(); diff --git a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php index b4891853a4b..94ebe0278fd 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php @@ -150,8 +150,8 @@ protected function _getLogoAlt($store) /** * Add variables that are used by transactional emails and newsletter emails * - * @param $variables - * @param $storeId + * @param array $variables + * @param int $storeId * @return mixed */ protected function _addEmailVariables($variables, $storeId) @@ -191,7 +191,7 @@ protected function _addEmailVariables($variables, $storeId) * Merge HTML and CSS and returns HTML that has CSS styles applied "inline" to the HTML tags. This is necessary * in order to support all email clients. * - * @param $html + * @param string $html * @return string */ protected function _applyInlineCss($html) @@ -259,7 +259,7 @@ protected function _getCssFileContent($filename) * Accepts a path to a System Config setting that contains a comma-delimited list of files to load. Loads those * files and then returns the concatenated content. * - * @param $configPath + * @param string $configPath * @return string */ protected function _getCssByConfig($configPath) diff --git a/app/code/core/Mage/Core/Model/Encryption.php b/app/code/core/Mage/Core/Model/Encryption.php index 3f75d24002a..ff786276803 100644 --- a/app/code/core/Mage/Core/Model/Encryption.php +++ b/app/code/core/Mage/Core/Model/Encryption.php @@ -100,7 +100,7 @@ public function validateHash($password, $hash) case 1: return hash_equals($this->hash($password), $hash); case 2: - return hash_equals($this->hash($hashArr[1] . $password), $hashArr[0]); + return hash_equals($this->hash($hashArr[1] . $password), $hashArr[0]); } Mage::throwException('Invalid hash.'); } diff --git a/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php b/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php index 31c25a76973..c6efa96e7ce 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php @@ -95,7 +95,7 @@ public function prepareStorage() /** * Specify connection name * - * @param $connectionName + * @param string $connectionName * @return $this */ public function setConnectionName($connectionName) diff --git a/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php b/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php index ec2e0db9796..69078042fd0 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php @@ -126,7 +126,7 @@ public function getParentId() * Create directories recursively * * @param string $path - * @return $this + * @return Mage_Core_Model_File_Storage_Directory_Database */ public function createRecursive($path) { diff --git a/app/code/core/Mage/Core/Model/File/Storage/File.php b/app/code/core/Mage/Core/Model/File/Storage/File.php index 12a02fec363..14943d44a66 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/File/Storage/File.php @@ -251,7 +251,7 @@ public function saveDir($dir) * * @param array|Mage_Core_Model_File_Storage_Database $file * @param bool $overwrite - * @return bool|int + * @return bool */ public function saveFile($file, $overwrite = true) { diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php index 6b92fcd0609..0a90db1bfe2 100644 --- a/app/code/core/Mage/Core/Model/Layout.php +++ b/app/code/core/Mage/Core/Model/Layout.php @@ -79,7 +79,7 @@ class Mage_Core_Model_Layout extends Varien_Simplexml_Config * * @param array $data */ - public function __construct($data=array()) + public function __construct($data = array()) { $this->_elementClass = Mage::getConfig()->getModelClassName('core/layout_element'); $this->setXml(simplexml_load_string('', $this->_elementClass)); @@ -188,7 +188,7 @@ public function generateXml() * * @param Mage_Core_Model_Layout_Element|null $parent */ - public function generateBlocks($parent=null) + public function generateBlocks($parent = null) { if (empty($parent)) { $parent = $this->getNode(); @@ -324,7 +324,11 @@ protected function _generateAction($node, $parent) * if there is no helper we hope that this is assoc array */ $arr = array(); - foreach($arg as $subkey => $value) { + /** + * @var string $subkey + * @var Mage_Core_Model_Layout_Element $value + */ + foreach ($arg as $subkey => $value) { $arr[(string)$subkey] = $value->asArray(); } if (!empty($arr)) { @@ -430,7 +434,7 @@ public function unsetBlock($name) * @param array $attributes * @return Mage_Core_Block_Abstract|false */ - public function createBlock($type, $name='', array $attributes = array()) + public function createBlock($type, $name = '', array $attributes = array()) { try { $block = $this->_getBlockInstance($type, $attributes); @@ -478,7 +482,7 @@ public function addBlock($block, $blockName) * @param array $attributes * @return Mage_Core_Block_Abstract */ - protected function _getBlockInstance($block, array $attributes=array()) + protected function _getBlockInstance($block, array $attributes = array()) { if (is_string($block)) { if (strpos($block, '/')!==false) { @@ -496,7 +500,6 @@ protected function _getBlockInstance($block, array $attributes=array()) return $block; } - /** * Retrieve all blocks from registry as array * @@ -529,7 +532,7 @@ public function getBlock($name) * @param string $method * @return $this */ - public function addOutputBlock($blockName, $method='toHtml') + public function addOutputBlock($blockName, $method = 'toHtml') { //$this->_output[] = array($blockName, $method); $this->_output[$blockName] = array($blockName, $method); diff --git a/app/code/core/Mage/Core/Model/Layout/Element.php b/app/code/core/Mage/Core/Model/Layout/Element.php index dd27bc0a45a..09817516dcc 100644 --- a/app/code/core/Mage/Core/Model/Layout/Element.php +++ b/app/code/core/Mage/Core/Model/Layout/Element.php @@ -24,7 +24,6 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - class Mage_Core_Model_Layout_Element extends Varien_Simplexml_Element { /** @@ -82,7 +81,7 @@ public function getBlockName() } /** - * @param $args + * @param array $args * @return $this */ public function prepareBlock($args) @@ -105,7 +104,7 @@ public function prepareBlock($args) } /** - * @param $args + * @param array $args * @return $this */ public function prepareReference($args) @@ -114,7 +113,7 @@ public function prepareReference($args) } /** - * @param $args + * @param array $args * @return $this */ public function prepareAction($args) @@ -126,7 +125,7 @@ public function prepareAction($args) } /** - * @param $args + * @param array $args * @return $this */ public function prepareActionArgument($args) diff --git a/app/code/core/Mage/Core/Model/Layout/Update.php b/app/code/core/Mage/Core/Model/Layout/Update.php index 3bf21454441..94e15d336f5 100644 --- a/app/code/core/Mage/Core/Model/Layout/Update.php +++ b/app/code/core/Mage/Core/Model/Layout/Update.php @@ -249,10 +249,10 @@ public function saveCache() Mage::app()->saveCache($hash, $this->getCacheId(), $tags, null); // Only save actual XML to cache if it doesn't already exist - if ( ! Mage::app()->getCache()->test(self::XML_KEY_PREFIX . $hash)) { + if (! Mage::app()->getCache()->test(self::XML_KEY_PREFIX . $hash)) { Mage::app()->saveCache($str, self::XML_KEY_PREFIX . $hash, $tags, null); } - return TRUE; + return true; } /** @@ -261,7 +261,7 @@ public function saveCache() * @param array|string $handles * @return $this */ - public function load($handles=array()) + public function load($handles = array()) { if (is_string($handles)) { $handles = array($handles); diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index d10ab76fed1..fba252f319c 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -233,7 +233,7 @@ public function getTranslatedOptionLocales() * @param bool $translatedName translation flag * @return array */ - protected function _getOptionLocales($translatedName=false) + protected function _getOptionLocales($translatedName = false) { $options = array(); $zendLocales = $this->getLocale()->getLocaleList(); @@ -292,7 +292,7 @@ public function getOptionTimezones() $options= array(); $zones = $this->getTranslationList('windowstotimezone'); ksort($zones); - foreach ($zones as $code=>$name) { + foreach ($zones as $code => $name) { $name = trim($name); $zonesList = explode(' ', $code); if (count($zonesList) == 1) { @@ -344,7 +344,7 @@ public function getOptionCountries() $options = array(); $countries = $this->getCountryTranslationList(); - foreach ($countries as $code=>$name) { + foreach ($countries as $code => $name) { $options[] = array( 'label' => $name, 'value' => $code, @@ -364,7 +364,7 @@ public function getOptionCurrencies() $options = array(); $allowed = $this->getAllowCurrencies(); - foreach ($currencies as $name=>$code) { + foreach ($currencies as $name => $code) { if (!in_array($code, $allowed)) { continue; } @@ -386,7 +386,7 @@ public function getOptionAllCurrencies() { $currencies = $this->getTranslationList('currencytoname'); $options = array(); - foreach ($currencies as $name=>$code) { + foreach ($currencies as $name => $code) { $options[] = array( 'label' => $name, 'value' => $code, @@ -450,7 +450,7 @@ public function getAllowCurrencies() * @param string $type * @return string */ - public function getDateFormat($type=null) + public function getDateFormat($type = null) { return preg_replace('/(?getTranslation($type, 'date')); } @@ -475,7 +475,7 @@ public function getDateFormatWithLongYear() * @param string $type * @return string */ - public function getTimeFormat($type=null) + public function getTimeFormat($type = null) { return $this->getTranslation($type, 'time'); } @@ -545,13 +545,13 @@ public function date($date = null, $part = null, $locale = null, $useTimezone = /** * Create Zend_Date object with date converted to store timezone and store Locale * - * @param mixed $store Information about store + * @param null|string|bool|int|Mage_Core_Model_Store $store Information about store * @param string|integer|Zend_Date|array|null $date date in UTC * @param boolean $includeTime flag for including time to date * @param string|null $format * @return Zend_Date */ - public function storeDate($store=null, $date=null, $includeTime=false, $format = null) + public function storeDate($store = null, $date = null, $includeTime = false, $format = null) { $timezone = Mage::app()->getStore($store)->getConfig(self::XML_PATH_DEFAULT_TIMEZONE); $date = new Zend_Date($date, $format, $this->getLocale()); @@ -575,7 +575,7 @@ public function storeDate($store=null, $date=null, $includeTime=false, $format = * @param null|string $format * @return Zend_Date */ - public function utcDate($store=null, $date, $includeTime = false, $format = null) + public function utcDate($store = null, $date, $includeTime = false, $format = null) { $dateObj = $this->storeDate($store, $date, $includeTime); $dateObj->set($date, $format); @@ -590,7 +590,7 @@ public function utcDate($store=null, $date, $includeTime = false, $format = null * @param mixed $store * @return int */ - public function storeTimeStamp($store=null) + public function storeTimeStamp($store = null) { $timezone = Mage::app()->getStore($store)->getConfig(self::XML_PATH_DEFAULT_TIMEZONE); $currentTimezone = @date_default_timezone_get(); @@ -700,7 +700,7 @@ public function getJsPriceFormat() $symbols = Zend_Locale_Data::getList($this->getLocaleCode(), 'symbols'); $pos = strpos($format, ';'); - if ($pos !== false){ + if ($pos !== false) { $format = substr($format, 0, $pos); } $format = preg_replace("/[^0\#\.,]/", "", $format); @@ -714,7 +714,7 @@ public function getJsPriceFormat() $requiredPrecision = $totalPrecision; $t = substr($format, $decimalPoint); $pos = strpos($t, '#'); - if ($pos !== false){ + if ($pos !== false) { $requiredPrecision = strlen($t) - $pos - $totalPrecision; } $group = 0; @@ -799,7 +799,7 @@ public function getTranslation($value = null, $path = null) /** * Replace all yy date format to yyyy * - * @param $currentFormat + * @param string $currentFormat * @return mixed */ protected function _convertYearTwoDigitTo4($currentFormat) diff --git a/app/code/core/Mage/Core/Model/Log/Adapter.php b/app/code/core/Mage/Core/Model/Log/Adapter.php index 90c758f46e9..a27a636834d 100644 --- a/app/code/core/Mage/Core/Model/Log/Adapter.php +++ b/app/code/core/Mage/Core/Model/Log/Adapter.php @@ -96,7 +96,7 @@ public function log($data = null) */ public function setData($key, $value = null) { - if(is_array($key)) { + if (is_array($key)) { $this->_data = $key; } else { $this->_data[$key] = $value; diff --git a/app/code/core/Mage/Core/Model/Message/Collection.php b/app/code/core/Mage/Core/Model/Message/Collection.php index d21c1d9fa24..908968fbd49 100644 --- a/app/code/core/Mage/Core/Model/Message/Collection.php +++ b/app/code/core/Mage/Core/Model/Message/Collection.php @@ -138,7 +138,7 @@ public function deleteMessageByIdentifier($identifier) * @param string $type * @return array */ - public function getItems($type=null) + public function getItems($type = null) { if ($type) { return isset($this->_messages[$type]) ? $this->_messages[$type] : array(); @@ -193,7 +193,7 @@ public function toString() * @param string|null $type * @return int */ - public function count($type=null) + public function count($type = null) { if ($type) { if (isset($this->_messages[$type])) { diff --git a/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php b/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php index 0f90f509e41..06dc994526b 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Design/Theme/Collection.php @@ -28,7 +28,7 @@ * @method array getData(string $value) * @method $this setData(string $value, array $value) */ -class Mage_Core_Model_Mysql4_Design_Theme extends Varien_Directory_Collection +class Mage_Core_Model_Mysql4_Design_Theme_Collection extends Varien_Directory_Collection { /** * @return $this diff --git a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Abstract.php b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Abstract.php index fa8ef49d49a..91c676b1253 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Abstract.php +++ b/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Abstract.php @@ -26,7 +26,7 @@ /** - * Abstract storage resourse model + * Abstract storage resource model * * @category Mage * @package Mage_Core diff --git a/app/code/core/Mage/Core/Model/Resource.php b/app/code/core/Mage/Core/Model/Resource.php index 61787bbbbc8..95779316f9d 100644 --- a/app/code/core/Mage/Core/Model/Resource.php +++ b/app/code/core/Mage/Core/Model/Resource.php @@ -49,7 +49,7 @@ class Mage_Core_Model_Resource /** * Instances of actual connections * - * @var array + * @var Varien_Db_Adapter_Interface|false[] */ protected $_connections = array(); @@ -127,7 +127,7 @@ public function getConnection($name) /** * Get Instances of actual connections * - * @return array + * @return false[]|Varien_Db_Adapter_Interface */ public function getConnections() { @@ -344,7 +344,7 @@ public function cleanDbRow(&$row) { $zeroDate = $this->getConnection(self::DEFAULT_READ_RESOURCE)->getSuggestedZeroDate(); if (!empty($row) && is_array($row)) { - foreach ($row as $key=>&$value) { + foreach ($row as $key => &$value) { if (is_string($value) && $value === $zeroDate) { $value = ''; } @@ -388,7 +388,7 @@ public function getAutoUpdate() } /** - * @param $value + * @param mixed $value * @return $this */ public function setAutoUpdate($value) diff --git a/app/code/core/Mage/Core/Model/Resource/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Abstract.php index 46fc3fd14a2..414af02a2e7 100644 --- a/app/code/core/Mage/Core/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Abstract.php @@ -82,7 +82,7 @@ public function beginTransaction() /** * Subscribe some callback to transaction commit * - * @param callback $callback + * @param callable $callback * @return $this */ public function addCommitCallback($callback) @@ -136,9 +136,9 @@ public function rollBack() /** * Format date to internal format * - * @param string|Zend_Date $date + * @param string|Zend_Date|true|null $date * @param bool $includeTime - * @return string + * @return string|null */ public function formatDate($date, $includeTime = true) { @@ -221,7 +221,7 @@ protected function _prepareDataForTable(Varien_Object $object, $table) if (null !== $fieldValue) { $fieldValue = $this->_prepareTableValueForSave($fieldValue, $fields[$field]['DATA_TYPE']); $data[$field] = $this->_getWriteAdapter()->prepareColumnValue($fields[$field], $fieldValue); - } else if (!empty($fields[$field]['NULLABLE'])) { + } elseif (!empty($fields[$field]['NULLABLE'])) { $data[$field] = null; } } diff --git a/app/code/core/Mage/Core/Model/Resource/Config.php b/app/code/core/Mage/Core/Model/Resource/Config.php index ec3aa70d64c..71168d4b5e6 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config.php +++ b/app/code/core/Mage/Core/Model/Resource/Config.php @@ -107,7 +107,7 @@ public function loadToXml(Mage_Core_Model_Config $xmlConfig, $condition = null) // inherit default config values to all websites $extendSource = $xmlConfig->getNode('default'); - foreach ($websites as $id=>$w) { + foreach ($websites as $id => $w) { $websiteNode = $xmlConfig->getNode('websites/' . $w['code']); $websiteNode->extend($extendSource); } diff --git a/app/code/core/Mage/Core/Model/Resource/Config/Data.php b/app/code/core/Mage/Core/Model/Resource/Config/Data.php index 5350a983618..7b8bff8e7ef 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config/Data.php +++ b/app/code/core/Mage/Core/Model/Resource/Config/Data.php @@ -46,7 +46,7 @@ protected function _construct() * Convert array to comma separated value * * @param Mage_Core_Model_Config_Data $object - * {@inheritDoc} + * @inheritDoc */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { @@ -65,7 +65,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object) * Set id to object if exists configuration instead of throw exception * * @param Mage_Core_Model_Config_Data $object - * {@inheritDoc} + * @inheritDoc */ protected function _checkUnique(Mage_Core_Model_Abstract $object) { diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php index 4e77afa72e2..7e2c91bafed 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php @@ -171,20 +171,20 @@ protected function _setResource($connections, $tables = null) $this->_resources = Mage::getSingleton('core/resource'); if (is_array($connections)) { - foreach ($connections as $k=>$v) { + foreach ($connections as $k => $v) { $this->_connections[$k] = $this->_resources->getConnection($v); } - } else if (is_string($connections)) { + } elseif (is_string($connections)) { $this->_resourcePrefix = $connections; } if (is_null($tables) && is_string($connections)) { $this->_resourceModel = $this->_resourcePrefix; - } else if (is_array($tables)) { + } elseif (is_array($tables)) { foreach ($tables as $k => $v) { $this->_tables[$k] = $this->_resources->getTableName($v); } - } else if (is_string($tables)) { + } elseif (is_string($tables)) { $this->_resourceModel = $tables; } return $this; @@ -272,7 +272,7 @@ public function getTable($entityName) $modelEntity = $entityName; } $this->_tables[$cacheName] = $this->_resources->getTableName($modelEntity); - } else if (!empty($this->_resourceModel)) { + } elseif (!empty($this->_resourceModel)) { $entityName = sprintf('%s/%s', $this->_resourceModel, $entityName); if (!is_null($entitySuffix)) { $modelEntity = array($entityName, $entitySuffix); @@ -306,7 +306,7 @@ public function getValueTable($entityName, $valueType) * Get connection by name or type * * @param string $connectionName - * @return Varien_Db_Adapter_Interface + * @return Magento_Db_Adapter_Pdo_Mysql */ protected function _getConnection($connectionName) { @@ -327,7 +327,7 @@ protected function _getConnection($connectionName) /** * Retrieve connection for read data * - * @return Varien_Db_Adapter_Interface|Zend_Db_Adapter_Abstract + * @return Magento_Db_Adapter_Pdo_Mysql */ protected function _getReadAdapter() { @@ -342,7 +342,7 @@ protected function _getReadAdapter() /** * Retrieve connection for write data * - * @return Varien_Db_Adapter_Interface|Zend_Db_Adapter_Abstract + * @return Magento_Db_Adapter_Pdo_Mysql */ protected function _getWriteAdapter() { @@ -669,7 +669,7 @@ protected function _checkUnique(Mage_Core_Model_Abstract $object) } if (!empty($existent)) { - if (count($existent) == 1 ) { + if (count($existent) == 1) { $error = Mage::helper('core')->__('%s already exists.', $existent[0]); } else { $error = Mage::helper('core')->__('%s already exist.', implode(', ', $existent)); @@ -761,7 +761,7 @@ protected function _serializeFields(Mage_Core_Model_Abstract $object) * Retrieve table checksum * * @param string|array $table - * @return int|array + * @return array|false */ public function getChecksum($table) { diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php index 1a4cf16fa38..650d19cca91 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php @@ -351,7 +351,7 @@ public function addExpressionFieldToSelect($alias, $expression, $fields) } $fullExpression = $expression; - foreach ($fields as $fieldKey=>$fieldItem) { + foreach ($fields as $fieldKey => $fieldItem) { $fullExpression = str_replace('{{' . $fieldKey . '}}', $fieldItem, $fullExpression); } @@ -651,7 +651,6 @@ protected function _afterLoad() */ public function save() { - /** @var Varien_Object $item */ foreach ($this->getItems() as $item) { $item->save(); } diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Queue.php b/app/code/core/Mage/Core/Model/Resource/Email/Queue.php index 0b9e40e4a3d..46bb572038d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Queue.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Queue.php @@ -38,7 +38,7 @@ protected function _construct() * Load recipients, unserialize message parameters * * @param Mage_Core_Model_Email_Queue $object - * {@inheritDoc} + * @inheritDoc */ protected function _afterLoad(Mage_Core_Model_Abstract $object) { @@ -51,7 +51,7 @@ protected function _afterLoad(Mage_Core_Model_Abstract $object) * Prepare object data for saving * * @param Mage_Core_Model_Email_Queue $object - * {@inheritDoc} + * @inheritDoc */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Template.php b/app/code/core/Mage/Core/Model/Resource/Email/Template.php index 012e81cccf8..7a1506e38e1 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Template.php @@ -96,7 +96,7 @@ public function checkCodeUsage(Mage_Core_Model_Email_Template $template) * Set template type, added at and modified at time * * @param Mage_Core_Model_Email_Template $object - * {@inheritDoc} + * @inheritDoc */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php index b198d6e3435..efe0ab2f090 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php @@ -192,7 +192,7 @@ public function saveDir($dir) public function saveFile($filePath, $content, $overwrite = false) { $filename = basename($filePath); - $path = $this->getMediaBaseDirectory() . DS . str_replace('/', DS ,dirname($filePath)); + $path = $this->getMediaBaseDirectory() . DS . str_replace('/', DS, dirname($filePath)); if (!is_dir($path)) { @mkdir($path, 0777, true); diff --git a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php index cebce5adee6..6cd9cf9f733 100644 --- a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php @@ -292,7 +292,7 @@ public function prepareColumnsList(Varien_Db_Select $select, $groupByCondition = throw new Zend_Db_Exception("Can't prepare expression when tableName is instance of Zend_Db_Expr"); } $tableColumns = $this->_getReadAdapter()->describeTable($tables[$correlationName]['tableName']); - foreach(array_keys($tableColumns) as $col) { + foreach (array_keys($tableColumns) as $col) { $preparedColumns[strtoupper($col)] = array($correlationName, $col, null); } } else { @@ -331,7 +331,7 @@ public function addGroupConcatColumn($select, $fieldAlias, $fields, $groupConcat } $separator = ''; if ($groupConcatDelimiter) { - $separator = sprintf(" SEPARATOR '%s'", $groupConcatDelimiter); + $separator = sprintf(" SEPARATOR '%s'", $groupConcatDelimiter); } $select->columns(array($fieldAlias => new Zend_Db_Expr(sprintf('GROUP_CONCAT(%s%s)', $fieldExpr, $separator)))); diff --git a/app/code/core/Mage/Core/Model/Resource/Iterator.php b/app/code/core/Mage/Core/Model/Resource/Iterator.php index bef52b38449..4b483ae0014 100644 --- a/app/code/core/Mage/Core/Model/Resource/Iterator.php +++ b/app/code/core/Mage/Core/Model/Resource/Iterator.php @@ -40,7 +40,7 @@ class Mage_Core_Model_Resource_Iterator extends Varien_Object * @param Varien_Db_Adapter_Interface $adapter * @return $this */ - public function walk($query, array $callbacks, array $args=array(), $adapter = null) + public function walk($query, array $callbacks, array $args = array(), $adapter = null) { $stmt = $this->_getStatement($query, $adapter); $args['idx'] = 0; diff --git a/app/code/core/Mage/Core/Model/Resource/Setup.php b/app/code/core/Mage/Core/Model/Resource/Setup.php index 057e9053594..d85c9eee098 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup.php @@ -151,7 +151,7 @@ public function __construct($resourceName) /** * Get connection object * - * @return Varien_Db_Adapter_Interface + * @return Varien_Db_Adapter_Interface|Varien_Db_Adapter_Pdo_Mysql */ public function getConnection() { @@ -282,9 +282,9 @@ public function applyDataUpdates() $configVer = (string)$this->_moduleConfig->version; if ($dataVer !== false) { $status = version_compare($configVer, $dataVer); - if ($status == self::VERSION_COMPARE_GREATER) { - $this->_upgradeData($dataVer, $configVer); - } + if ($status == self::VERSION_COMPARE_GREATER) { + $this->_upgradeData($dataVer, $configVer); + } } elseif ($configVer) { $this->_installData($configVer); } @@ -312,7 +312,7 @@ public function applyUpdates() // Module is installed if ($dbVer !== false) { $status = version_compare($configVer, $dbVer); - switch ($status) { + switch ($status) { case self::VERSION_COMPARE_LOWER: $this->_rollbackResourceDb($configVer, $dbVer); break; @@ -321,8 +321,8 @@ public function applyUpdates() break; default: return true; - break; - } + break; + } } elseif ($configVer) { $this->_installResourceDb($configVer); } @@ -492,7 +492,7 @@ protected function _getAvailableDbFiles($actionType, $fromVersion, $toVersion) $matches = array(); if (preg_match($regExpDb, $file, $matches)) { $dbFiles[$matches[1]] = $filesDir . DS . $file; - } else if (preg_match($regExpType, $file, $matches)) { + } elseif (preg_match($regExpType, $file, $matches)) { $typeFiles[$matches[1]] = $filesDir . DS . $file; } } @@ -718,7 +718,7 @@ protected function _getModifySqlFiles($actionType, $fromVersion, $toVersion, $ar * @param string|integer $parentId * @return mixed|boolean */ - public function getTableRow($table, $idField, $id, $field=null, $parentField=null, $parentId=0) + public function getTableRow($table, $idField, $id, $field = null, $parentField = null, $parentId = 0) { if (strpos($table, '/') !== false) { $table = $this->getTable($table); @@ -751,7 +751,7 @@ public function getTableRow($table, $idField, $id, $field=null, $parentField=nul * * @param string $table * @param string $idField - * @param string|int $id + * @param int|string $id * @param null|string $parentField * @param int|string $parentId * @return $this @@ -871,7 +871,7 @@ public function tableExists($table) * @return $this * @deprecated since 1.4.0.1 */ - public function addConfigField($path, $label, array $data=array(), $default=null) + public function addConfigField($path, $label, array $data = array(), $default = null) { return $this; } @@ -886,7 +886,7 @@ public function addConfigField($path, $label, array $data=array(), $default=null * @param int $inherit * @return $this */ - public function setConfigData($path, $value, $scope = 'default', $scopeId = 0, $inherit=0) + public function setConfigData($path, $value, $scope = 'default', $scopeId = 0, $inherit = 0) { $table = $this->getTable('core/config_data'); // this is a fix for mysql 4.1 diff --git a/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php b/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php index 01c662a9023..21f49df3f8d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php @@ -51,7 +51,7 @@ class Mage_Core_Model_Resource_Setup_Query_Modifier /** * Inits query modifier * - * @param Varien_Db_Adapter_Pdo_Mysql $args + * @param Varien_Db_Adapter_Pdo_Mysql|array $args * @return void */ public function __construct($args) diff --git a/app/code/core/Mage/Core/Model/Resource/Store.php b/app/code/core/Mage/Core/Model/Resource/Store.php index 86ff5beda0a..0059f5a01e2 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store.php +++ b/app/code/core/Mage/Core/Model/Resource/Store.php @@ -60,7 +60,7 @@ protected function _initUniqueFields() * Check store code before save * * @param Mage_Core_Model_Store $model - * {@inheritDoc} + * @inheritDoc */ protected function _beforeSave(Mage_Core_Model_Abstract $model) { @@ -77,7 +77,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $model) * Update Store Group data after save store * * @param Mage_Core_Model_Store $object - * {@inheritDoc} + * @inheritDoc */ protected function _afterSave(Mage_Core_Model_Abstract $object) { @@ -92,7 +92,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) * Remove core configuration data after delete store * * @param Mage_Core_Model_Store $model - * {@inheritDoc} + * @inheritDoc */ protected function _afterDelete(Mage_Core_Model_Abstract $model) { diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Group.php b/app/code/core/Mage/Core/Model/Resource/Store/Group.php index 77a686367c4..8264b5e9d35 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Group.php @@ -47,7 +47,7 @@ protected function _construct() * Update default store group for website * * @param Mage_Core_Model_Store_Group $model - * {@inheritDoc} + * @inheritDoc */ protected function _afterSave(Mage_Core_Model_Abstract $model) { diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php index 783bcfce96c..ae5675e4db1 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php @@ -102,7 +102,7 @@ public function _beforeLoad() if (!$this->getLoadDefault()) { $this->setWithoutDefaultFilter(); } - $this->addOrder('main_table.name', self::SORT_ORDER_ASC); + $this->addOrder('main_table.name', self::SORT_ORDER_ASC); return parent::_beforeLoad(); } diff --git a/app/code/core/Mage/Core/Model/Resource/Transaction.php b/app/code/core/Mage/Core/Model/Resource/Transaction.php index 7246efbdf40..561bfa45ab2 100644 --- a/app/code/core/Mage/Core/Model/Resource/Transaction.php +++ b/app/code/core/Mage/Core/Model/Resource/Transaction.php @@ -30,7 +30,7 @@ * @todo need collect conection by name * @category Mage * @package Mage_Core - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Core_Model_Resource_Transaction { @@ -113,7 +113,7 @@ protected function _runCallbacks() * @param string $alias * @return $this */ - public function addObject(Mage_Core_Model_Abstract $object, $alias='') + public function addObject(Mage_Core_Model_Abstract $object, $alias = '') { $this->_objects[] = $object; if (!empty($alias)) { @@ -125,7 +125,7 @@ public function addObject(Mage_Core_Model_Abstract $object, $alias='') /** * Add callback function which will be called before commit transactions * - * @param callback $callback + * @param callable $callback * @return $this */ public function addCommitCallback($callback) diff --git a/app/code/core/Mage/Core/Model/Resource/Translate.php b/app/code/core/Mage/Core/Model/Resource/Translate.php index cd29f75cb27..5496e5f57c0 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate.php @@ -119,7 +119,7 @@ public function getTranslationArrayByStrings(array $strings, $storeId = null) /** * Retrieve table checksum * - * @return int + * @return array|false */ public function getMainChecksum() { diff --git a/app/code/core/Mage/Core/Model/Resource/Translate/String.php b/app/code/core/Mage/Core/Model/Resource/Translate/String.php index 3cf96e186f4..01ef3032125 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate/String.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate/String.php @@ -43,6 +43,7 @@ protected function _construct() } /** + * @param Mage_Core_Model_Translate_String $object * @inheritDoc */ public function load(Mage_Core_Model_Abstract $object, $value, $field = null) @@ -79,7 +80,7 @@ protected function _getLoadSelect($field, $value, $object) * After translation loading * * @param Mage_Core_Model_Translate_String $object - * {@inheritDoc} + * @inheritDoc */ public function _afterLoad(Mage_Core_Model_Abstract $object) { @@ -94,7 +95,7 @@ public function _afterLoad(Mage_Core_Model_Abstract $object) /** * @param Mage_Core_Model_Translate_String $object - * {@inheritDoc} + * @inheritDoc */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { @@ -115,7 +116,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object) /** * @param Mage_Core_Model_Translate_String $object - * {@inheritDoc} + * @inheritDoc */ protected function _afterSave(Mage_Core_Model_Abstract $object) { diff --git a/app/code/core/Mage/Core/Model/Resource/Website.php b/app/code/core/Mage/Core/Model/Resource/Website.php index cb143a914bf..7111ca404eb 100644 --- a/app/code/core/Mage/Core/Model/Resource/Website.php +++ b/app/code/core/Mage/Core/Model/Resource/Website.php @@ -60,7 +60,7 @@ protected function _initUniqueFields() * Validate website code before object save * * @param Mage_Core_Model_Website $object - * {@inheritDoc} + * @inheritDoc */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { @@ -89,7 +89,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) * Remove core configuration data after delete website * * @param Mage_Core_Model_Website $model - * {@inheritDoc} + * @inheritDoc */ protected function _afterDelete(Mage_Core_Model_Abstract $model) { diff --git a/app/code/core/Mage/Core/Model/Session.php b/app/code/core/Mage/Core/Model/Session.php index 283751b8e6c..56bed91420f 100644 --- a/app/code/core/Mage/Core/Model/Session.php +++ b/app/code/core/Mage/Core/Model/Session.php @@ -38,6 +38,8 @@ * @method $this setCurrencyCode(string $value) * @method $this setFormData(array $value) * @method int getJustVotedPoll() + * @method array getOrderIds() + * @method $this setOrderIds(array $value) * @method $this setJustVotedPoll(int $value) * @method $this setLastUrl(string $value) */ diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php index afe5b5cfd74..6d7c603aacc 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract.php @@ -31,6 +31,12 @@ * @package Mage_Core * @author Magento Core Team * + * @method string getErrorMessage() + * @method $this setErrorMessage(string $value) + * @method $this unsErrorMessage() + * @method string getSuccessMessage() + * @method $this setSuccessMessage(string $value) + * @method $this unsSuccessMessage() * @method $this setMessages(Mage_Core_Model_Abstract|Mage_Core_Model_Message_Collection $value) */ class Mage_Core_Model_Session_Abstract extends Mage_Core_Model_Session_Abstract_Varien @@ -80,7 +86,7 @@ class Mage_Core_Model_Session_Abstract extends Mage_Core_Model_Session_Abstract_ * @param string $sessionName * @return $this */ - public function init($namespace, $sessionName=null) + public function init($namespace, $sessionName = null) { parent::init($namespace, $sessionName); $this->addHost(true); @@ -205,7 +211,7 @@ public function getValidateHttpUserAgentSkip() * @param bool $clear * @return Mage_Core_Model_Message_Collection */ - public function getMessages($clear=false) + public function getMessages($clear = false) { if (!$this->getData('messages')) { $this->setMessages(Mage::getModel('core/message_collection')); @@ -225,7 +231,7 @@ public function getMessages($clear=false) * * @param Exception $exception * @param string $alternativeText - * @return Mage_Core_Model_Session_Abstract + * @return $this */ public function addException(Exception $exception, $alternativeText) { @@ -247,7 +253,7 @@ public function addException(Exception $exception, $alternativeText) * Adding new message to message collection * * @param Mage_Core_Model_Message_Abstract $message - * @return Mage_Core_Model_Session_Abstract + * @return $this */ public function addMessage(Mage_Core_Model_Message_Abstract $message) { @@ -260,7 +266,7 @@ public function addMessage(Mage_Core_Model_Message_Abstract $message) * Adding new error message * * @param string $message - * @return Mage_Core_Model_Session_Abstract + * @return $this */ public function addError($message) { @@ -272,7 +278,7 @@ public function addError($message) * Adding new warning message * * @param string $message - * @return Mage_Core_Model_Session_Abstract + * @return $this */ public function addWarning($message) { @@ -284,7 +290,7 @@ public function addWarning($message) * Adding new notice message * * @param string $message - * @return Mage_Core_Model_Session_Abstract + * @return $this */ public function addNotice($message) { @@ -296,7 +302,7 @@ public function addNotice($message) * Adding new success message * * @param string $message - * @return Mage_Core_Model_Session_Abstract + * @return $this */ public function addSuccess($message) { @@ -308,7 +314,7 @@ public function addSuccess($message) * Adding messages array to message collection * * @param array $messages - * @return Mage_Core_Model_Session_Abstract + * @return $this */ public function addMessages($messages) { @@ -324,7 +330,7 @@ public function addMessages($messages) * Adds messages array to message collection, but doesn't add duplicates to it * * @param array|string|Mage_Core_Model_Message_Abstract $messages - * @return Mage_Core_Model_Session_Abstract + * @return $this */ public function addUniqueMessages($messages) { @@ -340,7 +346,7 @@ public function addUniqueMessages($messages) foreach ($items as $item) { if ($item instanceof Mage_Core_Model_Message_Abstract) { $text = $item->getText(); - } else if (is_string($item)) { + } elseif (is_string($item)) { $text = $item; } else { continue; // Some unknown object, do not put it in already existing messages @@ -351,7 +357,7 @@ public function addUniqueMessages($messages) foreach ($messages as $message) { if ($message instanceof Mage_Core_Model_Message_Abstract) { $text = $message->getText(); - } else if (is_string($message)) { + } elseif (is_string($message)) { $text = $message; } else { $text = null; // Some unknown object, add it anyway @@ -373,9 +379,9 @@ public function addUniqueMessages($messages) /** * Specify session identifier * - * {@inheritDoc} + * @inheritDoc */ - public function setSessionId($id=null) + public function setSessionId($id = null) { if (is_null($id) && $this->useSid()) { $_queryParam = $this->getSessionIdQueryParam(); diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php index 8024224a6e8..d05394346ef 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php @@ -39,7 +39,7 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object const SECURE_COOKIE_CHECK_KEY = '_secure_cookie_check'; /** @var bool Flag true if session validator data has already been evaluated */ - protected static $isValidated = FALSE; + protected static $isValidated = false; /** * Map of session enabled hosts @@ -54,7 +54,7 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object * @param string $sessionName * @return $this */ - public function start($sessionName=null) + public function start($sessionName = null) { if (isset($_SESSION) && !$this->getSkipEmptySessionCheck()) { return $this; @@ -228,7 +228,7 @@ public function revalidateCookie() * @param string $sessionName * @return $this */ - public function init($namespace, $sessionName=null) + public function init($namespace, $sessionName = null) { if (!isset($_SESSION)) { $this->start($sessionName); @@ -252,7 +252,7 @@ public function init($namespace, $sessionName=null) * @param bool $clear * @return mixed */ - public function getData($key='', $clear = false) + public function getData($key = '', $clear = false) { $data = parent::getData($key); if ($clear && isset($this->_data[$key])) { @@ -277,7 +277,7 @@ public function getSessionId() * @param string $id * @return $this */ - public function setSessionId($id=null) + public function setSessionId($id = null) { if (!is_null($id) && preg_match('#^[0-9a-zA-Z,-]+$#', $id)) { session_id($id); @@ -459,7 +459,7 @@ protected function _validate() { $sessionData = $_SESSION[self::VALIDATOR_KEY]; $validatorData = $this->getValidatorData(); - self::$isValidated = TRUE; // Only validate once since the validator data is the same for every namespace + self::$isValidated = true; // Only validate once since the validator data is the same for every namespace if ($this->useValidateRemoteAddr() && $sessionData[self::VALIDATOR_REMOTE_ADDR_KEY] != $validatorData[self::VALIDATOR_REMOTE_ADDR_KEY]) { diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php b/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php index f6830e720a1..10fc5f2f883 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php @@ -131,7 +131,7 @@ public function setData($key, $value = '', $isChanged = false) * @param bool $clear * @return mixed */ - public function getData($var=null, $clear=false) + public function getData($var = null, $clear = false) { if (!$this->_namespace->data) { $this->_namespace->data = new Varien_Object(); diff --git a/app/code/core/Mage/Core/Model/Session/Exception.php b/app/code/core/Mage/Core/Model/Session/Exception.php index dcf23f7b5e8..74efc5ef6d9 100644 --- a/app/code/core/Mage/Core/Model/Session/Exception.php +++ b/app/code/core/Mage/Core/Model/Session/Exception.php @@ -35,4 +35,6 @@ * @author Magento Core Team */ class Mage_Core_Model_Session_Exception extends Mage_Core_Exception -{} +{ + +} diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 095bd5b8832..1609faf97d4 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -29,6 +29,8 @@ * * @method Mage_Core_Model_Resource_Store _getResource() * @method Mage_Core_Model_Resource_Store getResource() + * @method Mage_Core_Model_Resource_Store_Collection getCollection() + * * @method $this setCode(string $value) * @method $this setGroupId(int $value) * @method string getHomeUrl() @@ -38,11 +40,14 @@ * @method string getLanguageCode() * @method string getLocaleCode() * @method $this setName(string $value) + * @method $thissetRootCategoryPath(string $value) + * @method $this setRootCategory(Mage_Catalog_Model_Category $value) * @method int getSortOrder() * @method $this setSortOrder(int $value) * @method int getStoreId() * @method $this setStoreId(int $value) * @method $this setWebsiteId(int $value) + * @method string getRootCategoryPath() * * @category Mage * @package Mage_Core @@ -749,8 +754,10 @@ public function isAdminUrlSecure() public function isFrontUrlSecure() { if ($this->_isFrontSecure === null) { - $this->_isFrontSecure = Mage::getStoreConfigFlag(Mage_Core_Model_Url::XML_PATH_SECURE_IN_FRONT, - $this->getId()); + $this->_isFrontSecure = Mage::getStoreConfigFlag( + Mage_Core_Model_Url::XML_PATH_SECURE_IN_FRONT, + $this->getId() + ); } return $this->_isFrontSecure; } @@ -1074,7 +1081,7 @@ public function getGroup() /** * Retrieve website identifier * - * @return string|int|null + * @return int|string|null */ public function getWebsiteId() { @@ -1084,7 +1091,7 @@ public function getWebsiteId() /** * Retrieve group identifier * - * @return string|int|null + * @return int|string|null */ public function getGroupId() { @@ -1094,7 +1101,7 @@ public function getGroupId() /** * Retrieve default group identifier * - * @return string|int|null + * @return int|string|null */ public function getDefaultGroupId() { @@ -1125,7 +1132,8 @@ public function getCurrentUrl($fromStore = true) { $sidQueryParam = $this->_getSession()->getSessionIdQueryParam(); $requestString = Mage::getSingleton('core/url')->escape( - ltrim(Mage::app()->getRequest()->getRequestString(), '/')); + ltrim(Mage::app()->getRequest()->getRequestString(), '/') + ); $storeUrl = Mage::app()->getStore()->isCurrentlySecure() ? $this->getUrl('', array('_secure' => true)) diff --git a/app/code/core/Mage/Core/Model/Store/Api.php b/app/code/core/Mage/Core/Model/Store/Api.php index 15f4141637a..ae47983f27a 100644 --- a/app/code/core/Mage/Core/Model/Store/Api.php +++ b/app/code/core/Mage/Core/Model/Store/Api.php @@ -92,5 +92,4 @@ public function info($storeId) return $result; } - } diff --git a/app/code/core/Mage/Core/Model/Store/Exception.php b/app/code/core/Mage/Core/Model/Store/Exception.php index 08359b07827..9b058755ace 100644 --- a/app/code/core/Mage/Core/Model/Store/Exception.php +++ b/app/code/core/Mage/Core/Model/Store/Exception.php @@ -33,4 +33,6 @@ * @author Magento Core Team */ class Mage_Core_Model_Store_Exception extends Mage_Core_Exception -{} +{ + +} diff --git a/app/code/core/Mage/Core/Model/Store/Group.php b/app/code/core/Mage/Core/Model/Store/Group.php index 86eb0ac14e6..e90d864be03 100644 --- a/app/code/core/Mage/Core/Model/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Store/Group.php @@ -29,6 +29,8 @@ * * @method Mage_Core_Model_Resource_Store_Group _getResource() * @method Mage_Core_Model_Resource_Store_Group getResource() + * @method Mage_Core_Model_Resource_Store_Group_Collection getCollection() + * * @method $this setWebsiteId(int $value) * @method string getName() * @method $this setName(string $value) @@ -160,7 +162,7 @@ public function setStores($stores) /** * Retrieve new (not loaded) Store collection object with group filter * - * @return Mage_Core_Model_Mysql4_Store_Collection + * @return Mage_Core_Model_Resource_Store_Collection */ public function getStoreCollection() { @@ -260,7 +262,7 @@ public function getDefaultStoreByLocale($locale) /** * Retrieve list of stores with given locale * - * @param $locale + * @param string $locale * @return array */ public function getStoresByLocale($locale) diff --git a/app/code/core/Mage/Core/Model/Template.php b/app/code/core/Mage/Core/Model/Template.php index c5ca3be6a07..c16436f514c 100644 --- a/app/code/core/Mage/Core/Model/Template.php +++ b/app/code/core/Mage/Core/Model/Template.php @@ -55,7 +55,7 @@ abstract class Mage_Core_Model_Template extends Mage_Core_Model_Abstract /** * Configuration of emulated desing package. * - * @var Varien_Object|boolean + * @var Varien_Object */ protected $_emulatedDesignConfig = false; @@ -63,7 +63,7 @@ abstract class Mage_Core_Model_Template extends Mage_Core_Model_Abstract * Initial environment information * @see self::_applyDesignConfig() * - * @var Varien_Object|null + * @var Varien_Object */ protected $_initialEnvironmentInfo = null; @@ -107,7 +107,7 @@ protected function _cancelDesignConfig() */ protected function getDesignConfig() { - if(is_null($this->_designConfig)) { + if (is_null($this->_designConfig)) { $store = Mage::getDesign()->getStore(); $storeId = is_object($store) ? $store->getId() : $store; $this->_designConfig = new Varien_Object(array( @@ -137,7 +137,7 @@ public function setDesignConfig(array $config) * @param int|string $storeId * @param string $area */ - public function emulateDesign($storeId, $area=self::DEFAULT_DESIGN_AREA) + public function emulateDesign($storeId, $area = self::DEFAULT_DESIGN_AREA) { if ($storeId) { // save current design settings @@ -153,7 +153,6 @@ public function emulateDesign($storeId, $area=self::DEFAULT_DESIGN_AREA) /** * Revert to last design config, used before emulation - * */ public function revertDesign() { diff --git a/app/code/core/Mage/Core/Model/Translate.php b/app/code/core/Mage/Core/Model/Translate.php index 14c07b4057a..1b5edbdd685 100644 --- a/app/code/core/Mage/Core/Model/Translate.php +++ b/app/code/core/Mage/Core/Model/Translate.php @@ -56,7 +56,7 @@ class Mage_Core_Model_Translate /** * Translation object * - * @var Zend_Translate_Adapter + * @var Zend_Translate */ protected $_translate; @@ -134,7 +134,7 @@ public function init($area, $forceReload = false) $this->_data = array(); - foreach ($this->getModulesConfig() as $moduleName=>$info) { + foreach ($this->getModulesConfig() as $moduleName => $info) { $info = $info->asArray(); $this->_loadModuleTranslation($moduleName, $info['files'], $forceReload); } @@ -213,7 +213,7 @@ public function getConfig($key) * @param bool $forceReload * @return $this */ - protected function _loadModuleTranslation($moduleName, $files, $forceReload=false) + protected function _loadModuleTranslation($moduleName, $files, $forceReload = false) { foreach ($files as $file) { $file = $this->_getModuleFilePath($moduleName, $file); @@ -230,7 +230,7 @@ protected function _loadModuleTranslation($moduleName, $files, $forceReload=fals * @param bool $forceReload * @return $this */ - protected function _addData($data, $scope, $forceReload=false) + protected function _addData($data, $scope, $forceReload = false) { foreach ($data as $key => $value) { if ($key === $value) { @@ -238,7 +238,7 @@ protected function _addData($data, $scope, $forceReload=false) } $key = $this->_prepareDataString($key); $value = $this->_prepareDataString($value); - if ($scope && isset($this->_dataScope[$key]) && !$forceReload ) { + if ($scope && isset($this->_dataScope[$key]) && !$forceReload) { /** * Checking previos value */ @@ -381,7 +381,7 @@ public function getResource() /** * Retrieve translation object * - * @return Zend_Translate_Adapter + * @return Zend_Translate */ public function getTranslate() { @@ -445,7 +445,7 @@ public function translate($args) * @param bool $flag * @return $this */ - public function setTranslateInline($flag=null) + public function setTranslateInline($flag = null) { $this->_canUseInline = (bool) $flag; return $this; @@ -469,7 +469,7 @@ public function getTranslateInline() * @param string $localeCode * @return string */ - public function getTemplateFile($file, $type, $localeCode=null) + public function getTemplateFile($file, $type, $localeCode = null) { if (is_null($localeCode) || preg_match('/[^a-zA-Z_]/', $localeCode)) { $localeCode = $this->getLocale(); @@ -556,7 +556,7 @@ protected function _saveCache() /** * Check cache usage availability * - * @return bool + * @return false|array */ protected function _canUseCache() { diff --git a/app/code/core/Mage/Core/Model/Translate/Inline.php b/app/code/core/Mage/Core/Model/Translate/Inline.php index f56ceba53cb..4455180dd6d 100644 --- a/app/code/core/Mage/Core/Model/Translate/Inline.php +++ b/app/code/core/Mage/Core/Model/Translate/Inline.php @@ -177,7 +177,7 @@ public function processAjaxPost($translate) foreach ($translate as $t) { if (Mage::getDesign()->getArea() == 'adminhtml') { $storeId = 0; - } else if (empty($t['perstore'])) { + } elseif (empty($t['perstore'])) { $resource->deleteTranslate($t['original'], null, false); $storeId = 0; } else { @@ -202,7 +202,7 @@ public function stripInlineTranslations(&$body) foreach ($body as &$part) { $this->stripInlineTranslations($part); } - } else if (is_string($body)) { + } elseif (is_string($body)) { $body = preg_replace('#' . $this->_tokenRegex . '#', '$1', $body); } return $this; @@ -227,7 +227,7 @@ public function processResponseBody(&$body) foreach ($body as &$part) { $this->processResponseBody($part); } - } else if (is_string($body)) { + } elseif (is_string($body)) { $this->_content = $body; $this->_specialTags(); @@ -392,7 +392,7 @@ protected function _prepareTagAttributesForContent(&$content) $trAttr = ' data-translate=' . $quoteHtml . htmlspecialchars('[' . join(',', $trArr) . ']') . $quoteHtml; } - $tagHtml = substr_replace($tagHtml , $trAttr, strlen($tagMatch[1][0])+1, 1); + $tagHtml = substr_replace($tagHtml, $trAttr, strlen($tagMatch[1][0])+1, 1); $content = substr_replace($content, $tagHtml, $tagMatch[0][1], strlen($tagMatch[0][0])); } $nextTag = $tagMatch[0][1] + strlen($tagHtml); @@ -452,7 +452,7 @@ protected function _applySimpleTagsFormat($tagHtml, $tagName, $trArr) { return substr($tagHtml, 0, strlen($tagName) + 1) . ' data-translate=' - . $this->_getHtmlQuote() . htmlspecialchars( '[' . join(',', $trArr) . ']') + . $this->_getHtmlQuote() . htmlspecialchars('[' . join(',', $trArr) . ']') . $this->_getHtmlQuote() . substr($tagHtml, strlen($tagName) + 1); } @@ -516,10 +516,10 @@ protected function _translateTags(&$content, $tagsList, $formatCallback, $isNeed /** * Find end of tag * - * @param $body - * @param $tagName - * @param $from - * @return bool|int return false if end of tag is not found + * @param string $body + * @param string $tagName + * @param int $from + * @return false|int return false if end of tag is not found */ private function findEndOfTag($body, $tagName, $from) { diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index c067a659a68..346cf9bfa47 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -1076,7 +1076,7 @@ protected function _prepareSessionUrlWithParams($url, array $params) $sessionId = $session->getSessionIdForHost($url); if (Mage::app()->getUseSessionVar() && !$sessionId) { $this->setQueryParam('___SID', $this->getSecure() ? 'S' : 'U'); // Secure/Unsecure - } else if ($sessionId) { + } elseif ($sessionId) { $this->setQueryParam($session->getSessionIdQueryParam(), $sessionId); } return $this; diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Url/Rewrite.php index 579e78a9860..621d20542d2 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite.php @@ -29,6 +29,8 @@ * * @method Mage_Core_Model_Resource_Url_Rewrite _getResource() * @method Mage_Core_Model_Resource_Url_Rewrite getResource() + * @method Mage_Core_Model_Resource_Url_Rewrite_Collection getResourceCollection() + * * @method $this setStoreId(int $value) * @method int getCategoryId() * @method $this setCategoryId(int $value) @@ -127,7 +129,7 @@ public function loadByTags($tags) $loadTags = is_array($tags) ? $tags : explode(',', $tags); $search = $this->getResourceCollection(); - foreach ($loadTags as $k=>$t) { + foreach ($loadTags as $k => $t) { if (!is_numeric($k)) { $t = $k.'='.$t; } @@ -140,6 +142,7 @@ public function loadByTags($tags) $search->setPageSize(1)->load(); if ($search->getSize()>0) { + /** @var Mage_Core_Model_Url_Rewrite $rewrite */ foreach ($search as $rewrite) { $this->setData($rewrite->getData()); } @@ -169,7 +172,7 @@ public function addTag($tags) $addTags = is_array($tags) ? $tags : explode(',', $tags); - foreach ($addTags as $k=>$t) { + foreach ($addTags as $k => $t) { if (!is_numeric($k)) { $t = $k.'='.$t; } @@ -193,7 +196,7 @@ public function removeTag($tags) $removeTags = is_array($tags) ? $tags : explode(',', $tags); - foreach ($removeTags as $k=>$t) { + foreach ($removeTags as $k => $t) { if (!is_numeric($k)) { $t = $k.'='.$t; } @@ -216,7 +219,7 @@ public function removeTag($tags) * @throws Mage_Core_Model_Store_Exception * @deprecated since 1.7.0.2. Refactored and moved to Mage_Core_Controller_Request_Rewrite */ - public function rewrite(Zend_Controller_Request_Http $request=null, Zend_Controller_Response_Http $response=null) + public function rewrite(Zend_Controller_Request_Http $request = null, Zend_Controller_Response_Http $response = null) { if (!Mage::isInstalled()) { return false; @@ -329,7 +332,7 @@ protected function _getQueryString() $queryParams = array(); parse_str($_SERVER['QUERY_STRING'], $queryParams); $hasChanges = false; - foreach ($queryParams as $key=>$value) { + foreach ($queryParams as $key => $value) { if (substr($key, 0, 3) === '___') { unset($queryParams[$key]); $hasChanges = true; diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php index 6edae5aa895..70729e0dbe9 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php @@ -36,7 +36,7 @@ class Mage_Core_Model_Url_Rewrite_Request /** * Instance of request * - * @var Zend_Controller_Request_Http + * @var Mage_Core_Controller_Request_Http */ protected $_request; @@ -359,7 +359,7 @@ protected function _processRewriteUrl($url) * Retrieve router by name * * @param string $name - * @return Mage_Core_Controller_Varien_Router_Abstract|bool + * @return Mage_Core_Controller_Varien_Router_Abstract|false */ protected function _getRouter($name) { diff --git a/app/code/core/Mage/Core/Model/Website.php b/app/code/core/Mage/Core/Model/Website.php index f2d29b5b8a3..6ee6203be01 100644 --- a/app/code/core/Mage/Core/Model/Website.php +++ b/app/code/core/Mage/Core/Model/Website.php @@ -29,6 +29,8 @@ * * @method Mage_Core_Model_Resource_Website _getResource() * @method Mage_Core_Model_Resource_Website getResource() + * @method Mage_Core_Model_Resource_Website_Collection getCollection() + * * @method $this setCode(string $value) * @method string getName() * @method $this setName(string $value) @@ -40,6 +42,7 @@ * @method int getGroupId() * @method int getStoreId() * @method $this setStoreId(int $value) + * @method array getStoresIds() * @method bool hasWebsiteId() * @method int getWebsiteId() * @method bool hasDefaultGroupId() @@ -180,7 +183,7 @@ public function loadConfig($code) return $this; } if (is_numeric($code)) { - foreach (Mage::getConfig()->getNode('websites')->children() as $websiteCode=>$website) { + foreach (Mage::getConfig()->getNode('websites')->children() as $websiteCode => $website) { if ((int)$website->system->website->id==$code) { $code = $websiteCode; break; @@ -213,7 +216,7 @@ public function getConfig($path) } if ($config->hasChildren()) { $value = array(); - foreach ($config->children() as $k=>$v) { + foreach ($config->children() as $k => $v) { $value[$k] = $v; } } else { @@ -266,7 +269,7 @@ public function setGroups($groups) /** * Retrieve new (not loaded) Group collection object with website filter * - * @return Mage_Core_Model_Mysql4_Store_Group_Collection + * @return Mage_Core_Model_Resource_Store_Group_Collection */ public function getGroupCollection() { @@ -372,7 +375,7 @@ public function setStores($stores) /** * Retrieve new (not loaded) Store collection object with website filter * - * @return Mage_Core_Model_Mysql4_Store_Collection + * @return Mage_Core_Model_Resource_Store_Collection */ public function getStoreCollection() { diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index 466d80a79fc..bef6656ac4e 100644 --- a/app/code/core/Mage/Core/functions.php +++ b/app/code/core/Mage/Core/functions.php @@ -38,7 +38,7 @@ function mageUndoMagicQuotes($array, $topLevel = true) { $newArray = array(); - foreach($array as $key => $value) { + foreach ($array as $key => $value) { if (!$topLevel) { $newKey = stripslashes($key); if ($newKey!==$key) { @@ -92,7 +92,7 @@ function __() * @param string $srcSep * @return string */ -function uc_words($str, $destSep='_', $srcSep='_') +function uc_words($str, $destSep = '_', $srcSep = '_') { return str_replace(' ', $destSep, ucwords(str_replace($srcSep, ' ', $str))); } @@ -186,7 +186,7 @@ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) $errorMessage = ''; - switch($errno){ + switch ($errno) { case E_ERROR: $errorMessage .= "Error"; break; @@ -372,7 +372,7 @@ function is_dir_writeable($dir) return false; } -if ( !function_exists('sys_get_temp_dir') ) { +if (!function_exists('sys_get_temp_dir')) { // Based on http://www.phpit.net/ // article/creating-zip-tar-archives-dynamically-php/2/ /** @@ -381,22 +381,22 @@ function is_dir_writeable($dir) function sys_get_temp_dir() { // Try to get from environment variable - if ( !empty($_ENV['TMP']) ) { - return realpath( $_ENV['TMP'] ); - } else if ( !empty($_ENV['TMPDIR']) ) { - return realpath( $_ENV['TMPDIR'] ); - } else if ( !empty($_ENV['TEMP']) ) { - return realpath( $_ENV['TEMP'] ); + if (!empty($_ENV['TMP'])) { + return realpath($_ENV['TMP']); + } elseif (!empty($_ENV['TMPDIR'])) { + return realpath($_ENV['TMPDIR']); + } elseif (!empty($_ENV['TEMP'])) { + return realpath($_ENV['TEMP']); } else { // Try to use system's temporary directory // as random name shouldn't exist - $temp_file = tempnam( md5(uniqid(rand(), TRUE)), '' ); - if ( $temp_file ) { - $temp_dir = realpath( dirname($temp_file) ); - unlink( $temp_file ); + $temp_file = tempnam(md5(uniqid(rand(), true)), ''); + if ($temp_file) { + $temp_dir = realpath(dirname($temp_file)); + unlink($temp_file); return $temp_dir; } else { - return FALSE; + return false; } } } From 69a3d2c02ade267bf8b0b7b3e60cf6ccd913b214 Mon Sep 17 00:00:00 2001 From: sreichel Date: Fri, 22 May 2020 20:11:15 +0200 Subject: [PATCH 5/5] Minor fixes --- app/code/core/Mage/Core/Block/Template.php | 2 +- app/code/core/Mage/Core/Model/Cache.php | 2 +- app/code/core/Mage/Core/Model/Resource.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php index 912b10d8afe..46d8cc36a3d 100644 --- a/app/code/core/Mage/Core/Block/Template.php +++ b/app/code/core/Mage/Core/Block/Template.php @@ -86,7 +86,7 @@ protected function _construct() { parent::_construct(); - /** + /* * In case template was passed through constructor * we assign it to block's property _template * Mainly for those cases when block created diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index fb318e286ee..6a28a759186 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -529,7 +529,7 @@ public function saveOptions($options) * Check if cache can be used for specific data type * * @param string $typeCode - * @return false|array + * @return bool|array */ public function canUse($typeCode) { diff --git a/app/code/core/Mage/Core/Model/Resource.php b/app/code/core/Mage/Core/Model/Resource.php index f1299ff0639..3a872a989b7 100644 --- a/app/code/core/Mage/Core/Model/Resource.php +++ b/app/code/core/Mage/Core/Model/Resource.php @@ -49,7 +49,7 @@ class Mage_Core_Model_Resource /** * Instances of actual connections * - * @var Varien_Db_Adapter_Interface|false[] + * @var Varien_Db_Adapter_Interface[]|false */ protected $_connections = array(); @@ -127,7 +127,7 @@ public function getConnection($name) /** * Get Instances of actual connections * - * @return false[]|Varien_Db_Adapter_Interface + * @return Varien_Db_Adapter_Interface[]|false */ public function getConnections() {
Code ProfilerTimeCntEmallocRealMem
'.$name.''.number_format($sum,4).''.number_format($sum, 4).''.$count.''.number_format($emalloc).''.number_format($realmem).'