Skip to content

Commit 9582975

Browse files
committed
update
1 parent a0e0683 commit 9582975

File tree

112 files changed

+1613
-1571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1613
-1571
lines changed

.phpstan.dist.baseline.neon

Lines changed: 37 additions & 973 deletions
Large diffs are not rendered by default.

.vendor-patches/PHPSTAN-ZF1F.patch

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
--- /dev/null
2+
+++ ../library/Zend/Cache/Backend.php
3+
@@ -137,7 +137,7 @@
4+
* if $specificLifetime is not false, the given specific life time is used
5+
* else, the global lifetime is used
6+
*
7+
- * @param int $specificLifetime
8+
+ * @param false|int $specificLifetime
9+
* @return int Cache life time
10+
*/
11+
public function getLifetime($specificLifetime)
12+
13+
--- /dev/null
14+
+++ ../library/Zend/Controller/Response/Abstract.php
15+
@@ -454,7 +454,7 @@
16+
* $spec is a string and matches a named segment, returns the contents of
17+
* that segment; otherwise, returns null.
18+
*
19+
- * @param boolean $spec
20+
+ * @param bool|string $spec
21+
* @return string|array|null
22+
*/
23+
public function getBody($spec = false)
24+
25+
--- /dev/null
26+
+++ ../library/Zend/Currency.php
27+
@@ -138,8 +138,8 @@
28+
/**
29+
* Returns a localized currency string
30+
*
31+
- * @param integer|float $value OPTIONAL Currency value
32+
- * @param array $options OPTIONAL options to set temporary
33+
+ * @param array<int|float|string $value OPTIONAL Currency value
34+
+ * @param array $options OPTIONAL options to set temporary
35+
* @throws Zend_Currency_Exception When the value is not a number
36+
* @return string
37+
*/
38+
39+
--- /dev/null
40+
+++ ../library/Zend/Db/Select.php
41+
@@ -486,7 +486,7 @@
42+
* @param string $cond Join on this condition.
43+
* @param array|string $cols The columns to select from the joined table.
44+
* @param string $schema The database name to specify, if any.
45+
- * @return Zend_Db_Select This Zend_Db_Select object.
46+
+ * @return $this This Zend_Db_Select object.
47+
*/
48+
public function joinStraight($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
49+
{
50+
51+
--- /dev/null
52+
+++ ../library/Zend/Measure/Abstract.php
53+
@@ -75,7 +75,7 @@
54+
* Zend_Measure_Abstract is an abstract class for the different measurement types
55+
*
56+
* @param mixed $value Value as string, integer, real or float
57+
- * @param int $type OPTIONAL a measure type f.e. Zend_Measure_Length::METER
58+
+ * @param string $type OPTIONAL a measure type f.e. Zend_Measure_Length::METER
59+
* @param Zend_Locale $locale OPTIONAL a Zend_Locale Type
60+
* @throws Zend_Measure_Exception
61+
*/
62+
63+
--- /dev/null
64+
+++ ../library/Zend/Cache/Backend/Memcached.php
65+
@@ -205,10 +205,10 @@
66+
* Note : $data is always "string" (serialization is done by the
67+
* core not by the backend)
68+
*
69+
- * @param string $data Datas to cache
70+
- * @param string $id Cache id
71+
- * @param array $tags Array of strings, the cache record will be tagged by each string entry
72+
- * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
73+
+ * @param string $data Datas to cache
74+
+ * @param string $id Cache id
75+
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
76+
+ * @param false|int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
77+
* @return boolean True if no problem
78+
*/
79+
public function save($data, $id, $tags = [], $specificLifetime = false)
80+
81+
--- /dev/null
82+
+++ ../library/Zend/Translate.php
83+
@@ -63,7 +63,7 @@
84+
/**
85+
* Generates the standard translation object
86+
*
87+
- * @param array|Zend_Config|Zend_Translate_Adapter $options Options to use
88+
+ * @param array|string|Zend_Config|Zend_Translate_Adapter $options Options to use
89+
* @param string|array [$content] Path to content, or content itself
90+
* @param string|Zend_Locale [$locale]
91+
* @throws Zend_Translate_Exception

app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_View_Sales extends Mage_Adminhtml_B
1717
/**
1818
* Sales entity collection
1919
*
20-
* @var Mage_Sales_Model_Entity_Sale_Collection
20+
* @var Mage_Sales_Model_Resource_Sale_Collection
2121
*/
2222
protected $_collection;
2323

@@ -38,15 +38,21 @@ public function __construct()
3838
$this->setId('customer_view_sales_grid');
3939
}
4040

41+
/**
42+
* @throws Mage_Core_Exception
43+
* @throws Mage_Core_Model_Store_Exception
44+
*/
4145
public function _beforeToHtml()
4246
{
4347
$this->_currency = Mage::getModel('directory/currency')
4448
->load(Mage_Directory_Helper_Data::getConfigCurrencyBase());
4549

46-
$this->_collection = Mage::getResourceModel('sales/sale_collection')
50+
/** @var Mage_Sales_Model_Resource_Sale_Collection $model */
51+
$model = Mage::getResourceModel('sales/sale_collection')
4752
->setCustomerFilter(Mage::registry('current_customer'))
4853
->setOrderStateFilter(Mage_Sales_Model_Order::STATE_CANCELED, true)
4954
->load();
55+
$this->_collection = $model;
5056

5157
$this->_groupedCollection = [];
5258

app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,19 @@ public function format($price)
6565
* Setting currency model
6666
*
6767
* @param Mage_Directory_Model_Currency $currency
68+
* @return $this
6869
*/
6970
public function setCurrency($currency)
7071
{
7172
$this->_currency = $currency;
73+
return $this;
7274
}
7375

7476
/**
7577
* Retrieve currency model if not set then return currency model for current store
7678
*
7779
* @return Mage_Directory_Model_Currency
80+
* @throws Exception
7881
* @throws Mage_Core_Exception
7982
* @throws Mage_Core_Model_Store_Exception
8083
*/

app/code/core/Mage/Adminhtml/Block/Report/Grid.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ protected function _prepareColumns()
104104

105105
/**
106106
* @return $this
107+
* @throws Exception
107108
*/
108109
protected function _prepareCollection()
109110
{
@@ -304,6 +305,9 @@ public function getPeriods()
304305
return $this->getCollection()->getPeriods();
305306
}
306307

308+
/**
309+
* @throws Zend_Locale_Exception
310+
*/
307311
public function getDateFormat()
308312
{
309313
return $this->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
@@ -324,6 +328,9 @@ public function setFilter($name, $value)
324328
}
325329
}
326330

331+
/**
332+
* @throws Exception
333+
*/
327334
public function getFilter($name)
328335
{
329336
if (isset($this->_filters[$name])) {
@@ -363,7 +370,8 @@ public function getLocale()
363370
*
364371
* @param string $url
365372
* @param string $label
366-
* @return Mage_Adminhtml_Block_Widget_Grid
373+
* @return $this
374+
* @throws Exception
367375
*/
368376
public function addExportType($url, $label)
369377
{
@@ -382,6 +390,9 @@ public function addExportType($url, $label)
382390
return $this;
383391
}
384392

393+
/**
394+
* @throws Exception
395+
*/
385396
public function getReport($from, $to)
386397
{
387398
if ($from == '') {
@@ -413,11 +424,11 @@ public function addGrandTotals($total)
413424
*/
414425
foreach ($this->getColumns() as $key => $_column) {
415426
if ($_column->hasTotal() && str_contains($_column->getTotal(), '/')) {
416-
[$t1, $t2] = explode('/', $_column->getTotal());
417-
if ($this->getGrandTotals()->getData($t2) != 0) {
427+
[$total1, $total2] = explode('/', $_column->getTotal());
428+
if ($this->getGrandTotals()->getData($total2) != 0) {
418429
$this->getGrandTotals()->setData(
419430
$key,
420-
(float) $this->getGrandTotals()->getData($t1) / $this->getGrandTotals()->getData($t2),
431+
(float) $this->getGrandTotals()->getData($total1) / $this->getGrandTotals()->getData($total2),
421432
);
422433
}
423434
}
@@ -442,6 +453,8 @@ public function getPeriodText()
442453
* Retrieve grid as CSV
443454
*
444455
* @return string
456+
* @throws Exception
457+
* @throws Zend_Date_Exception
445458
*/
446459
public function getCsv()
447460
{
@@ -508,6 +521,8 @@ public function getCsv()
508521
* Retrieve grid as Excel Xml
509522
*
510523
* @return mixed
524+
* @throws Exception
525+
* @throws Zend_Date_Exception
511526
*/
512527
public function getExcel($filename = '')
513528
{
@@ -630,6 +645,7 @@ public function getErrors()
630645
* Retrieve correct currency code for select website, store, group
631646
*
632647
* @return string
648+
* @throws Exception
633649
*/
634650
public function getCurrentCurrencyCode()
635651
{
@@ -656,6 +672,7 @@ public function getCurrentCurrencyCode()
656672
*
657673
* @param Mage_Directory_Model_Currency|string $toCurrency
658674
* @return float
675+
* @throws Mage_Core_Exception
659676
*/
660677
public function getRate($toCurrency)
661678
{

app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* Adminhtml products report grid block
1212
*
1313
* @package Mage_Adminhtml
14+
*
15+
* @method Mage_Reports_Model_Resource_Report_Collection getCollection()
1416
*/
1517
class Mage_Adminhtml_Block_Report_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid
1618
{
@@ -28,6 +30,7 @@ public function __construct()
2830
*/
2931
protected function _prepareCollection()
3032
{
33+
/** @var Mage_Reports_Model_Resource_Product_Collection $collection */
3134
$collection = Mage::getResourceModel('reports/product_collection');
3235
$collection->getEntity()->setStore(0);
3336

app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99

1010
/**
1111
* @package Mage_Adminhtml
12+
*
13+
* @method Mage_Sales_Block_Order_Totals getParentBlock()
1214
*/
1315
class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Adjustments extends Mage_Adminhtml_Block_Template
1416
{
1517
/**
16-
* @var Mage_Sales_Model_Order_Creditmemo
18+
* @var Mage_Sales_Model_Abstract|Mage_Sales_Model_Order_Creditmemo
1719
*/
1820
protected $_source;
1921

@@ -38,7 +40,7 @@ public function initTotals()
3840
}
3941

4042
/**
41-
* @return Mage_Sales_Model_Order_Creditmemo
43+
* @return Mage_Sales_Model_Abstract
4244
*/
4345
public function getSource()
4446
{
@@ -47,7 +49,9 @@ public function getSource()
4749

4850
/**
4951
* Get credit memo shipping amount depend on configuration settings
52+
*
5053
* @return float
54+
* @throws Mage_Core_Model_Store_Exception
5155
*/
5256
public function getShippingAmount()
5357
{
@@ -59,7 +63,7 @@ public function getShippingAmount()
5963
$shipping = $source->getBaseShippingAmount();
6064
}
6165

62-
return Mage::app()->getStore()->roundPrice($shipping) * 1;
66+
return Mage::app()->getStore()->roundPrice($shipping);
6367
}
6468

6569
/**

app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Item.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* Totals item block
1212
*
1313
* @package Mage_Adminhtml
14+
*
15+
* @method Mage_Sales_Block_Order_Totals getParentBlock()
1416
*/
1517
class Mage_Adminhtml_Block_Sales_Order_Totals_Item extends Mage_Adminhtml_Block_Sales_Order_Totals
1618
{
@@ -84,7 +86,7 @@ public function displayPriceAttribute($code, $strong = false, $separator = '<br/
8486
/**
8587
* Source order getter
8688
*
87-
* @return Mage_Sales_Model_Order
89+
* @return Mage_Sales_Model_Abstract
8890
*/
8991
public function getSource()
9092
{

app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function canDisplayContainer()
5555
* Giftmessage object
5656
*
5757
* @deprecated after 1.4.2.0
58-
* @var Mage_GiftMessage_Model_Message
58+
* @var array|Mage_GiftMessage_Model_Message
5959
*/
6060
protected $_giftMessage = [];
6161

app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ class Mage_Adminhtml_Block_Sales_Reorder_Renderer_Action extends Mage_Adminhtml_
2121
*/
2222
protected $_actions = [];
2323

24+
/**
25+
* @param Mage_Sales_Model_Order $row
26+
* @throws Mage_Core_Exception
27+
*/
2428
public function render(Varien_Object $row)
2529
{
2630
$this->_actions = [];

0 commit comments

Comments
 (0)