Skip to content

Commit 461b77b

Browse files
committed
PhpStan: docblock fixes
1 parent 1993b08 commit 461b77b

File tree

25 files changed

+45
-179
lines changed

25 files changed

+45
-179
lines changed

.phpstan.dist.baseline.neon

Lines changed: 0 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,6 @@ parameters:
198198
count: 1
199199
path: app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php
200200

201-
-
202-
rawMessage: 'Parameter #2 $filter of method Mage_Reports_Model_Resource_Quote_Collection::prepareForAbandonedReport() expects string|null, array<int|string, array<mixed>|string> given.'
203-
identifier: argument.type
204-
count: 1
205-
path: app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php
206-
207201
-
208202
rawMessage: 'Parameter #1 $statusCode of method Mage_Tag_Model_Resource_Popular_Collection::addStatusFilter() expects string, int given.'
209203
identifier: argument.type
@@ -246,24 +240,6 @@ parameters:
246240
count: 3
247241
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php
248242

249-
-
250-
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()'
251-
identifier: method.childReturnType
252-
count: 1
253-
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php
254-
255-
-
256-
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()'
257-
identifier: method.childReturnType
258-
count: 1
259-
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php
260-
261-
-
262-
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()'
263-
identifier: method.childReturnType
264-
count: 1
265-
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php
266-
267243
-
268244
rawMessage: 'Call to an undefined method Mage_Shipping_Model_Carrier_Abstract::isGirthAllowed().'
269245
identifier: method.notFound
@@ -276,12 +252,6 @@ parameters:
276252
count: 1
277253
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php
278254

279-
-
280-
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()'
281-
identifier: method.childReturnType
282-
count: 1
283-
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php
284-
285255
-
286256
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.'
287257
identifier: argument.type
@@ -300,24 +270,6 @@ parameters:
300270
count: 1
301271
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php
302272

303-
-
304-
rawMessage: 'Call to an undefined method Mage_Core_Model_Resource_Db_Collection_Abstract::setOrderFilter().'
305-
identifier: method.notFound
306-
count: 1
307-
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php
308-
309-
-
310-
rawMessage: 'Call to an undefined method Mage_Core_Model_Resource_Db_Collection_Abstract::setOrderFilter().'
311-
identifier: method.notFound
312-
count: 1
313-
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php
314-
315-
-
316-
rawMessage: 'Call to an undefined method Mage_Core_Model_Resource_Db_Collection_Abstract::setOrderFilter().'
317-
identifier: method.notFound
318-
count: 1
319-
path: app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php
320-
321273
-
322274
rawMessage: 'Parameter #1 $order of method Mage_Sales_Helper_Reorder::canReorder() expects Mage_Sales_Model_Order, Varien_Object given.'
323275
identifier: argument.type
@@ -1236,12 +1188,6 @@ parameters:
12361188
count: 1
12371189
path: app/code/core/Mage/Catalog/Block/Product/View/Attributes.php
12381190

1239-
-
1240-
rawMessage: Invalid array key type array.
1241-
identifier: offsetAccess.invalidOffset
1242-
count: 1
1243-
path: app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php
1244-
12451191
-
12461192
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()'
12471193
identifier: method.childParameterType
@@ -2028,12 +1974,6 @@ parameters:
20281974
count: 1
20291975
path: app/code/core/Mage/CatalogIndex/Model/Resource/Setup.php
20301976

2031-
-
2032-
rawMessage: 'Parameter #1 $value of method Mage_Core_Block_Html_Select::addOption() expects string, int given.'
2033-
identifier: argument.type
2034-
count: 1
2035-
path: app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php
2036-
20371977
-
20381978
rawMessage: 'Cannot call method setTypeId() on Mage_Core_Model_Resource_Db_Collection_Abstract|false.'
20391979
identifier: method.nonObject
@@ -3858,12 +3798,6 @@ parameters:
38583798
count: 1
38593799
path: app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php
38603800

3861-
-
3862-
rawMessage: 'Parameter #2 $value of method Varien_Db_Adapter_Interface::getIfNullSql() expects string, int given.'
3863-
identifier: argument.type
3864-
count: 4
3865-
path: app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php
3866-
38673801
-
38683802
rawMessage: 'Property Mage_Reports_Model_Resource_Entity_Summary_Collection_Abstract::$_entityCollection (Mage_Eav_Model_Entity_Collection_Abstract) in empty() is not falsy.'
38693803
identifier: empty.property
@@ -3882,66 +3816,12 @@ parameters:
38823816
count: 1
38833817
path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php
38843818

