Skip to content

Commit bce5179

Browse files
committed
PHPStan Baseline: Misc
1 parent f064380 commit bce5179

File tree

13 files changed

+27
-73
lines changed

13 files changed

+27
-73
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Adminhtml
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2020-2023 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -39,7 +39,7 @@ public function getFormHtml(Varien_Object $entity, $entityType = 'quote')
3939
*/
4040
public function getItems()
4141
{
42-
if (!$this->isOutputEnabled('Mage_GiftMessage')) {
42+
if (!$this->isModuleOutputEnabled('Mage_GiftMessage')) {
4343
return false;
4444
}
4545

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Adminhtml
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2021-2024 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -37,7 +37,8 @@ public function getHeaderText()
3737
#[\Override]
3838
protected function _toHtml()
3939
{
40-
if (!Mage::getSingleton('adminhtml/quote')->getIsOldCustomer()) {
40+
$subscription = Mage::getModel('newsletter/subscriber')->loadByCustomer($this->getCustomer());
41+
if (!$subscription->isSubscribed()) {
4142
return parent::_toHtml();
4243
}
4344
return '';

app/code/core/Mage/Adminhtml/Block/System/Config/Form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Adminhtml
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2016-2024 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -511,7 +511,7 @@ protected function _prepareFieldComment($element, $helper, $currentValue)
511511
if (is_array($commentInfo)) {
512512
if (isset($commentInfo['model'])) {
513513
$model = Mage::getModel($commentInfo['model']);
514-
if (method_exists($model, 'getCommentText')) {
514+
if ($model && method_exists($model, 'getCommentText')) {
515515
$comment = $model->getCommentText($element, $currentValue);
516516
}
517517
}

app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ public function createOrder()
15421542
}
15431543

15441544
/** @var Mage_Sales_Model_Order $order */
1545-
$order = $service->submit();
1545+
$order = $service->submitOrder();
15461546
$customer = $quote->getCustomer();
15471547
if ((!$customer->getId() || !$customer->isInStore($this->getSession()->getStore()))
15481548
&& !$quote->getCustomerIsGuest()

app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Adminhtml
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -255,25 +255,6 @@ public function newConditionHtmlAction()
255255
$this->getResponse()->setBody($html);
256256
}
257257

258-
public function chooserAction()
259-
{
260-
switch ($this->getRequest()->getParam('attribute')) {
261-
case 'sku':
262-
$type = 'adminhtml/promo_widget_chooser_sku';
263-
break;
264-
265-
case 'categories':
266-
$type = 'adminhtml/promo_widget_chooser_categories';
267-
break;
268-
}
269-
if (!empty($type)) {
270-
$block = $this->getLayout()->createBlock($type);
271-
if ($block) {
272-
$this->getResponse()->setBody($block->toHtml());
273-
}
274-
}
275-
}
276-
277258
public function newActionHtmlAction()
278259
{
279260
$id = $this->getRequest()->getParam('id');

app/code/core/Mage/Rating/Model/Resource/Rating/Option/Collection.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Rating
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2020-2024 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -17,14 +17,6 @@
1717
*/
1818
class Mage_Rating_Model_Resource_Rating_Option_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
1919
{
20-
/**
21-
* Rating options table
22-
*
23-
* @var string
24-
* @deprecated since 1.5.0.0
25-
*/
26-
protected $_ratingOptionTable;
27-
2820
/**
2921
* Rating votes table
3022
*
@@ -40,7 +32,6 @@ class Mage_Rating_Model_Resource_Rating_Option_Collection extends Mage_Core_Mode
4032
protected function _construct()
4133
{
4234
$this->_init('rating/rating_option');
43-
$this->_ratingOptionTable = $this->getTable('rating/rating_option');
4435
$this->_ratingVoteTable = $this->getTable('rating/rating_option_vote');
4536
}
4637

app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Reports
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2015-2024 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -61,7 +61,7 @@ protected function _construct()
6161
* Prepare for abandoned report
6262
*
6363
* @param array $storeIds
64-
* @param string $filter
64+
* @param array $filter
6565
* @return $this
6666
*/
6767
public function prepareForAbandonedReport($storeIds, $filter = null)

app/code/core/Mage/Reports/Model/Resource/Tag/Product/Collection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Reports
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -78,7 +78,7 @@ public function addGroupByProduct()
7878
{
7979
$this->getSelect()
8080
->group('relation.product_id');
81-
$this->setJoinFlag('distinct');
81+
$this->setFlag('distinct', true);
8282
return $this;
8383
}
8484

@@ -92,8 +92,8 @@ public function addGroupByTag()
9292
{
9393
$this->getSelect()
9494
->group('relation.tag_id');
95-
$this->setJoinFlag('distinct');
96-
$this->setJoinFlag('group_tag');
95+
$this->setFlag('distinct', true);
96+
$this->setFlag('group_tag', true);
9797
return $this;
9898
}
9999

app/code/core/Mage/Shipping/Helper/Data.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @package Mage_Shipping
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2020-2024 The OpenMage Contributors (https://openmage.org)
9+
* @copyright Copyright (c) 2025 Maho (https://mahocommerce.com)
910
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1011
*/
1112

@@ -41,26 +42,17 @@ public function decodeTrackingHash($hash)
4142
/**
4243
* Retrieve tracking url with params
4344
*
44-
* @deprecated the non-model usage
45-
*
4645
* @param string $key
4746
* @param int|Mage_Sales_Model_Order|Mage_Sales_Model_Order_Shipment|Mage_Sales_Model_Order_Shipment_Track $model
4847
* @param string $method - option
4948
* @return string
5049
*/
5150
protected function _getTrackingUrl($key, $model, $method = 'getId')
5251
{
53-
if (empty($model)) {
54-
$param = [$key => '']; // @deprecated after 1.4.0.0-alpha3
55-
} elseif (!is_object($model)) {
56-
$param = [$key => $model]; // @deprecated after 1.4.0.0-alpha3
57-
} else {
58-
$param = [
59-
'hash' => Mage::helper('core')->urlEncode("{$key}:{$model->$method()}:{$model->getProtectCode()}"),
60-
];
61-
}
62-
$storeId = is_object($model) ? $model->getStoreId() : null;
63-
$storeModel = Mage::app()->getStore($storeId);
52+
$param = [
53+
'hash' => Mage::helper('core')->urlEncode("{$key}:{$model->$method()}:{$model->getProtectCode()}"),
54+
];
55+
$storeModel = Mage::app()->getStore($model->getStoreId());
6456
return $storeModel->getUrl('shipping/tracking/popup', $param);
6557
}
6658

app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Shipping
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -17,14 +17,6 @@
1717
*/
1818
class Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
1919
{
20-
/**
21-
* main table name
22-
*
23-
* @deprecated since 1.4.1.0
24-
* @var string
25-
*/
26-
protected $_shipTable;
27-
2820
/**
2921
* directory/country table name
3022
*
@@ -47,7 +39,6 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection extends Mage_Cor
4739
protected function _construct()
4840
{
4941
$this->_init('shipping/carrier_tablerate');
50-
$this->_shipTable = $this->getMainTable();
5142
$this->_countryTable = $this->getTable('directory/country');
5243
$this->_regionTable = $this->getTable('directory/country_region');
5344
}

app/code/core/Mage/Tag/Block/Customer/View.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Tag
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -137,8 +137,6 @@ protected function _getCollection()
137137
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
138138
->setActiveFilter();
139139

140-
Mage::getSingleton('catalog/product_status')
141-
->addVisibleFilterToCollection($this->_collection);
142140
Mage::getSingleton('catalog/product_visibility')
143141
->addVisibleInSiteFilterToCollection($this->_collection);
144142
}

app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @package Mage_Usa
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
88
* @copyright Copyright (c) 2018-2024 The OpenMage Contributors (https://openmage.org)
9-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
9+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
1212

@@ -397,7 +397,7 @@ public function getAllowedMethods()
397397
/**
398398
* Get configuration data of carrier
399399
*
400-
* @param strin $type
400+
* @param string $type
401401
* @param string $code
402402
* @return array|string|false
403403
*/

app/design/adminhtml/default/default/template/customer/tab/newsletter.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* @package default_default
66
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
77
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://openmage.org)
8-
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
8+
* @copyright Copyright (c) 2024-2025 Maho (https://mahocommerce.com)
99
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
1010
*/
1111

1212
/** @var Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter $this */
1313
?>
1414
<div class="entry-edit">
15-
<?= $this->getFormObject()->getHtml() ?>
15+
<?= $this->getForm()->getHtml() ?>
1616
</div>
1717
<?= $this->getChildHtml('grid') ?>

0 commit comments

Comments
 (0)