Skip to content

Commit

Permalink
OM PR 4363
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Nov 28, 2024
1 parent 812670f commit 0526330
Show file tree
Hide file tree
Showing 64 changed files with 140 additions and 381 deletions.
270 changes: 0 additions & 270 deletions .phpstan.baseline.neon

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ public function getValidateButton()
$optionsVarName = $this->getJsVariablePrefix() . 'VatParameters';
$beforeHtml = '<script type="text/javascript">var ' . $optionsVarName . ' = ' . $vatValidateOptions
. ';</script>';
$this->_validateButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setData([

/** @var Mage_Adminhtml_Block_Widget_Button $block */
$block = $this->getLayout()->createBlock('adminhtml/widget_button');
$this->_validateButton = $block->setData([
'label' => Mage::helper('customer')->__('Validate VAT Number'),
'before_html' => $beforeHtml,
'onclick' => 'order.validateVat(' . $optionsVarName . ')'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function getAddressId()
/**
* Return address object
*
* @return Mage_Customer_Model_Address
* @return Mage_Sales_Model_Quote_Address
*/
public function getAddress()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected function _getExtraJs($element, $tooltipsExist = false)
* Collapsed or expanded fieldset when page loaded?
*
* @param Varien_Data_Form_Element_Abstract $element
* @return int|bool
* @return int|false
*/
protected function _getCollapseState($element)
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget
/**
* Collection object
*
* @var Mage_Core_Model_Resource_Db_Collection_Abstract|Varien_Data_Collection_Db|null
* @var Varien_Data_Collection_Db|null
*/
protected $_collection = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function getOrderItem()
/**
* Retrieve Value HTML
*
* @param Mage_Sales_Model_Order_Item $item
* @param Mage_Sales_Model_Order_Invoice_Item $item
* @return string
*/
public function getValueHtml($item)
Expand All @@ -249,13 +249,13 @@ public function getValueHtml($item)
/**
* Can show price info for item
*
* @param Mage_Sales_Model_Order_Item $item
* @param Mage_Sales_Model_Order_Invoice_Item $item
* @return bool
*/
public function canShowPriceInfo($item)
{
if (($item->getOrderItem()->getParentItem() && $this->isChildCalculated())
|| (!$item->getOrderItem()->getParentItem() && !$this->isChildCalculated())
|| (!$item->getOrderItem()->getParentItem() && !$this->isChildCalculated())
) {
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Catalog/Block/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Mage_Catalog_Block_Navigation extends Mage_Core_Block_Template
/**
* Current category key
*
* @var string
* @var int|string
*/
protected $_currentCategoryKey;

Expand Down Expand Up @@ -92,7 +92,7 @@ public function getCacheKeyInfo()
/**
* Get current category key
*
* @return mixed
* @return int|string
*/
public function getCurrenCategoryKey()
{
Expand Down
6 changes: 4 additions & 2 deletions app/code/core/Mage/Catalog/Block/Product/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function getAddToCompareUrl($product)
* Gets minimal sales quantity
*
* @param Mage_Catalog_Model_Product $product
* @return int|null
* @return float|null
*/
public function getMinimalQty($product)
{
Expand Down Expand Up @@ -313,7 +313,9 @@ protected function _initReviewsHelperBlock()
return false;
}

$this->_reviewsHelperBlock = $this->getLayout()->createBlock('review/helper');
/** @var Mage_Review_Block_Helper $block */
$block = $this->getLayout()->createBlock('review/helper');
$this->_reviewsHelperBlock = $block;
}

return true;
Expand Down
8 changes: 4 additions & 4 deletions app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Core_Block_Template
/**
* List of available view types
*
* @var string
* @var array
*/
protected $_availableMode = [];

Expand Down Expand Up @@ -533,7 +533,7 @@ public function isModeActive($mode)
/**
* Retrieve availables view modes
*
* @return string
* @return array
*/
public function getModes()
{
Expand All @@ -548,7 +548,7 @@ public function getModes()
*/
public function setModes($modes)
{
if (!isset($this->_availableMode)) {
if (!$this->_availableMode) {
$this->_availableMode = $modes;
}
return $this;
Expand Down Expand Up @@ -647,7 +647,7 @@ public function getDefaultPerPageValue()
}
return Mage::getStoreConfig('catalog/frontend/grid_per_page');
}
return 0;
return '0';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Block/Product/New.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Mage_Catalog_Block_Product_New extends Mage_Catalog_Block_Product_Abstract
public const DEFAULT_PRODUCTS_COUNT = 10;

/**
* Products count
* @var int
*/
protected $_productsCount;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function getTotalNum()
public function getLastPageNum()
{
if ($this->_lastPage === null) {
$this->_lastPage = ceil($this->getCollectionSize() / $this->getLimit());
$this->_lastPage = (int) ceil($this->getCollectionSize() / $this->getLimit());
if ($this->_lastPage <= 0) {
$this->_lastPage = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ protected function _prepareLayout()
#[\Override]
public function getItemUrl($product)
{
$helper = Mage::helper('catalog/product');
/** @var Mage_Catalog_Helper_Product $helper */
$helper = Mage::helper('catalog/product');
return $helper->getProductUrl($product);
}
}
4 changes: 2 additions & 2 deletions app/code/core/Mage/Catalog/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Mage_Catalog_Helper_Data extends Mage_Core_Helper_Abstract
/**
* Breadcrumb Path cache
*
* @var string|array<string, array<string, string|null>>
* @var array<string, array<string, string|null>>
*/
protected $_categoryPath;

Expand Down Expand Up @@ -74,7 +74,7 @@ public function setStoreId($store)
* Return current category path or get it from current category
* and creating array of categories|product paths for breadcrumbs
*
* @return string
* @return array
*/
public function getBreadcrumbPath()
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Helper/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public function getSkipSaleableCheck()
* Gets minimal sales quantity
*
* @param Mage_Catalog_Model_Product $product
* @return int|null
* @return float|null
*/
public function getMinimalQty($product)
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ protected function _getTierPrices()

/**
* Default implementation. May be different for customer/guest/admin role.
*
* @return int|null
*/
protected function _getCustomerGroupId()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ protected function _filterStockData(&$stockData)
* Filter out fields if Use Config Settings option used
*
* @param array $data
* @param string $fields
* @param array $fields
*/
protected function _filterConfigValueUsed(&$data, $fields)
{
Expand Down
4 changes: 3 additions & 1 deletion app/code/core/Mage/Catalog/Model/Category/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ protected function _getRequestPath(Mage_Catalog_Model_Category $category)
public function getUrlInstance()
{
if ($this->_url === null) {
$this->_url = $this->_factory->getModel('core/url');
/** @var Mage_Core_Model_Url $model */
$model = $this->_factory->getModel('core/url');
$this->_url = $model;
}
return $this->_url;
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Design.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected function _apply($package, $theme)
* Apply custom design
*
* @param string $design
* @return null|false
* @return void|false
*/
public function applyCustomDesign($design)
{
Expand Down
16 changes: 12 additions & 4 deletions app/code/core/Mage/Catalog/Model/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ class Mage_Catalog_Model_Factory extends Mage_Core_Model_Factory
*/
public function getCategoryUrlRewriteHelper()
{
return $this->getHelper(
/** @var Mage_Catalog_Helper_Category_Url_Rewrite_Interface $model */
$model = $this->getHelper(
(string)$this->_config->getNode(self::XML_PATH_CATEGORY_URL_REWRITE_HELPER_CLASS)
);
return $model;
}

/**
Expand All @@ -54,9 +56,11 @@ public function getCategoryUrlRewriteHelper()
*/
public function getProductUrlRewriteHelper()
{
return $this->getHelper(
/** @var Mage_Catalog_Helper_Product_Url_Rewrite_Interface $model */
$model = $this->getHelper(
(string)$this->_config->getNode(self::XML_PATH_PRODUCT_URL_REWRITE_HELPER_CLASS)
);
return $model;
}

/**
Expand All @@ -66,9 +70,11 @@ public function getProductUrlRewriteHelper()
*/
public function getProductUrlInstance()
{
return $this->getModel(
/** @var Mage_Catalog_Model_Product_Url $model */
$model = $this->getModel(
(string)$this->_config->getNode(self::XML_PATH_PRODUCT_URL_MODEL)
);
return $model;
}

/**
Expand All @@ -78,8 +84,10 @@ public function getProductUrlInstance()
*/
public function getCategoryUrlInstance()
{
return $this->getModel(
/** @var Mage_Catalog_Model_Category_Url $model */
$model = $this->getModel(
(string)$this->_config->getNode(self::XML_PATH_CATEGORY_URL_MODEL)
);
return $model;
}
}
6 changes: 3 additions & 3 deletions app/code/core/Mage/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1888,8 +1888,8 @@ public function addOption(Mage_Catalog_Model_Product_Option $option)
/**
* Get option from options array of product by given option id
*
* @param int $optionId
* @return Mage_Catalog_Model_Product_Option | null
* @param string $optionId
* @return Mage_Catalog_Model_Product_Option|null
*/
public function getOptionById($optionId)
{
Expand Down Expand Up @@ -1987,7 +1987,7 @@ public function hasCustomOptions()
* Check availability display product in category
*
* @param int $categoryId
* @return bool
* @return string
*/
public function canBeShowInCategory($categoryId)
{
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Catalog/Model/Product/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public function delete($productId, $identifierType = null)
/**
* Get list of additional attributes which are not in default create/update list
*
* @param int $productType
* @param string $productType
* @param int $attributeSetId
* @return array
*/
Expand Down Expand Up @@ -424,7 +424,7 @@ public function getAdditionalAttributes($productType, $attributeSetId)
/**
* Check if product type exists
*
* @param int $productType
* @param string $productType
* @throw Mage_Api_Exception
*/
protected function _checkProductTypeExists($productType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected function _calcSelectionPrice($priceInfo, $productPrice)
/**
* @param array $values
* @param string $index
* @return bool
* @return array|false
*/
protected function _getValueByIndex($values, $index)
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Resource/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function deleteEntity(Mage_Core_Model_Abstract $object)
* Defines is Attribute used by super products
*
* @param int $attributeSet
* @return int
* @return false|string|null
*/
public function isUsedBySuperProducts(Mage_Core_Model_Abstract $object, $attributeSet = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @package Mage_Catalog
*
* @method Mage_Catalog_Model_Category getFirstItem()
* @method Mage_Catalog_Model_Category getItemById(int $value)
* @method Mage_Catalog_Model_Category getItemById(string $value)
* @method Mage_Catalog_Model_Category[] getItems()
*/
class Mage_Catalog_Model_Resource_Category_Collection extends Mage_Catalog_Model_Resource_Collection_Abstract
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Resource/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public function refreshIndex($product)
* if product parameter is null - idex will be refreshed for all products
*
* @param Mage_Core_Model_Store $store
* @param Mage_Catalog_Model_Product $product
* @param Mage_Catalog_Model_Product|array $product
* @throws Mage_Core_Exception
* @return $this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function loadByProduct(Mage_Catalog_Model_Product_Compare_Item $object, $
*
* @param int $customerId
* @param int $visitorId
* @return int
* @return false|string|null
*/
public function getCount($customerId, $visitorId)
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Resource/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ protected function _getCategoryEntityRow($entityId)
*
* @param array $category
* @param array $path
* @return string
* @return array
*/
protected function _getCategoryPath($category, $path = [])
{
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Catalog/Model/Resource/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function checkRequestPaths($paths, $storeId)
* Prepare rewrites for condition
*
* @param int $storeId
* @param int|array $categoryIds
* @param int|string|array|false $categoryIds
* @param int|array $productIds
* @return array
*/
Expand Down Expand Up @@ -560,7 +560,7 @@ public function saveProductAttribute(Varien_Object $product, $attributeCode, $ig
*
* @param string $attributeCode
* @param int|array $productIds
* @param string $storeId
* @param int|string $storeId
* @return array
*/
public function _getProductAttribute($attributeCode, $productIds, $storeId)
Expand Down
Loading

0 comments on commit 0526330

Please sign in to comment.