3885-
-
3886-
rawMessage: 'Parameter #2 $customStart of method Mage_Reports_Model_Resource_Order_Collection::getDateRange() expects string, int given.'
3887-
identifier: argument.type
3888-
count: 1
3889-
path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php
3890-
38913819
-
38923820
rawMessage: 'Parameter #2 $interval of method Varien_Db_Adapter_Interface::getDateAddSql() expects int, string given.'
38933821
identifier: argument.type
38943822
count: 1
38953823
path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php
38963824

3897-
-
3898-
rawMessage: 'Parameter #2 $value of method Varien_Db_Adapter_Interface::getIfNullSql() expects string, int given.'
3899-
identifier: argument.type
3900-
count: 20
3901-
path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php
3902-
3903-
-
3904-
rawMessage: 'Parameter #3 $customEnd of method Mage_Reports_Model_Resource_Order_Collection::getDateRange() expects string, int given.'
3905-
identifier: argument.type
3906-
count: 1
3907-
path: app/code/core/Mage/Reports/Model/Resource/Order/Collection.php
3908-
3909-
-
3910-
rawMessage: 'Parameter #1 $from of method Mage_Reports_Model_Resource_Product_Ordered_Collection::_joinFields() expects string, int given.'
3911-
identifier: argument.type
3912-
count: 1
3913-
path: app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php
3914-
3915-
-
3916-
rawMessage: 'Parameter #2 $to of method Mage_Reports_Model_Resource_Product_Ordered_Collection::_joinFields() expects string, int given.'
3917-
identifier: argument.type
3918-
count: 1
3919-
path: app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php
3920-
3921-
-
3922-
rawMessage: 'Parameter #1 $from of method Mage_Reports_Model_Resource_Product_Collection::addOrderedQty() expects string, int given.'
3923-
identifier: argument.type
3924-
count: 1
3925-
path: app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php
3926-
3927-
-
3928-
rawMessage: 'Parameter #2 $to of method Mage_Reports_Model_Resource_Product_Collection::addOrderedQty() expects string, int given.'
3929-
identifier: argument.type
3930-
count: 1
3931-
path: app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php
3932-
3933-
-
3934-
rawMessage: 'Parameter #1 $filter of method Mage_Reports_Model_Resource_Quote_Collection::addCustomerData() expects array|null, string|null given.'
3935-
identifier: argument.type
3936-
count: 1
3937-
path: app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php
3938-
3939-
-
3940-
rawMessage: 'Parameter #2 $filter of method Mage_Reports_Model_Resource_Quote_Collection::addSubtotal() expects array|null, string|null given.'
3941-
identifier: argument.type
3942-
count: 1
3943-
path: app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php
3944-
39453825
-
39463826
rawMessage: 'Parameter #3 $cols of method Zend_Db_Select::joinInner() expects array|string, null given.'
39473827
identifier: argument.type
@@ -4110,12 +3990,6 @@ parameters:
41103990
count: 1
41113991
path: app/code/core/Mage/Sales/Model/Order/Creditmemo.php
41123992

4113-
-
4114-
rawMessage: 'Parameter #1 $incrementId of method Mage_Sales_Model_Order_Invoice::loadByIncrementId() expects string, int given.'
4115-
identifier: argument.type
4116-
count: 1
4117-
path: app/code/core/Mage/Sales/Model/Order/Invoice/Api.php
4118-
41193993
-
41203994
rawMessage: 'Call to an undefined method Mage_Catalog_Model_Product_Type_Abstract::getForceApplyDiscountToParentItem().'
41213995
identifier: method.notFound
@@ -4260,12 +4134,6 @@ parameters:
42604134
count: 1
42614135
path: app/code/core/Mage/Sales/Model/Quote.php
42624136

4263-
-
4264-
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.'
4265-
identifier: assign.propertyType
4266-
count: 1
4267-
path: app/code/core/Mage/Sales/Model/Quote.php
4268-
42694137
-
42704138
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.'
42714139
identifier: return.type
@@ -5844,24 +5712,12 @@ parameters:
58445712
count: 1
58455713
path: lib/Varien/Data/Form/Element/Fieldset.php
58465714

5847-
-
5848-
rawMessage: 'Parameter #1 $idSuffix of method Varien_Data_Form_Element_Abstract::getLabelHtml() expects string, int given.'
5849-
identifier: argument.type
5850-
count: 1
5851-
path: lib/Varien/Data/Form/Element/Multiline.php
5852-
58535715
-
58545716
rawMessage: 'Parameter #1 $index of method Varien_Data_Form_Element_Abstract::getEscapedValue() expects string|null, int<0, max> given.'
58555717
identifier: argument.type
58565718
count: 2
58575719
path: lib/Varien/Data/Form/Element/Multiline.php
58585720

