From 05263303846f8a6bb204623916f1d68f7fd4cbba Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano Date: Thu, 28 Nov 2024 20:35:11 +0000 Subject: [PATCH] OM PR 4363 OpenMage/magento-lts#4363 --- .phpstan.baseline.neon | 270 ------------------ .../Sales/Order/Address/Form/Renderer/Vat.php | 5 +- .../Sales/Order/Create/Shipping/Address.php | 2 +- .../Block/System/Config/Form/Fieldset.php | 2 +- .../core/Mage/Adminhtml/Block/Widget/Grid.php | 2 +- .../Model/Sales/Order/Pdf/Items/Abstract.php | 6 +- .../core/Mage/Catalog/Block/Navigation.php | 4 +- .../Mage/Catalog/Block/Product/Abstract.php | 6 +- .../Catalog/Block/Product/List/Toolbar.php | 8 +- .../core/Mage/Catalog/Block/Product/New.php | 2 +- .../Block/Product/Widget/Html/Pager.php | 2 +- .../Catalog/Block/Seo/Sitemap/Product.php | 2 +- app/code/core/Mage/Catalog/Helper/Data.php | 4 +- app/code/core/Mage/Catalog/Helper/Product.php | 2 +- .../Mage/Catalog/Model/Api2/Product/Rest.php | 2 + .../Model/Api2/Product/Rest/Admin/V1.php | 2 +- .../core/Mage/Catalog/Model/Category/Url.php | 4 +- app/code/core/Mage/Catalog/Model/Design.php | 2 +- app/code/core/Mage/Catalog/Model/Factory.php | 16 +- app/code/core/Mage/Catalog/Model/Product.php | 6 +- .../core/Mage/Catalog/Model/Product/Api.php | 4 +- .../Model/Product/Type/Configurable/Price.php | 2 +- .../Mage/Catalog/Model/Resource/Attribute.php | 2 +- .../Model/Resource/Category/Collection.php | 2 +- .../Mage/Catalog/Model/Resource/Product.php | 2 +- .../Model/Resource/Product/Compare/Item.php | 2 +- .../Mage/Catalog/Model/Resource/Setup.php | 2 +- .../core/Mage/Catalog/Model/Resource/Url.php | 4 +- .../Mage/CatalogIndex/Model/Data/Abstract.php | 4 +- .../Model/Resource/Data/Abstract.php | 2 +- .../CatalogInventory/Model/Stock/Item/Api.php | 2 +- .../Model/Stock/Item/Api/V2.php | 2 +- .../Model/Action/Index/Refresh.php | 8 +- .../CatalogSearch/Block/Advanced/Result.php | 2 +- app/code/core/Mage/Core/Model/Cache.php | 2 +- app/code/core/Mage/Core/Model/Cookie.php | 2 +- app/code/core/Mage/Core/Model/Store.php | 4 +- .../core/Mage/Customer/Model/Customer.php | 2 + .../core/Mage/Directory/Model/Currency.php | 2 +- .../Model/Resource/Entity/Attribute/Group.php | 2 +- .../Mage/Eav/Model/Resource/Form/Type.php | 4 +- .../Block/Adminhtml/Export/Filter.php | 7 +- .../Model/Export/Entity/Product.php | 3 +- .../ImportExport/Model/Import/Adapter/Csv.php | 8 +- .../Model/Import/Entity/Product.php | 2 +- app/code/core/Mage/Index/Model/Event.php | 4 +- .../core/Mage/Index/Model/Lock/Storage/Db.php | 2 +- app/code/core/Mage/Index/Model/Process.php | 2 +- app/code/core/Mage/Oauth/Helper/Data.php | 2 +- app/code/core/Mage/Page/Block/Html/Pager.php | 2 +- .../core/Mage/Paygate/Model/Authorizenet.php | 29 +- app/code/core/Mage/Payment/Helper/Data.php | 2 +- .../System/Config/Fieldset/Group.php | 2 +- app/code/core/Mage/Paypal/Model/Api/Nvp.php | 2 +- .../controllers/HostedproController.php | 5 +- .../Paypal/controllers/PayflowController.php | 5 +- .../controllers/PayflowadvancedController.php | 5 +- app/code/core/Mage/PaypalUk/Model/Api/Nvp.php | 2 +- .../Model/Resource/Rating/Collection.php | 2 +- .../Resource/Product/Lowstock/Collection.php | 2 +- .../Model/Resource/Wishlist/Collection.php | 2 +- .../core/Mage/Sales/Block/Order/Recent.php | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Usps.php | 14 +- lib/Varien/Data/Collection.php | 8 +- 64 files changed, 140 insertions(+), 381 deletions(-) diff --git a/.phpstan.baseline.neon b/.phpstan.baseline.neon index 2d4a52627..eb1f94653 100644 --- a/.phpstan.baseline.neon +++ b/.phpstan.baseline.neon @@ -90,18 +90,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php - - - message: '#^Method Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Renderer_Vat\:\:getValidateButton\(\) should return Mage_Adminhtml_Block_Widget_Button but returns Mage_Core_Block_Abstract\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php - - - - message: '#^Property Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Renderer_Vat\:\:\$_validateButton \(Mage_Adminhtml_Block_Widget_Button\|null\) does not accept Mage_Core_Block_Abstract\.$#' - identifier: assign.propertyType - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php - - message: '#^Access to an undefined property Mage_Adminhtml_Block_Notification_Window\:\:\$_aclResourcePath\.$#' identifier: property.notFound @@ -198,12 +186,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php - - - message: '#^Method Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Address\:\:getAddress\(\) should return Mage_Customer_Model_Address but returns Mage_Sales_Model_Quote_Address\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php - - message: '#^Method Mage_Catalog_Model_Resource_Product_Compare_Item_Collection\:\:useProductItem\(\) invoked with 1 parameter, 0 required\.$#' identifier: arguments.count @@ -906,12 +888,6 @@ parameters: count: 1 path: app/code/core/Mage/Bundle/Model/Resource/Price/Index.php - - - message: '#^Argument of an invalid type string supplied for foreach, only iterables are supported\.$#' - identifier: foreach.nonIterable - count: 1 - path: app/code/core/Mage/Catalog/Block/Breadcrumbs.php - - message: '#^Argument of an invalid type string supplied for foreach, only iterables are supported\.$#' identifier: foreach.nonIterable @@ -924,12 +900,6 @@ parameters: count: 2 path: app/code/core/Mage/Catalog/Block/Navigation.php - - - message: '#^Property Mage_Catalog_Block_Navigation\:\:\$_currentCategoryKey \(string\) does not accept int\.$#' - identifier: assign.propertyType - count: 1 - path: app/code/core/Mage/Catalog/Block/Navigation.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -942,48 +912,12 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Block/Product.php - - - message: '#^Property Mage_Catalog_Block_Product_Abstract\:\:\$_reviewsHelperBlock \(Mage_Review_Block_Helper\|null\) does not accept Mage_Core_Block_Abstract\|false\.$#' - identifier: assign.propertyType - count: 1 - path: app/code/core/Mage/Catalog/Block/Product/Abstract.php - - message: '#^Method Mage_Catalog_Model_Resource_Product_Compare_Item_Collection\:\:useProductItem\(\) invoked with 1 parameter, 0 required\.$#' identifier: arguments.count count: 1 path: app/code/core/Mage/Catalog/Block/Product/Compare/List.php - - - message: '#^Method Mage_Catalog_Block_Product_List_Toolbar\:\:getDefaultPerPageValue\(\) should return string but returns int\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php - - - - message: '#^Property Mage_Catalog_Block_Product_List_Toolbar\:\:\$_availableMode \(string\) does not accept array\.$#' - identifier: assign.propertyType - count: 1 - path: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php - - - - message: '#^Property Mage_Catalog_Block_Product_List_Toolbar\:\:\$_availableMode \(string\) does not accept array\\.$#' - identifier: assign.propertyType - count: 4 - path: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php - - - - message: '#^Property Mage_Catalog_Block_Product_List_Toolbar\:\:\$_availableMode \(string\) does not accept default value of type array\.$#' - identifier: property.defaultValue - count: 1 - path: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php - - - - message: '#^Property Mage_Catalog_Block_Product_List_Toolbar\:\:\$_availableMode \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php - - message: '#^Property Mage_Catalog_Block_Product_List_Toolbar\:\:\$_collection \(Mage_Core_Model_Resource_Db_Collection_Abstract\) does not accept Varien_Data_Collection\.$#' identifier: assign.propertyType @@ -1002,12 +936,6 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php - - - message: '#^Property Mage_Catalog_Block_Product_Widget_Html_Pager\:\:\$_lastPage \(int\) does not accept float\.$#' - identifier: assign.propertyType - count: 1 - path: app/code/core/Mage/Catalog/Block/Product/Widget/Html/Pager.php - - message: '#^Variable \$finish might not be defined\.$#' identifier: variable.undefined @@ -1068,12 +996,6 @@ parameters: count: 3 path: app/code/core/Mage/Catalog/Helper/Product.php - - - message: '#^Method Mage_Catalog_Helper_Product\:\:getMinimalQty\(\) should return int\|null but returns float\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Catalog/Helper/Product.php - - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue @@ -1110,12 +1032,6 @@ parameters: count: 2 path: app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php - - - message: '#^Argument of an invalid type string supplied for foreach, only iterables are supported\.$#' - identifier: foreach.nonIterable - count: 1 - path: app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php - - message: '#^Call to an undefined method Mage_Core_Model_Abstract\:\:toOptionArray\(\)\.$#' identifier: method.notFound @@ -1164,12 +1080,6 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Model/Category/Attribute/Api.php - - - message: '#^Property Mage_Catalog_Model_Category_Url\:\:\$_url \(Mage_Core_Model_Url\) does not accept bool\|Mage_Core_Model_Abstract\.$#' - identifier: assign.propertyType - count: 1 - path: app/code/core/Mage/Catalog/Model/Category/Url.php - - message: '#^Call to an undefined method Mage_Catalog_Model_Config\:\:_init\(\)\.$#' identifier: method.notFound @@ -1224,12 +1134,6 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Model/Design.php - - - message: '#^Method Mage_Catalog_Model_Design\:\:applyCustomDesign\(\) should return false\|null but return statement is missing\.$#' - identifier: return.missing - count: 1 - path: app/code/core/Mage/Catalog/Model/Design.php - - message: '#^Variable \$_category might not be defined\.$#' identifier: variable.undefined @@ -1242,30 +1146,6 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php - - - message: '#^Method Mage_Catalog_Model_Factory\:\:getCategoryUrlInstance\(\) should return Mage_Catalog_Model_Category_Url but returns bool\|Mage_Core_Model_Abstract\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Catalog/Model/Factory.php - - - - message: '#^Method Mage_Catalog_Model_Factory\:\:getCategoryUrlRewriteHelper\(\) should return Mage_Catalog_Helper_Category_Url_Rewrite_Interface but returns Mage_Core_Helper_Abstract\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Catalog/Model/Factory.php - - - - message: '#^Method Mage_Catalog_Model_Factory\:\:getProductUrlInstance\(\) should return Mage_Catalog_Model_Product_Url but returns bool\|Mage_Core_Model_Abstract\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Catalog/Model/Factory.php - - - - message: '#^Method Mage_Catalog_Model_Factory\:\:getProductUrlRewriteHelper\(\) should return Mage_Catalog_Helper_Product_Url_Rewrite_Interface but returns Mage_Core_Helper_Abstract\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Catalog/Model/Factory.php - - message: '#^Parameter \#2 \$filterBlock \(Varien_Object\) of method Mage_Catalog_Model_Layer_Filter_Attribute\:\:apply\(\) should be compatible with parameter \$filterBlock \(null\) of method Mage_Catalog_Model_Layer_Filter_Abstract\:\:apply\(\)$#' identifier: method.childParameterType @@ -1290,12 +1170,6 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Model/Product.php - - - message: '#^Method Mage_Catalog_Model_Product\:\:canBeShowInCategory\(\) should return bool but returns string\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Catalog/Model/Product.php - - message: '#^Method Mage_Catalog_Model_Product\:\:getPriceModel\(\) should return Mage_Bundle_Model_Product_Price but returns Mage_Catalog_Model_Product_Type_Price\.$#' identifier: return.type @@ -1380,12 +1254,6 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php - - - message: '#^Cannot access offset ''pricing_value'' on true\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php - - message: '#^Call to function is_array\(\) with string will always evaluate to false\.$#' identifier: function.impossibleType @@ -1428,12 +1296,6 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Model/Resource/Abstract.php - - - message: '#^Method Mage_Catalog_Model_Resource_Attribute\:\:isUsedBySuperProducts\(\) should return int but returns string\|false\|null\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Catalog/Model/Resource/Attribute.php - - message: '#^Property Mage_Catalog_Model_Resource_Category\:\:\$_storeId \(int\) on left side of \?\? is not nullable\.$#' identifier: nullCoalesce.property @@ -1614,12 +1476,6 @@ parameters: count: 3 path: app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php - - - message: '#^Method Mage_Catalog_Model_Resource_Product_Compare_Item\:\:getCount\(\) should return int but returns string\|false\|null\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php - - message: '#^Method Mage_Catalog_Model_Resource_Product_Indexer_Abstract\:\:_getAttribute\(\) should return Mage_Catalog_Model_Resource_Eav_Attribute but returns Mage_Eav_Model_Entity_Attribute_Abstract\|false\.$#' identifier: return.type @@ -1680,12 +1536,6 @@ parameters: count: 1 path: app/code/core/Mage/CatalogIndex/Model/Data/Abstract.php - - - message: '#^Parameter \#1 \$product \(array\) of method Mage_CatalogIndex_Model_Data_Grouped\:\:getFinalPrice\(\) should be compatible with parameter \$product \(int\) of method Mage_CatalogIndex_Model_Data_Abstract\:\:getFinalPrice\(\)$#' - identifier: method.childParameterType - count: 1 - path: app/code/core/Mage/CatalogIndex/Model/Data/Grouped.php - - message: '#^Return type \(false\) of method Mage_CatalogIndex_Model_Data_Grouped\:\:getFinalPrice\(\) should be compatible with return type \(float\) of method Mage_CatalogIndex_Model_Data_Abstract\:\:getFinalPrice\(\)$#' identifier: method.childReturnType @@ -3042,12 +2892,6 @@ parameters: count: 1 path: app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php - - - message: '#^Method Mage_Eav_Model_Resource_Entity_Attribute_Group\:\:_getMaxSortOrder\(\) should return int but returns string\|false\|null\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php - - message: '#^Call to an undefined method Mage_Eav_Model_Entity_Collection_Abstract\:\:getStoreId\(\)\.$#' identifier: method.notFound @@ -3066,12 +2910,6 @@ parameters: count: 2 path: app/code/core/Mage/Eav/Model/Resource/Form/Attribute/Collection.php - - - message: '#^PHPDoc tag @param for parameter \$object with type Mage_Eav_Model_Resource_Form_Type is incompatible with native type Mage_Core_Model_Abstract\.$#' - identifier: parameter.phpDocType - count: 2 - path: app/code/core/Mage/Eav/Model/Resource/Form/Type.php - - message: '#^Return type \(stdClass\) of method Mage_GiftMessage_Model_Api_V2\:\:_setGiftMessage\(\) should be compatible with return type \(array\) of method Mage_GiftMessage_Model_Api\:\:_setGiftMessage\(\)$#' identifier: method.childReturnType @@ -3138,12 +2976,6 @@ parameters: count: 4 path: app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php - - - message: '#^Method Mage_ImportExport_Block_Adminhtml_Export_Filter\:\:prepareCollection\(\) should return Mage_Core_Model_Resource_Db_Collection_Abstract\|null but returns Varien_Data_Collection_Db\|null\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php - - message: '#^Method Mage_Eav_Model_Entity_Attribute_Source_Interface\:\:getAllOptions\(\) invoked with 1 parameter, 0 required\.$#' identifier: arguments.count @@ -3156,30 +2988,12 @@ parameters: count: 1 path: app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php - - - message: '#^Call to an undefined method Mage_Eav_Model_Entity_Collection_Abstract\:\:addCategoryIds\(\)\.$#' - identifier: method.notFound - count: 1 - path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php - - - - message: '#^Call to an undefined method Mage_Eav_Model_Entity_Collection_Abstract\:\:setStoreId\(\)\.$#' - identifier: method.notFound - count: 1 - path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue count: 1 path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php - - - message: '#^Variable \$collection might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php - - message: '#^Method Mage_Eav_Model_Entity_Attribute_Source_Interface\:\:getAllOptions\(\) invoked with 1 parameter, 0 required\.$#' identifier: arguments.count @@ -3216,24 +3030,12 @@ parameters: count: 1 path: app/code/core/Mage/Index/Model/Lock/Storage/Db.php - - - message: '#^Method Mage_Index_Model_Lock_Storage_Db\:\:releaseLock\(\) should return int\|null but returns bool\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Index/Model/Lock/Storage/Db.php - - message: '#^Property Mage_Index_Model_Lock_Storage_Db\:\:\$_helper \(Mage_Index_Model_Resource_Helper_Mysql4\) does not accept Mage_Core_Model_Resource_Helper_Abstract\.$#' identifier: assign.propertyType count: 1 path: app/code/core/Mage/Index/Model/Lock/Storage/Db.php - - - message: '#^Return type \(int\|null\) of method Mage_Index_Model_Lock_Storage_Db\:\:releaseLock\(\) should be compatible with return type \(bool\) of method Mage_Index_Model_Lock_Storage_Interface\:\:releaseLock\(\)$#' - identifier: method.childReturnType - count: 1 - path: app/code/core/Mage/Index/Model/Lock/Storage/Db.php - - message: '#^Call to function is_array\(\) with '''' will always evaluate to false\.$#' identifier: function.impossibleType @@ -3330,24 +3132,6 @@ parameters: count: 1 path: app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php - - - message: '#^Cannot assign new offset to string\.$#' - identifier: offsetAssign.dimType - count: 1 - path: app/code/core/Mage/Paygate/Model/Authorizenet.php - - - - message: '#^Variable \$defaultExceptionMessage might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: app/code/core/Mage/Paygate/Model/Authorizenet.php - - - - message: '#^Variable \$newTransactionType might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: app/code/core/Mage/Paygate/Model/Authorizenet.php - - message: '#^Call to an undefined method Mage_Payment_Model_Method_Abstract\:\:cancelPartialAuthorization\(\)\.$#' identifier: method.notFound @@ -3390,12 +3174,6 @@ parameters: count: 1 path: app/code/core/Mage/Payment/Model/Recurring/Profile.php - - - message: '#^Method Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Group\:\:_getCollapseState\(\) should return bool but returns int\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Group.php - - message: '#^Method Mage_Paypal_Block_Express_Review\:\:_formatPrice\(\) should return string but returns float\.$#' identifier: return.type @@ -3438,18 +3216,6 @@ parameters: count: 1 path: app/code/core/Mage/Paypal/Model/Api/Nvp.php - - - message: '#^Method Mage_Paypal_Model_Api_Nvp\:\:_exportLineItems\(\) should return true\|null but empty return statement found\.$#' - identifier: return.empty - count: 1 - path: app/code/core/Mage/Paypal/Model/Api/Nvp.php - - - - message: '#^Method Mage_Paypal_Model_Api_Nvp\:\:_exportLineItems\(\) should return true\|null but returns bool\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Paypal/Model/Api/Nvp.php - - message: '#^Call to an undefined method Varien_Object\:\:isNominal\(\)\.$#' identifier: method.notFound @@ -3570,24 +3336,6 @@ parameters: count: 1 path: app/code/core/Mage/Paypal/Model/System/Config/Source/MerchantCountry.php - - - message: '#^Method Mage_Paypal_HostedproController\:\:_getIframeBlock\(\) should return Mage_Paypal_Block_Hosted_Pro_Iframe but returns Mage_Core_Block_Abstract\|false\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Paypal/controllers/HostedproController.php - - - - message: '#^Method Mage_Paypal_PayflowController\:\:_getIframeBlock\(\) should return Mage_Paypal_Block_Payflow_Link_Iframe but returns Mage_Core_Block_Abstract\|false\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Paypal/controllers/PayflowController.php - - - - message: '#^Method Mage_Paypal_PayflowadvancedController\:\:_getIframeBlock\(\) should return Mage_Paypal_Block_Payflow_Advanced_Iframe but returns Mage_Core_Block_Abstract\|false\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php - - message: '#^Return type \(void\) of method Mage_PaypalUk_Model_Pro\:\:fetchTransactionInfo\(\) should be compatible with return type \(array\) of method Mage_Paypal_Model_Pro\:\:fetchTransactionInfo\(\)$#' identifier: method.childReturnType @@ -3738,12 +3486,6 @@ parameters: count: 1 path: app/code/core/Mage/Reports/Model/Resource/Review/Collection.php - - - message: '#^Method Mage_Reports_Model_Resource_Wishlist_Collection\:\:getSharedCount\(\) should return int but returns string\|false\|null\.$#' - identifier: return.type - count: 1 - path: app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php - - message: '#^Call to an undefined method Mage_Eav_Model_Entity_Abstract\:\:setStore\(\)\.$#' identifier: method.notFound @@ -5808,12 +5550,6 @@ parameters: count: 24 path: app/design/frontend/base/default/template/catalog/product/gallery.phtml - - - message: '#^Argument of an invalid type string supplied for foreach, only iterables are supported\.$#' - identifier: foreach.nonIterable - count: 1 - path: app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml - - message: '#^Variable \$this might not be defined\.$#' identifier: variable.undefined @@ -6810,12 +6546,6 @@ parameters: count: 1 path: app/design/frontend/rwd/default/template/catalog/layer/state.phtml - - - message: '#^Argument of an invalid type string supplied for foreach, only iterables are supported\.$#' - identifier: foreach.nonIterable - count: 1 - path: app/design/frontend/rwd/default/template/catalog/product/list/toolbar.phtml - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php index 58c15b331..7de47cf6d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php @@ -72,7 +72,10 @@ public function getValidateButton() $optionsVarName = $this->getJsVariablePrefix() . 'VatParameters'; $beforeHtml = ''; - $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 . ')' diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php index 722a9ff2c..4ea81114a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php @@ -111,7 +111,7 @@ public function getAddressId() /** * Return address object * - * @return Mage_Customer_Model_Address + * @return Mage_Sales_Model_Quote_Address */ public function getAddress() { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php index c0eb0d9d0..583ecbd2e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php @@ -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) { diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index c6d4e4942..807f34f88 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -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; diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php index 1c22d9a94..49da565bb 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php @@ -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) @@ -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; } diff --git a/app/code/core/Mage/Catalog/Block/Navigation.php b/app/code/core/Mage/Catalog/Block/Navigation.php index ebe4963ff..c01ca59a1 100644 --- a/app/code/core/Mage/Catalog/Block/Navigation.php +++ b/app/code/core/Mage/Catalog/Block/Navigation.php @@ -28,7 +28,7 @@ class Mage_Catalog_Block_Navigation extends Mage_Core_Block_Template /** * Current category key * - * @var string + * @var int|string */ protected $_currentCategoryKey; @@ -92,7 +92,7 @@ public function getCacheKeyInfo() /** * Get current category key * - * @return mixed + * @return int|string */ public function getCurrenCategoryKey() { diff --git a/app/code/core/Mage/Catalog/Block/Product/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Abstract.php index 130c80405..44889aa37 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Abstract.php @@ -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) { @@ -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; diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php index f58b2e578..7f9168d90 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php @@ -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 = []; @@ -533,7 +533,7 @@ public function isModeActive($mode) /** * Retrieve availables view modes * - * @return string + * @return array */ public function getModes() { @@ -548,7 +548,7 @@ public function getModes() */ public function setModes($modes) { - if (!isset($this->_availableMode)) { + if (!$this->_availableMode) { $this->_availableMode = $modes; } return $this; @@ -647,7 +647,7 @@ public function getDefaultPerPageValue() } return Mage::getStoreConfig('catalog/frontend/grid_per_page'); } - return 0; + return '0'; } /** diff --git a/app/code/core/Mage/Catalog/Block/Product/New.php b/app/code/core/Mage/Catalog/Block/Product/New.php index 25fee5b4a..4ed3286c0 100644 --- a/app/code/core/Mage/Catalog/Block/Product/New.php +++ b/app/code/core/Mage/Catalog/Block/Product/New.php @@ -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; diff --git a/app/code/core/Mage/Catalog/Block/Product/Widget/Html/Pager.php b/app/code/core/Mage/Catalog/Block/Product/Widget/Html/Pager.php index 471c724b1..a8a189fdd 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Widget/Html/Pager.php +++ b/app/code/core/Mage/Catalog/Block/Product/Widget/Html/Pager.php @@ -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; } diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php index 50efbfd9f..3962d1b6d 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php @@ -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); } } diff --git a/app/code/core/Mage/Catalog/Helper/Data.php b/app/code/core/Mage/Catalog/Helper/Data.php index 8c3afb100..940e832d3 100644 --- a/app/code/core/Mage/Catalog/Helper/Data.php +++ b/app/code/core/Mage/Catalog/Helper/Data.php @@ -40,7 +40,7 @@ class Mage_Catalog_Helper_Data extends Mage_Core_Helper_Abstract /** * Breadcrumb Path cache * - * @var string|array> + * @var array> */ protected $_categoryPath; @@ -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() { diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php index 2f541f7e6..ebd7ad1f1 100644 --- a/app/code/core/Mage/Catalog/Helper/Product.php +++ b/app/code/core/Mage/Catalog/Helper/Product.php @@ -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) { diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php index 39a04f0e7..0ae0fd702 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest.php @@ -370,6 +370,8 @@ protected function _getTierPrices() /** * Default implementation. May be different for customer/guest/admin role. + * + * @return int|null */ protected function _getCustomerGroupId() { diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php index 3b0bed2c8..3a7cc7cc1 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Rest/Admin/V1.php @@ -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) { diff --git a/app/code/core/Mage/Catalog/Model/Category/Url.php b/app/code/core/Mage/Catalog/Model/Category/Url.php index 5c9d34efe..d29efe51f 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Url.php +++ b/app/code/core/Mage/Catalog/Model/Category/Url.php @@ -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; } diff --git a/app/code/core/Mage/Catalog/Model/Design.php b/app/code/core/Mage/Catalog/Model/Design.php index ccaa2ed87..fe97ce6b4 100644 --- a/app/code/core/Mage/Catalog/Model/Design.php +++ b/app/code/core/Mage/Catalog/Model/Design.php @@ -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) { diff --git a/app/code/core/Mage/Catalog/Model/Factory.php b/app/code/core/Mage/Catalog/Model/Factory.php index 85243786e..423a7b490 100644 --- a/app/code/core/Mage/Catalog/Model/Factory.php +++ b/app/code/core/Mage/Catalog/Model/Factory.php @@ -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; } /** @@ -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; } /** @@ -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; } /** @@ -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; } } diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index 949b28020..4f6bd0018 100644 --- a/app/code/core/Mage/Catalog/Model/Product.php +++ b/app/code/core/Mage/Catalog/Model/Product.php @@ -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) { @@ -1987,7 +1987,7 @@ public function hasCustomOptions() * Check availability display product in category * * @param int $categoryId - * @return bool + * @return string */ public function canBeShowInCategory($categoryId) { diff --git a/app/code/core/Mage/Catalog/Model/Product/Api.php b/app/code/core/Mage/Catalog/Model/Product/Api.php index 18dab8381..8ee476a12 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api.php @@ -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 */ @@ -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) diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php index baa8d0201..dd9780c2d 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php @@ -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) { diff --git a/app/code/core/Mage/Catalog/Model/Resource/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Attribute.php index 7be0d4bf2..09b6d10bc 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Attribute.php @@ -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) { diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php index 7e5305747..4a630f6aa 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php @@ -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 diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Product.php index e24c46be3..d34dc3a3b 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product.php @@ -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 */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php index 1e354af58..2f92b6093 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php @@ -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) { diff --git a/app/code/core/Mage/Catalog/Model/Resource/Setup.php b/app/code/core/Mage/Catalog/Model/Resource/Setup.php index 64375dad2..1cb44a5e1 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Setup.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Setup.php @@ -889,7 +889,7 @@ protected function _getCategoryEntityRow($entityId) * * @param array $category * @param array $path - * @return string + * @return array */ protected function _getCategoryPath($category, $path = []) { diff --git a/app/code/core/Mage/Catalog/Model/Resource/Url.php b/app/code/core/Mage/Catalog/Model/Resource/Url.php index 1cd5e1f1c..7ce2ae089 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Url.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Url.php @@ -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 */ @@ -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) diff --git a/app/code/core/Mage/CatalogIndex/Model/Data/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Data/Abstract.php index f2816ef89..12e8b97d5 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Data/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Data/Abstract.php @@ -135,7 +135,7 @@ protected function fetchLinkInformation($store, $settings, $type, $suppliedId) /** * Fetch final price for product * - * @param int $product + * @param array $product * @param Mage_Core_Model_Store $store * @param Mage_Customer_Model_Group $group * @return float @@ -230,7 +230,7 @@ public function getTierPrices($products, $store) /** * Retrieve specified attribute data for specified products from specified store * - * @param array $products + * @param array|string $products * @param array $attributes * @param Mage_Core_Model_Store $store * @return array diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php index 80631726c..7202adca8 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php @@ -67,7 +67,7 @@ protected function _construct() /** * Retrieve specified attribute data for specified products from specified store * - * @param array $products + * @param array|string $products * @param array $attributes * @param int $store * @return array diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php index e063d216f..f641f2085 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php @@ -62,7 +62,7 @@ public function items($productIds) } /** - * @param int $productId + * @param string $productId * @param array $data * @return bool * @throws Mage_Api_Exception diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php index 3c788d0c7..ebc552e01 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php @@ -21,7 +21,7 @@ class Mage_CatalogInventory_Model_Stock_Item_Api_V2 extends Mage_CatalogInventor /** * Update product stock data * - * @param int $productId + * @param string $productId * @param array $data * @return bool */ diff --git a/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php b/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php index 0144cac90..cb1914b7d 100644 --- a/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php +++ b/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php @@ -417,7 +417,7 @@ protected function _calculatePrice() ) . ' = cppt.grouped_id AND ' . $this->_connection->getIfNullSql( new Zend_Db_Expr('@action_stop'), - new Zend_Db_Expr(0) + new Zend_Db_Expr('0') ) . ' = 0' => '@price := ' . $this->_connection->getCaseSql( $this->_connection->quoteIdentifier('cppt.action_operator'), [ @@ -477,7 +477,7 @@ protected function _prepareIndexSelect(Mage_Core_Model_Website $website, $time) ) . ' = cppt.grouped_id' => '@action_stop := ' . $this->_connection->getIfNullSql( new Zend_Db_Expr('@action_stop'), - new Zend_Db_Expr(0) + new Zend_Db_Expr('0') ) . ' + cppt.action_stop', ] ) @@ -531,7 +531,7 @@ protected function _prepareIndexSelect(Mage_Core_Model_Website $website, $time) ->where( $this->_connection->getCheckSql( new Zend_Db_Expr('to_time = 0'), - new Zend_Db_Expr(1), + new Zend_Db_Expr('1'), new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . ' <= to_time') ) ) @@ -601,7 +601,7 @@ protected function _prepareGroupWebsite($timestamp) ->where( $this->_connection->getCheckSql( new Zend_Db_Expr('to_time = 0'), - new Zend_Db_Expr(1), + new Zend_Db_Expr('1'), new Zend_Db_Expr("{$timestamp} <= to_time") ) ); diff --git a/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php b/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php index 2cdbe6e50..a8e20c916 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php +++ b/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php @@ -123,7 +123,7 @@ public function getFormUrl() public function getSearchCriterias() { $searchCriterias = $this->getSearchModel()->getSearchCriterias(); - $middle = ceil(count($searchCriterias) / 2); + $middle = (int) ceil(count($searchCriterias) / 2); $left = array_slice($searchCriterias, 0, $middle); $right = array_slice($searchCriterias, $middle); diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index 42b0db4a1..e8801a6c5 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -401,7 +401,7 @@ public function remove($id) /** * Clean cached data by specific tag * - * @param array $tags + * @param array|string $tags * @return bool */ public function clean($tags = []) diff --git a/app/code/core/Mage/Core/Model/Cookie.php b/app/code/core/Mage/Core/Model/Cookie.php index 507c1f4a8..55d23bbc7 100644 --- a/app/code/core/Mage/Core/Model/Cookie.php +++ b/app/code/core/Mage/Core/Model/Cookie.php @@ -143,7 +143,7 @@ public function setLifetime($lifetime) /** * Retrieve use HTTP only flag * - * @return bool + * @return bool|null */ public function getHttponly() { diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 043bb40b0..089a4d40b 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -930,10 +930,10 @@ public function getCurrentCurrencyRate() /** * Convert price from default currency to current currency * - * @param double $price + * @param float $price * @param bool $format Format price to currency format * @param bool $includeContainer Enclose into - * @return double + * @return float */ public function convertPrice($price, $format = false, $includeContainer = true) { diff --git a/app/code/core/Mage/Customer/Model/Customer.php b/app/code/core/Mage/Customer/Model/Customer.php index 8cdbb2283..bdd293b15 100644 --- a/app/code/core/Mage/Customer/Model/Customer.php +++ b/app/code/core/Mage/Customer/Model/Customer.php @@ -42,6 +42,7 @@ * @method $this setEmail(string $value) * * @method string getFirstname() + * @method $this setFirstname(string $value) * @method bool getForceConfirmed() * @method $this setForceConfirmed(bool $value) * @@ -63,6 +64,7 @@ * @method $this setItems(int $value) * * @method string getLastname() + * @method $this setLastname(string $value) * * @method string getMiddlename() * @method string getMode() diff --git a/app/code/core/Mage/Directory/Model/Currency.php b/app/code/core/Mage/Directory/Model/Currency.php index c4cc51327..206db0b63 100644 --- a/app/code/core/Mage/Directory/Model/Currency.php +++ b/app/code/core/Mage/Directory/Model/Currency.php @@ -323,7 +323,7 @@ public function getConfigBaseCurrencies() /** * Retrieve currency rates to other currencies * - * @param string $currency + * @param array|string|Mage_Directory_Model_Currency $currency * @param array $toCurrencies * @return array */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php index 85dd14d30..52347d4fe 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php @@ -81,7 +81,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) * Retrieve max sort order * * @param Mage_Core_Model_Abstract|Mage_Eav_Model_Entity_Attribute_Group $object - * @return int + * @return false|string|null */ protected function _getMaxSortOrder($object) { diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Type.php b/app/code/core/Mage/Eav/Model/Resource/Form/Type.php index f7979f9c9..47f649b26 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Type.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Type.php @@ -31,7 +31,7 @@ protected function _construct() } /** - * @param Mage_Eav_Model_Resource_Form_Type $object + * @param Mage_Eav_Model_Form_Type $object */ #[\Override] public function load(Mage_Core_Model_Abstract $object, $value, $field = null) @@ -67,7 +67,7 @@ public function getEntityTypes($object) * Save entity types after save form type * * @see Mage_Core_Model_Resource_Db_Abstract::_afterSave() - * @param Mage_Eav_Model_Resource_Form_Type $object + * @param Mage_Eav_Model_Form_Type $object */ #[\Override] protected function _afterSave(Mage_Core_Model_Abstract $object) diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php index 8cf154382..4c742e5c9 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php @@ -20,6 +20,11 @@ */ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Block_Widget_Grid { + /** + * @var Mage_Eav_Model_Resource_Entity_Attribute_Collection|null + */ + protected $_collection = null; + /** * Helper object. * @@ -429,7 +434,7 @@ public function getRowUrl($row) /** * Prepare collection by setting page number, sorting etc.. * - * @return Mage_Core_Model_Resource_Db_Collection_Abstract|null + * @return Mage_Eav_Model_Resource_Entity_Attribute_Collection */ public function prepareCollection(Mage_Eav_Model_Resource_Entity_Attribute_Collection $collection) { diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php index ebe8ae4a9..5d6ae6b62 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php @@ -614,6 +614,7 @@ protected function _prepareExport() // prepare multi-store values and system columns values foreach ($this->_storeIdToCode as $storeId => &$storeCode) { // go through all stores + /** @var Mage_Catalog_Model_Resource_Product_Collection $collection */ $collection = $this->_prepareEntityCollection(Mage::getResourceModel('catalog/product_collection')); $collection ->setStoreId($storeId) @@ -721,7 +722,7 @@ protected function _prepareExport() $collection->clear(); } - if ($collection->getCurPage() < $offsetProducts) { + if (isset($collection) && $collection->getCurPage() < $offsetProducts) { break; } diff --git a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php index c1911462b..4fd4d6e38 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php @@ -79,7 +79,7 @@ protected function _init() #[\Override] public function next() { - $this->_currentRow = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure, $this->_escape); + $this->_currentRow = fgetcsv($this->_fileHandler, 0, $this->_delimiter, $this->_enclosure, $this->_escape); $this->_currentKey = $this->_currentRow ? $this->_currentKey + 1 : null; } @@ -94,8 +94,8 @@ public function rewind() { // rewind resource, reset column names, read first row as current rewind($this->_fileHandler); - $this->_colNames = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure, $this->_escape); - $this->_currentRow = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure, $this->_escape); + $this->_colNames = fgetcsv($this->_fileHandler, 0, $this->_delimiter, $this->_enclosure, $this->_escape); + $this->_currentRow = fgetcsv($this->_fileHandler, 0, $this->_delimiter, $this->_enclosure, $this->_escape); if ($this->_currentRow) { $this->_currentKey = 0; @@ -121,7 +121,7 @@ public function seek($position) if ($position < $this->_currentKey) { $this->rewind(); } - while ($this->_currentRow = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure, $this->_escape)) { + while ($this->_currentRow = fgetcsv($this->_fileHandler, 0, $this->_delimiter, $this->_enclosure, $this->_escape)) { if (++$this->_currentKey == $position) { return; } diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index 71fdf628c..52ab01b3d 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -1205,7 +1205,7 @@ protected function _saveLinks() $linkRows, ['link_id'] ); - $adapter->changeTableAutoIncrement($mainTable, $nextLinkId); + $adapter->changeTableAutoIncrement($mainTable, (string)$nextLinkId); } if ($positionRows) { // process linked product positions $adapter->insertOnDuplicate( diff --git a/app/code/core/Mage/Index/Model/Event.php b/app/code/core/Mage/Index/Model/Event.php index 869435e5b..790ad8467 100644 --- a/app/code/core/Mage/Index/Model/Event.php +++ b/app/code/core/Mage/Index/Model/Event.php @@ -120,8 +120,8 @@ public function resetData() * Add process id to event object * * @param int $processId - * @param string $status - * @return $this + * @param Mage_Index_Model_Process::EVENT_STATUS_* $status + * @return $this */ public function addProcessId($processId, $status = Mage_Index_Model_Process::EVENT_STATUS_NEW) { diff --git a/app/code/core/Mage/Index/Model/Lock/Storage/Db.php b/app/code/core/Mage/Index/Model/Lock/Storage/Db.php index b18c48de4..2d040c2a0 100644 --- a/app/code/core/Mage/Index/Model/Lock/Storage/Db.php +++ b/app/code/core/Mage/Index/Model/Lock/Storage/Db.php @@ -63,7 +63,7 @@ public function setLock($lockName) * Release named lock * * @param string $lockName - * @return int|null + * @return bool */ #[\Override] public function releaseLock($lockName) diff --git a/app/code/core/Mage/Index/Model/Process.php b/app/code/core/Mage/Index/Model/Process.php index cb603d836..bdc96575e 100644 --- a/app/code/core/Mage/Index/Model/Process.php +++ b/app/code/core/Mage/Index/Model/Process.php @@ -368,7 +368,7 @@ protected function _processEventsCollection( if (!$skipUnmatched) { $eventProcessIds = $event->getProcessIds(); if (!isset($eventProcessIds[$this->getId()])) { - $event->addProcessId($this->getId(), null); + $event->addProcessId($this->getId()); } } } catch (Exception $e) { diff --git a/app/code/core/Mage/Oauth/Helper/Data.php b/app/code/core/Mage/Oauth/Helper/Data.php index 0e5ca2dac..095297997 100644 --- a/app/code/core/Mage/Oauth/Helper/Data.php +++ b/app/code/core/Mage/Oauth/Helper/Data.php @@ -73,7 +73,7 @@ protected function _generateRandomString($length) { if (function_exists('openssl_random_pseudo_bytes')) { // use openssl lib if it is install. It provides a better randomness - $bytes = openssl_random_pseudo_bytes(ceil($length / 2), $strong); + $bytes = openssl_random_pseudo_bytes((int)ceil($length / 2), $strong); $hex = bin2hex($bytes); // hex() doubles the length of the string $randomString = substr($hex, 0, $length); // we truncate at most 1 char if length parameter is an odd number } else { diff --git a/app/code/core/Mage/Page/Block/Html/Pager.php b/app/code/core/Mage/Page/Block/Html/Pager.php index 6ec4ca095..af354dd3c 100644 --- a/app/code/core/Mage/Page/Block/Html/Pager.php +++ b/app/code/core/Mage/Page/Block/Html/Pager.php @@ -160,7 +160,7 @@ public function getPageVarName() } /** - * @param string $varName + * @param bool $varName * @return $this */ public function setShowPerPage($varName) diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet.php b/app/code/core/Mage/Paygate/Model/Authorizenet.php index 9537a886f..a7e73ad81 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet.php @@ -312,7 +312,7 @@ public function unsetPartialAuthorizationLastActionState() /** * Send authorize request to gateway * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @param float $amount * @return $this */ @@ -339,7 +339,7 @@ public function authorize(Varien_Object $payment, $amount) /** * Send capture request to gateway * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @param float $amount * @return $this */ @@ -364,7 +364,7 @@ public function capture(Varien_Object $payment, $amount) /** * Void the payment through gateway * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @return $this */ #[\Override] @@ -399,7 +399,7 @@ public function void(Varien_Object $payment) /** * Cancel the payment through gateway * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @return $this */ #[\Override] @@ -411,6 +411,7 @@ public function cancel(Varien_Object $payment) /** * Refund the amount with transaction id * + * @param Mage_Sales_Model_Order_Payment $payment * @param float $requestedAmount * @return $this * @throws Mage_Core_Exception @@ -494,9 +495,9 @@ public function cancelPartialAuthorization(Mage_Payment_Model_Info $payment) /** * Send request with new payment to gateway * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @param float $amount - * @param string $requestType + * @param self::REQUEST_TYPE_AUTH_* $requestType * @return $this * @throws Mage_Core_Exception */ @@ -593,9 +594,9 @@ protected function _place($payment, $amount, $requestType) /** * Send request with new payment to gateway during partial authorization process * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @param float $amount - * @param string $requestType + * @param self::REQUEST_TYPE_AUTH_* $requestType * @return $this */ protected function _partialAuthorization($payment, $amount, $requestType) @@ -689,7 +690,7 @@ protected function _isPreauthorizeCapture($payment) /** * Send capture request to gateway for capture authorized transactions * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @param float $requestedAmount * @return $this */ @@ -743,7 +744,7 @@ protected function _preauthorizeCapture($payment, $requestedAmount) /** * Send capture request to gateway for capture authorized transactions of card * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @param float $amount * @param Varien_Object $card * @return Mage_Sales_Model_Order_Payment_Transaction @@ -810,7 +811,7 @@ protected function _preauthorizeCaptureCardTransaction($payment, $amount, $card) /** * Void the card transaction through gateway * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @param Varien_Object $card * @return Mage_Sales_Model_Order_Payment_Transaction */ @@ -911,7 +912,7 @@ protected function _isTransactionExpired($realAuthTransactionId) /** * Refund the card transaction through gateway * - * @param Mage_Payment_Model_Info $payment + * @param Mage_Sales_Model_Order_Payment $payment * @param Varien_Object $card * @return Mage_Sales_Model_Order_Payment_Transaction */ @@ -1107,7 +1108,7 @@ public function fetchTransactionInfo(Mage_Payment_Model_Info $payment, $transact /** * Set split_tender_id to quote payment if needed * - * @param Varien_Object $response + * @param Mage_Paygate_Model_Authorizenet_Result $response * @param Mage_Sales_Model_Order_Payment $orderPayment * @return bool */ @@ -1511,7 +1512,7 @@ protected function _isGatewayActionsLocked($payment) * Process exceptions for gateway action with a lot of transactions * * @param Mage_Payment_Model_Info $payment - * @param string $messages + * @param array $messages * @param bool $isSuccessfulTransactions */ protected function _processFailureMultitransactionAction($payment, $messages, $isSuccessfulTransactions) diff --git a/app/code/core/Mage/Payment/Helper/Data.php b/app/code/core/Mage/Payment/Helper/Data.php index cdf1160d1..e8d68db63 100644 --- a/app/code/core/Mage/Payment/Helper/Data.php +++ b/app/code/core/Mage/Payment/Helper/Data.php @@ -69,7 +69,7 @@ public function getStoreMethods($store = null, $quote = null) if (!$model = Mage::getStoreConfig($prefix . 'model', $store)) { continue; } - /** @var Mage_Payment_Model_Method_Abstract $methodInstance */ + /** @var Mage_Payment_Model_Method_Abstract|false $methodInstance */ $methodInstance = Mage::getModel($model); if (!$methodInstance) { continue; diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Group.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Group.php index 92fd1bf99..bfcfcb933 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Group.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Group.php @@ -42,7 +42,7 @@ protected function _getHeaderCommentHtml($element) * Return collapse state * * @param Varien_Data_Form_Element_Abstract $element - * @return bool + * @return int|false */ #[\Override] protected function _getCollapseState($element) diff --git a/app/code/core/Mage/Paypal/Model/Api/Nvp.php b/app/code/core/Mage/Paypal/Model/Api/Nvp.php index c72842539..1e4f793a0 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Nvp.php +++ b/app/code/core/Mage/Paypal/Model/Api/Nvp.php @@ -1192,7 +1192,7 @@ protected function _deformatNVP($nvpstr) * NVP doesn't support passing discount total as a separate amount - add it as a line item * * @param int $i - * @return true|null + * @return bool|void */ #[\Override] protected function _exportLineItems(array &$request, $i = 0) diff --git a/app/code/core/Mage/Paypal/controllers/HostedproController.php b/app/code/core/Mage/Paypal/controllers/HostedproController.php index 2ab2ed7b9..a9ac6ab70 100644 --- a/app/code/core/Mage/Paypal/controllers/HostedproController.php +++ b/app/code/core/Mage/Paypal/controllers/HostedproController.php @@ -78,7 +78,8 @@ protected function _getCheckout() protected function _getIframeBlock() { $this->loadLayout('paypal_hosted_pro_iframe'); - return $this->getLayout() - ->getBlock('hosted.pro.iframe'); + /** @var Mage_Paypal_Block_Hosted_Pro_Iframe $block */ + $block = $this->getLayout()->getBlock('hosted.pro.iframe'); + return $block; } } diff --git a/app/code/core/Mage/Paypal/controllers/PayflowController.php b/app/code/core/Mage/Paypal/controllers/PayflowController.php index 02c213b14..a60140bd6 100644 --- a/app/code/core/Mage/Paypal/controllers/PayflowController.php +++ b/app/code/core/Mage/Paypal/controllers/PayflowController.php @@ -128,7 +128,8 @@ protected function _getCheckout() protected function _getIframeBlock() { $this->loadLayout('paypal_payflow_link_iframe'); - return $this->getLayout() - ->getBlock('payflow.link.iframe'); + /** @var Mage_Paypal_Block_Payflow_Link_Iframe $block */ + $block = $this->getLayout()->getBlock('payflow.link.iframe'); + return $block; } } diff --git a/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php b/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php index 761a2e3c8..5144c7694 100644 --- a/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php +++ b/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php @@ -148,7 +148,8 @@ protected function _getCheckout() protected function _getIframeBlock() { $this->loadLayout('paypal_payflow_advanced_iframe'); - return $this->getLayout() - ->getBlock('payflow.advanced.iframe'); + /** @var Mage_Paypal_Block_Payflow_Advanced_Iframe $block */ + $block = $this->getLayout()->getBlock('payflow.advanced.iframe'); + return $block; } } diff --git a/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php b/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php index d6538783d..1eaf2e65d 100644 --- a/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php +++ b/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php @@ -581,7 +581,7 @@ protected function _applyCountryWorkarounds(&$request) * Checking negative line items * * @param int $i - * @return null|true + * @return bool|void */ #[\Override] protected function _exportLineItems(array &$request, $i = 0) diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php index f13ad7eba..15b7a2ec4 100644 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php @@ -79,7 +79,7 @@ public function setPositionOrder($dir = 'ASC') /** * Set store filter * - * @param int $storeId + * @param int|array $storeId * @return $this */ public function setStoreFilter($storeId) diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php index 553f1f218..cda5576b2 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php @@ -121,7 +121,7 @@ protected function _getInventoryItemField($field) /** * Join catalog inventory stock item table for further stock_item values filters * - * @param array $fields + * @param array|string $fields * @return $this * @throws Mage_Core_Exception */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php index 5f86b1faa..c43851bb4 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php @@ -83,7 +83,7 @@ public function getWishlistCustomerCount() /** * Get shared items collection count * - * @return int + * @return false|string|null */ public function getSharedCount() { diff --git a/app/code/core/Mage/Sales/Block/Order/Recent.php b/app/code/core/Mage/Sales/Block/Order/Recent.php index 6fd5a2d88..65c830919 100644 --- a/app/code/core/Mage/Sales/Block/Order/Recent.php +++ b/app/code/core/Mage/Sales/Block/Order/Recent.php @@ -58,7 +58,7 @@ public function __construct() ['in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()] ) ->addAttributeToSort('created_at', 'desc') - ->setPageSize('5') + ->setPageSize(5) ->load() ; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php index f304c9076..363dba77b 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php @@ -323,7 +323,7 @@ protected function _getXmlQuotes() $xml->addChild('Revision', '2'); $package = $xml->addChild('Package'); - $package->addAttribute('ID', 0); + $package->addAttribute('ID', '0'); $service = $this->getCode('service_to_code', $r->getService()); if (!$service) { $service = $r->getService(); @@ -367,7 +367,7 @@ protected function _getXmlQuotes() $xml->addChild('Revision', '2'); $package = $xml->addChild('Package'); - $package->addAttribute('ID', 0); + $package->addAttribute('ID', '0'); $package->addChild('Pounds', $r->getWeightPounds()); $package->addChild('Ounces', $r->getWeightOunces()); $package->addChild('MailType', 'All'); @@ -1441,7 +1441,7 @@ protected function _formUsSignatureConfirmationShipmentRequest(Varien_Object $re $xmlWrap = new SimpleXMLElement(''); $xml = $xmlWrap->addChild($rootNode); $xml->addAttribute('USERID', $this->getConfigData('userid')); - $xml->addChild('Option', 1); + $xml->addChild('Option', '1'); $xml->addChild('ImageParameters'); $xml->addChild('FromName', $request->getShipperContactPersonName()); $xml->addChild('FromFirm', $request->getShipperContactCompanyName()); @@ -1575,7 +1575,7 @@ protected function _formIntlShipmentRequest(Varien_Object $request) $xml->addAttribute('USERID', $this->getConfigData('userid')); $xml->addAttribute('PASSWORD', $this->getConfigData('password')); $xml->addChild('Option'); - $xml->addChild('Revision', self::DEFAULT_REVISION); + $xml->addChild('Revision', (string)self::DEFAULT_REVISION); $xml->addChild('ImageParameters'); $xml->addChild('FromFirstName', $request->getShipperContactPersonFirstName()); $xml->addChild('FromLastName', $request->getShipperContactPersonLastName()); @@ -1672,12 +1672,12 @@ protected function _formIntlShipmentRequest(Varien_Object $request) $ceiledQty = 1; } $individualItemWeight = $itemWeight / $ceiledQty; - $itemDetail->addChild('Quantity', $ceiledQty); - $itemDetail->addChild('Value', $item->getCustomsValue() * $item->getQty()); + $itemDetail->addChild('Quantity', (string)$ceiledQty); + $itemDetail->addChild('Value', (string)($item->getCustomsValue() * $item->getQty())); list($individualPoundsWeight, $individualOuncesWeight) = $this->_convertPoundOunces($individualItemWeight); $itemDetail->addChild('NetPounds', $individualPoundsWeight); $itemDetail->addChild('NetOunces', $individualOuncesWeight); - $itemDetail->addChild('HSTariffNumber', 0); + $itemDetail->addChild('HSTariffNumber', '0'); $itemDetail->addChild('CountryOfOrigin', $countryOfManufacture); list($itemPoundsWeight, $itemOuncesWeight) = $this->_convertPoundOunces($itemWeight); diff --git a/lib/Varien/Data/Collection.php b/lib/Varien/Data/Collection.php index 8ca88dac3..82682c9ba 100644 --- a/lib/Varien/Data/Collection.php +++ b/lib/Varien/Data/Collection.php @@ -59,7 +59,7 @@ class Varien_Data_Collection implements IteratorAggregate, Countable /** * Current page number for items pager * - * @var int + * @var int|null */ protected $_curPage = 1; @@ -68,7 +68,7 @@ class Varien_Data_Collection implements IteratorAggregate, Countable * * if page size is false, then we works with all items * - * @var int | false + * @var int|false|null */ protected $_pageSize = false; @@ -482,7 +482,7 @@ public function setDataToAll($key, $value = null) /** * Set current page * - * @param int $page + * @param int|null $page * @return $this */ public function setCurPage($page) @@ -494,7 +494,7 @@ public function setCurPage($page) /** * Set collection page size * - * @param int $size + * @param int|null $size * @return $this */ public function setPageSize($size)