From 461b77bcde3b4da2db5340fb47ddb8fda0d13053 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Thu, 6 Nov 2025 22:14:37 +0100 Subject: [PATCH] PhpStan: docblock fixes --- .phpstan.dist.baseline.neon | 144 ------------------ README.md | 2 +- .../Adminhtml/Block/Sales/Items/Abstract.php | 2 +- .../Sales/Order/View/Tab/Creditmemos.php | 4 +- .../Block/Sales/Order/View/Tab/Invoices.php | 4 +- .../Block/Sales/Order/View/Tab/Shipments.php | 4 +- .../Sales/Order/InvoiceController.php | 2 +- .../Sales/Order/ShipmentController.php | 2 +- .../Block/Product/View/Type/Configurable.php | 2 +- .../Mage/CatalogIndex/Model/Retreiver.php | 6 +- .../Adminhtml/Form/Field/Customergroup.php | 2 +- app/code/core/Mage/Core/Helper/String.php | 2 +- .../Mage/Paypal/Model/Method/Agreement.php | 3 +- .../Model/Resource/Order/Collection.php | 2 +- .../Resource/Product/Ordered/Collection.php | 4 +- .../Resource/Product/Sold/Collection.php | 4 +- .../Model/Resource/Quote/Collection.php | 2 +- .../Mage/Sales/Model/Order/Invoice/Api.php | 10 +- .../Mage/Sales/Model/Order/Shipment/Api.php | 2 +- .../Sales/Model/Order/Shipment/Api/V2.php | 2 +- app/code/core/Mage/Sales/Model/Quote.php | 8 +- .../Mage/Sales/Model/Quote/Address/Item.php | 2 +- .../Billing/AgreementController.php | 1 + lib/Varien/Data/Form/Element/Multiline.php | 6 +- lib/Varien/Db/Adapter/Interface.php | 2 +- 25 files changed, 45 insertions(+), 179 deletions(-) diff --git a/.phpstan.dist.baseline.neon b/.phpstan.dist.baseline.neon index b21d9b1333e..432468efc38 100644 --- a/.phpstan.dist.baseline.neon +++ b/.phpstan.dist.baseline.neon @@ -198,12 +198,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php - - - rawMessage: 'Parameter #2 $filter of method Mage_Reports_Model_Resource_Quote_Collection::prepareForAbandonedReport() expects string|null, array|string> given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php - - rawMessage: 'Parameter #1 $statusCode of method Mage_Tag_Model_Resource_Popular_Collection::addStatusFilter() expects string, int given.' identifier: argument.type @@ -246,24 +240,6 @@ parameters: count: 3 path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php - - - rawMessage: 'Return type (Mage_Sales_Model_Order_Creditmemo) of method Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Items::getSource() should be compatible with return type (Mage_Sales_Model_Order_Invoice) of method Mage_Adminhtml_Block_Sales_Items_Abstract::getSource()' - identifier: method.childReturnType - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php - - - - rawMessage: 'Return type (Mage_Sales_Model_Order_Creditmemo) of method Mage_Adminhtml_Block_Sales_Order_Creditmemo_View_Items::getSource() should be compatible with return type (Mage_Sales_Model_Order_Invoice) of method Mage_Adminhtml_Block_Sales_Items_Abstract::getSource()' - identifier: method.childReturnType - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php - - - - rawMessage: 'Return type (Mage_Sales_Model_Order_Shipment) of method Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Items::getSource() should be compatible with return type (Mage_Sales_Model_Order_Invoice) of method Mage_Adminhtml_Block_Sales_Items_Abstract::getSource()' - identifier: method.childReturnType - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php - - rawMessage: 'Call to an undefined method Mage_Shipping_Model_Carrier_Abstract::isGirthAllowed().' identifier: method.notFound @@ -276,12 +252,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php - - - rawMessage: 'Return type (Mage_Sales_Model_Order_Shipment) of method Mage_Adminhtml_Block_Sales_Order_Shipment_View_Items::getSource() should be compatible with return type (Mage_Sales_Model_Order_Invoice) of method Mage_Adminhtml_Block_Sales_Items_Abstract::getSource()' - identifier: method.childReturnType - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php - - rawMessage: 'Parameter #1 $entity of method Mage_Adminhtml_Block_Sales_Order_View_Giftmessage::setEntity() expects Mage_Sales_Model_Order, Mage_Eav_Model_Entity_Abstract given.' identifier: argument.type @@ -300,24 +270,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php - - - rawMessage: 'Call to an undefined method Mage_Core_Model_Resource_Db_Collection_Abstract::setOrderFilter().' - identifier: method.notFound - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php - - - - rawMessage: 'Call to an undefined method Mage_Core_Model_Resource_Db_Collection_Abstract::setOrderFilter().' - identifier: method.notFound - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php - - - - rawMessage: 'Call to an undefined method Mage_Core_Model_Resource_Db_Collection_Abstract::setOrderFilter().' - identifier: method.notFound - count: 1 - path: app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php - - rawMessage: 'Parameter #1 $order of method Mage_Sales_Helper_Reorder::canReorder() expects Mage_Sales_Model_Order, Varien_Object given.' identifier: argument.type @@ -1236,12 +1188,6 @@ parameters: count: 1 path: app/code/core/Mage/Catalog/Block/Product/View/Attributes.php - - - rawMessage: Invalid array key type array. - identifier: offsetAccess.invalidOffset - count: 1 - path: app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php - - rawMessage: 'Parameter #1 $category (Mage_Catalog_Model_Category) of method Mage_Catalog_Block_Seo_Sitemap_Category::getItemUrl() should be compatible with parameter $item (Mage_Catalog_Block_Seo_Sitemap_Abstract) of method Mage_Catalog_Block_Seo_Sitemap_Abstract::getItemUrl()' identifier: method.childParameterType @@ -2028,12 +1974,6 @@ parameters: count: 1 path: app/code/core/Mage/CatalogIndex/Model/Resource/Setup.php - - - rawMessage: 'Parameter #1 $value of method Mage_Core_Block_Html_Select::addOption() expects string, int given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php - - rawMessage: 'Cannot call method setTypeId() on Mage_Core_Model_Resource_Db_Collection_Abstract|false.' identifier: method.nonObject @@ -3858,12 +3798,6 @@ parameters: count: 1 path: app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php - - - rawMessage: 'Parameter #2 $value of method Varien_Db_Adapter_Interface::getIfNullSql() expects string, int given.' - identifier: argument.type - count: 4 - path: app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php - - rawMessage: 'Property Mage_Reports_Model_Resource_Entity_Summary_Collection_Abstract::$_entityCollection (Mage_Eav_Model_Entity_Collection_Abstract) in empty() is not falsy.' identifier: empty.property @@ -3882,66 +3816,12 @@ parameters: count: 1 path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php - - - rawMessage: 'Parameter #2 $customStart of method Mage_Reports_Model_Resource_Order_Collection::getDateRange() expects string, int given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php - - rawMessage: 'Parameter #2 $interval of method Varien_Db_Adapter_Interface::getDateAddSql() expects int, string given.' identifier: argument.type count: 1 path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php - - - rawMessage: 'Parameter #2 $value of method Varien_Db_Adapter_Interface::getIfNullSql() expects string, int given.' - identifier: argument.type - count: 20 - path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php - - - - rawMessage: 'Parameter #3 $customEnd of method Mage_Reports_Model_Resource_Order_Collection::getDateRange() expects string, int given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php - - - - rawMessage: 'Parameter #1 $from of method Mage_Reports_Model_Resource_Product_Ordered_Collection::_joinFields() expects string, int given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php - - - - rawMessage: 'Parameter #2 $to of method Mage_Reports_Model_Resource_Product_Ordered_Collection::_joinFields() expects string, int given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php - - - - rawMessage: 'Parameter #1 $from of method Mage_Reports_Model_Resource_Product_Collection::addOrderedQty() expects string, int given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php - - - - rawMessage: 'Parameter #2 $to of method Mage_Reports_Model_Resource_Product_Collection::addOrderedQty() expects string, int given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php - - - - rawMessage: 'Parameter #1 $filter of method Mage_Reports_Model_Resource_Quote_Collection::addCustomerData() expects array|null, string|null given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php - - - - rawMessage: 'Parameter #2 $filter of method Mage_Reports_Model_Resource_Quote_Collection::addSubtotal() expects array|null, string|null given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php - - rawMessage: 'Parameter #3 $cols of method Zend_Db_Select::joinInner() expects array|string, null given.' identifier: argument.type @@ -4110,12 +3990,6 @@ parameters: count: 1 path: app/code/core/Mage/Sales/Model/Order/Creditmemo.php - - - rawMessage: 'Parameter #1 $incrementId of method Mage_Sales_Model_Order_Invoice::loadByIncrementId() expects string, int given.' - identifier: argument.type - count: 1 - path: app/code/core/Mage/Sales/Model/Order/Invoice/Api.php - - rawMessage: 'Call to an undefined method Mage_Catalog_Model_Product_Type_Abstract::getForceApplyDiscountToParentItem().' identifier: method.notFound @@ -4260,12 +4134,6 @@ parameters: count: 1 path: app/code/core/Mage/Sales/Model/Quote.php - - - rawMessage: 'Property Mage_Sales_Model_Quote::$_addresses (Mage_Sales_Model_Resource_Order_Address_Collection|null) does not accept Mage_Sales_Model_Resource_Quote_Address_Collection.' - identifier: assign.propertyType - count: 1 - path: app/code/core/Mage/Sales/Model/Quote.php - - rawMessage: 'Method Mage_Sales_Model_Quote_Address::getItemsCollection() should return Mage_Eav_Model_Entity_Collection_Abstract but returns Mage_Sales_Model_Resource_Quote_Address_Item_Collection.' identifier: return.type @@ -5844,24 +5712,12 @@ parameters: count: 1 path: lib/Varien/Data/Form/Element/Fieldset.php - - - rawMessage: 'Parameter #1 $idSuffix of method Varien_Data_Form_Element_Abstract::getLabelHtml() expects string, int given.' - identifier: argument.type - count: 1 - path: lib/Varien/Data/Form/Element/Multiline.php - - rawMessage: 'Parameter #1 $index of method Varien_Data_Form_Element_Abstract::getEscapedValue() expects string|null, int<0, max> given.' identifier: argument.type count: 2 path: lib/Varien/Data/Form/Element/Multiline.php - - - rawMessage: 'Parameter #1 $suffix (int) of method Varien_Data_Form_Element_Multiline::getLabelHtml() should be compatible with parameter $idSuffix (string) of method Varien_Data_Form_Element_Abstract::getLabelHtml()' - identifier: method.childParameterType - count: 1 - path: lib/Varien/Data/Form/Element/Multiline.php - - rawMessage: 'Method Varien_Data_Tree::load() invoked with 2 parameters, 0-1 required.' identifier: arguments.count diff --git a/README.md b/README.md index 7fe8b33ec1a..10918b324b2 100644 --- a/README.md +++ b/README.md @@ -277,7 +277,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Den Isahac