5859-
-
5860-
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()'
5861-
identifier: method.childParameterType
5862-
count: 1
5863-
path: lib/Varien/Data/Form/Element/Multiline.php
5864-
58655721
-
58665722
rawMessage: 'Method Varien_Data_Tree::load() invoked with 2 parameters, 0-1 required.'
58675723
identifier: arguments.count

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
277277
<td align="center" valign="top" width="14.28%"><a href="http://www.denisahac.xyz"><img src="https://avatars.githubusercontent.com/u/6700576?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Den Isahac</b></sub></a></td>
278278
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lc-excell"><img src="https://avatars.githubusercontent.com/u/158118232?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>lc-excell</b></sub></a></td>
279279
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/warley-elias-531a4116/"><img src="https://avatars.githubusercontent.com/u/5356619?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Warley Elias</b></sub></a></td>
280-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vernad"><img src="https://avatars.githubusercontent.com/u/51973447?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>vernad</b></sub></a></td>
280+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vernard"><img src="https://avatars.githubusercontent.com/u/6733673?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>vernard</b></sub></a></td>
281281
</tr>
282282
</tbody>
283283
</table>

app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ public function formatPrice($price)
487487
/**
488488
* Retrieve source
489489
*
490-
* @return Mage_Sales_Model_Order_Invoice
490+
* @return Mage_Sales_Model_Abstract
491491
*/
492492
public function getSource()
493493
{

app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ protected function _getCollectionClass()
3333

3434
protected function _prepareCollection()
3535
{
36-
$collection = Mage::getResourceModel($this->_getCollectionClass())
36+
/** @var Mage_Sales_Model_Resource_Order_Creditmemo_Grid_Collection $collection */
37+
$collection = Mage::getResourceModel($this->_getCollectionClass());
38+
$collection
3739
->addFieldToSelect('entity_id')
3840
->addFieldToSelect('created_at')
3941
->addFieldToSelect('increment_id')

app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ protected function _getCollectionClass()
3333

3434
protected function _prepareCollection()
3535
{
36-
$collection = Mage::getResourceModel($this->_getCollectionClass())
36+
/** @var Mage_Sales_Model_Resource_Order_Invoice_Grid_Collection $collection */
37+
$collection = Mage::getResourceModel($this->_getCollectionClass());
38+
$collection
3739
->addFieldToSelect('entity_id')
3840
->addFieldToSelect('created_at')
3941
->addFieldToSelect('order_id')

app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ protected function _getCollectionClass()
3333

3434
protected function _prepareCollection()
3535
{
36-
$collection = Mage::getResourceModel($this->_getCollectionClass())
36+
/** @var Mage_Sales_Model_Resource_Order_Shipment_Grid_Collection $collection */
37+
$collection = Mage::getResourceModel($this->_getCollectionClass());
38+
$collection
3739
->addFieldToSelect('entity_id')
3840
->addFieldToSelect('created_at')
3941
->addFieldToSelect('increment_id')

app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function _initInvoice($update = false)
8282
protected function _saveInvoice($invoice)
8383
{
8484
$invoice->getOrder()->setIsInProcess(true);
85-
$transactionSave = Mage::getModel('core/resource_transaction')
85+
Mage::getModel('core/resource_transaction')
8686
->addObject($invoice)
8787
->addObject($invoice->getOrder())
8888
->save();

app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function _initShipment()
101101
protected function _saveShipment($shipment)
102102
{
103103
$shipment->getOrder()->setIsInProcess(true);
104-
$transactionSave = Mage::getModel('core/resource_transaction')
104+
Mage::getModel('core/resource_transaction')
105105
->addObject($shipment)
106106
->addObject($shipment->getOrder())
107107
->save();

app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public function getJsonConfig()
275275
/**
276276
* Validating of super product option value
277277
*
278-
* @param array $attributeId
278+
* @param string $attributeId
279279
* @param array $value
280280
* @param array $options
281281
* @return bool

app/code/core/Mage/CatalogIndex/Model/Retreiver.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ protected function _construct()
8181
public function getRetreiver($type)
8282
{
8383
if (isset($this->_retreivers[$type])) {
84-
return Mage::getSingleton($this->_retreivers[$type]);
84+
/** @var false|Mage_CatalogIndex_Model_Data_Abstract $model */
85+
$model = Mage::getSingleton($this->_retreivers[$type]);
86+
return $model;
8587
} else {
86-
Mage::throwException("Data retreiver for '{$type}' is not defined");
88+
Mage::throwException("Data retreiver for '$type' is not defined");
8789
}
8890
}
8991

0 commit comments

Comments
 (0)