lc-excell

Warley Elias
-
vernad
+
vernard
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php index 23861e57744..59086e3273f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php @@ -487,7 +487,7 @@ public function formatPrice($price) /** * Retrieve source * - * @return Mage_Sales_Model_Order_Invoice + * @return Mage_Sales_Model_Abstract */ public function getSource() { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php index 7ea2a821d1f..4a1ae1b4f5a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php @@ -33,7 +33,9 @@ protected function _getCollectionClass() protected function _prepareCollection() { - $collection = Mage::getResourceModel($this->_getCollectionClass()) + /** @var Mage_Sales_Model_Resource_Order_Creditmemo_Grid_Collection $collection */ + $collection = Mage::getResourceModel($this->_getCollectionClass()); + $collection ->addFieldToSelect('entity_id') ->addFieldToSelect('created_at') ->addFieldToSelect('increment_id') diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php index 1c0b50a10c2..854140f4085 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php @@ -33,7 +33,9 @@ protected function _getCollectionClass() protected function _prepareCollection() { - $collection = Mage::getResourceModel($this->_getCollectionClass()) + /** @var Mage_Sales_Model_Resource_Order_Invoice_Grid_Collection $collection */ + $collection = Mage::getResourceModel($this->_getCollectionClass()); + $collection ->addFieldToSelect('entity_id') ->addFieldToSelect('created_at') ->addFieldToSelect('order_id') diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php index c3cf204f6e1..b38baffcba6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php @@ -33,7 +33,9 @@ protected function _getCollectionClass() protected function _prepareCollection() { - $collection = Mage::getResourceModel($this->_getCollectionClass()) + /** @var Mage_Sales_Model_Resource_Order_Shipment_Grid_Collection $collection */ + $collection = Mage::getResourceModel($this->_getCollectionClass()); + $collection ->addFieldToSelect('entity_id') ->addFieldToSelect('created_at') ->addFieldToSelect('increment_id') diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php index bfc7d38ffc5..ec171f2dab9 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php @@ -82,7 +82,7 @@ protected function _initInvoice($update = false) protected function _saveInvoice($invoice) { $invoice->getOrder()->setIsInProcess(true); - $transactionSave = Mage::getModel('core/resource_transaction') + Mage::getModel('core/resource_transaction') ->addObject($invoice) ->addObject($invoice->getOrder()) ->save(); diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php index 08f43fb3db3..8384ca5b2e8 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php @@ -101,7 +101,7 @@ protected function _initShipment() protected function _saveShipment($shipment) { $shipment->getOrder()->setIsInProcess(true); - $transactionSave = Mage::getModel('core/resource_transaction') + Mage::getModel('core/resource_transaction') ->addObject($shipment) ->addObject($shipment->getOrder()) ->save(); diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php index 5819e981107..344f8de2804 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php @@ -275,7 +275,7 @@ public function getJsonConfig() /** * Validating of super product option value * - * @param array $attributeId + * @param string $attributeId * @param array $value * @param array $options * @return bool diff --git a/app/code/core/Mage/CatalogIndex/Model/Retreiver.php b/app/code/core/Mage/CatalogIndex/Model/Retreiver.php index 29556863020..d5e3c42cfab 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Retreiver.php +++ b/app/code/core/Mage/CatalogIndex/Model/Retreiver.php @@ -81,9 +81,11 @@ protected function _construct() public function getRetreiver($type) { if (isset($this->_retreivers[$type])) { - return Mage::getSingleton($this->_retreivers[$type]); + /** @var false|Mage_CatalogIndex_Model_Data_Abstract $model */ + $model = Mage::getSingleton($this->_retreivers[$type]); + return $model; } else { - Mage::throwException("Data retreiver for '{$type}' is not defined"); + Mage::throwException("Data retreiver for '$type' is not defined"); } } diff --git a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php index 6dfb7ab32a3..0dc59b79b60 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php +++ b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php @@ -70,7 +70,7 @@ public function _toHtml() { if (!$this->getOptions()) { if ($this->_addGroupAllOption) { - $this->addOption(Mage_Customer_Model_Group::CUST_GROUP_ALL, Mage::helper('customer')->__('ALL GROUPS')); + $this->addOption((string) Mage_Customer_Model_Group::CUST_GROUP_ALL, Mage::helper('customer')->__('ALL GROUPS')); } foreach ($this->_getCustomerGroups() as $groupId => $groupLabel) { diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 0811cd3feaa..66c20ddcfd0 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -281,7 +281,7 @@ public function splitWords($str, $uniqueOnly = false, $maxWordLength = 0, $wordS /** * Clean non UTF-8 characters * - * @param string $string + * @param null|string $string * @return string */ public function cleanString($string) diff --git a/app/code/core/Mage/Paypal/Model/Method/Agreement.php b/app/code/core/Mage/Paypal/Model/Method/Agreement.php index 1b0327721a3..e63d14d4e8b 100644 --- a/app/code/core/Mage/Paypal/Model/Method/Agreement.php +++ b/app/code/core/Mage/Paypal/Model/Method/Agreement.php @@ -59,7 +59,7 @@ class Mage_Paypal_Model_Method_Agreement extends Mage_Sales_Model_Payment_Method public function __construct($params = []) { $proInstance = array_shift($params); - if ($proInstance && ($proInstance instanceof Mage_Paypal_Model_Pro)) { + if ($proInstance instanceof Mage_Paypal_Model_Pro) { $this->_pro = $proInstance; } else { $this->_pro = Mage::getModel('paypal/pro'); @@ -286,6 +286,7 @@ public function fetchTransactionInfo(Mage_Payment_Model_Info $payment, $transact protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount) { $order = $payment->getOrder(); + /** @var Mage_Sales_Model_Billing_Agreement $billingAgreement */ $billingAgreement = Mage::getModel('sales/billing_agreement')->load( $payment->getAdditionalInformation( Mage_Sales_Model_Payment_Method_Billing_AgreementAbstract::TRANSPORT_BILLING_AGREEMENT_ID, diff --git a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php index 0e759359469..4e30ebe9940 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php @@ -791,7 +791,7 @@ protected function _initInitialFieldsToSelect() */ public function addCreateAtPeriodFilter($period) { - [$from, $to] = $this->getDateRange($period, 0, 0, true); + [$from, $to] = $this->getDateRange($period, '0', '0', true); $this->checkIsLive($period); diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php index 6a5a191329c..2d179205ad0 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php @@ -31,8 +31,8 @@ protected function _joinFields($from = '', $to = '') } /** - * @param int $from - * @param int $to + * @param string $from + * @param string $to * @return $this */ public function setDateRange($from, $to) diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php index 5c72615592c..5ce921b9b8c 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php @@ -28,8 +28,8 @@ protected function _construct() /** * Set Date range to collection * - * @param int $from - * @param int $to + * @param string $from + * @param string $to * @return $this */ public function setDateRange($from, $to) diff --git a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php index f234263c9fa..c2b8984bc4c 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php @@ -57,7 +57,7 @@ protected function _construct() * Prepare for abandoned report * * @param array $storeIds - * @param string $filter + * @param array $filter * @return $this */ public function prepareForAbandonedReport($storeIds, $filter = null) diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php index 78ade49eefe..2fd9ca47458 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php @@ -143,7 +143,7 @@ public function create($orderIncrementId, $itemsQty = [], $comment = null, $emai $invoice->getOrder()->setIsInProcess(true); try { - $transactionSave = Mage::getModel('core/resource_transaction') + Mage::getModel('core/resource_transaction') ->addObject($invoice) ->addObject($invoice->getOrder()) ->save(); @@ -209,7 +209,7 @@ public function capture($invoiceIncrementId) try { $invoice->capture(); $invoice->getOrder()->setIsInProcess(true); - $transactionSave = Mage::getModel('core/resource_transaction') + Mage::getModel('core/resource_transaction') ->addObject($invoice) ->addObject($invoice->getOrder()) ->save(); @@ -225,7 +225,7 @@ public function capture($invoiceIncrementId) /** * Void invoice * - * @param int $invoiceIncrementId + * @param string $invoiceIncrementId * @throws Mage_Api_Exception * @return bool */ @@ -246,7 +246,7 @@ public function void($invoiceIncrementId) try { $invoice->void(); $invoice->getOrder()->setIsInProcess(true); - $transactionSave = Mage::getModel('core/resource_transaction') + Mage::getModel('core/resource_transaction') ->addObject($invoice) ->addObject($invoice->getOrder()) ->save(); @@ -282,7 +282,7 @@ public function cancel($invoiceIncrementId) try { $invoice->cancel(); $invoice->getOrder()->setIsInProcess(true); - $transactionSave = Mage::getModel('core/resource_transaction') + Mage::getModel('core/resource_transaction') ->addObject($invoice) ->addObject($invoice->getOrder()) ->save(); diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php index 20059dd495f..2c3b84317c2 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php @@ -136,7 +136,7 @@ public function create( $shipment->getOrder()->setIsInProcess(true); try { - $transactionSave = Mage::getModel('core/resource_transaction') + Mage::getModel('core/resource_transaction') ->addObject($shipment) ->addObject($shipment->getOrder()) ->save(); diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php index 2c7ab27c119..f45f4c57a54 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php @@ -74,7 +74,7 @@ public function create( $shipment->getOrder()->setIsInProcess(true); try { - $transactionSave = Mage::getModel('core/resource_transaction') + Mage::getModel('core/resource_transaction') ->addObject($shipment) ->addObject($shipment->getOrder()) ->save(); diff --git a/app/code/core/Mage/Sales/Model/Quote.php b/app/code/core/Mage/Sales/Model/Quote.php index 1fd79f72310..63e2d5d0d98 100644 --- a/app/code/core/Mage/Sales/Model/Quote.php +++ b/app/code/core/Mage/Sales/Model/Quote.php @@ -178,7 +178,7 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract /** * Quote addresses collection * - * @var null|Mage_Sales_Model_Resource_Order_Address_Collection + * @var null|Mage_Sales_Model_Resource_Quote_Address_Collection */ protected $_addresses = null; @@ -275,7 +275,7 @@ public function setStore(Mage_Core_Model_Store $store) public function getSharedStoreIds() { $ids = $this->_getData('shared_store_ids'); - if (is_null($ids) || !is_array($ids)) { + if (!is_array($ids)) { if ($website = $this->getWebsite()) { return $website->getStoreIds(); } @@ -539,7 +539,7 @@ public function getCustomerTaxClassId() /** * Retrieve quote address collection * - * @return Mage_Sales_Model_Resource_Order_Address_Collection + * @return Mage_Sales_Model_Resource_Quote_Address_Collection */ public function getAddressesCollection() { @@ -1827,8 +1827,8 @@ public function isVirtual() { $isVirtual = true; $countItems = 0; + /** @var Mage_Sales_Model_Quote_Item $item */ foreach ($this->getItemsCollection() as $item) { - /** @var Mage_Sales_Model_Quote_Item $item */ if ($item->isDeleted() || $item->getParentItemId()) { continue; } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Item.php b/app/code/core/Mage/Sales/Model/Quote/Address/Item.php index fb5bacd5218..f0e0cfff3a4 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Item.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Item.php @@ -195,7 +195,7 @@ public function importQuoteItem(Mage_Sales_Model_Quote_Item $quoteItem) public function getOptionBycode($code) { if ($this->getQuoteItem()) { - return $this->getQuoteItem()->getOptionBycode($code); + return $this->getQuoteItem()->getOptionByCode($code); } return null; diff --git a/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php b/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php index da5594f4e4b..a4490957316 100644 --- a/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php +++ b/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php @@ -189,6 +189,7 @@ protected function _initAgreement() $billingAgreement = false; if ($agreementId) { + /** @var Mage_Sales_Model_Billing_Agreement $billingAgreement */ $billingAgreement = Mage::getModel('sales/billing_agreement')->load($agreementId); if (!$billingAgreement->getAgreementId()) { $this->_getSession()->addError($this->__('Wrong billing agreement ID specified.')); diff --git a/lib/Varien/Data/Form/Element/Multiline.php b/lib/Varien/Data/Form/Element/Multiline.php index e385c950fad..e37efc8dcc7 100644 --- a/lib/Varien/Data/Form/Element/Multiline.php +++ b/lib/Varien/Data/Form/Element/Multiline.php @@ -35,12 +35,12 @@ public function getHtmlAttributes() } /** - * @param int $suffix + * @param string $idSuffix * @return string */ - public function getLabelHtml($suffix = 0) + public function getLabelHtml($idSuffix = '0') { - return parent::getLabelHtml($suffix); + return parent::getLabelHtml($idSuffix); } /** diff --git a/lib/Varien/Db/Adapter/Interface.php b/lib/Varien/Db/Adapter/Interface.php index 29626e0512a..ffafa8597f3 100644 --- a/lib/Varien/Db/Adapter/Interface.php +++ b/lib/Varien/Db/Adapter/Interface.php @@ -787,7 +787,7 @@ public function getCaseSql($valueName, $casesResults, $defaultValue = null); * Returns valid IFNULL expression * * @param string $expression - * @param string $value OPTIONAL. Applies when $expression is NULL + * @param int|string $value OPTIONAL. Applies when $expression is NULL * @return Zend_Db_Expr */ public function getIfNullSql($expression, $value = '0');