Skip to content

Commit 706473d

Browse files
committed
1 parent d8c480e commit 706473d

File tree

210 files changed

+1009
-1250
lines changed

Some content is hidden

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

210 files changed

+1009
-1250
lines changed

.phpstan.baseline.neon

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,6 @@ parameters:
345345
count: 1
346346
path: app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php
347347

348-
-
349-
message: "#^Method Mage_Adminhtml_Model_Sales_Order_Create\\:\\:initFromOrderItem\\(\\) should return Mage_Sales_Model_Quote_Item\\|string but returns \\$this\\(Mage_Adminhtml_Model_Sales_Order_Create\\)\\.$#"
350-
count: 2
351-
path: app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
352-
353348
-
354349
message: "#^Variable \\$billingAddress might not be defined\\.$#"
355350
count: 2
@@ -760,16 +755,6 @@ parameters:
760755
count: 1
761756
path: app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php
762757

763-
-
764-
message: "#^Variable \\$_items might not be defined\\.$#"
765-
count: 1
766-
path: app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php
767-
768-
-
769-
message: "#^Variable \\$_items might not be defined\\.$#"
770-
count: 1
771-
path: app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php
772-
773758
-
774759
message: "#^Call to an undefined method Mage_Catalog_Model_Product_Configuration_Item_Interface\\:\\:getQty\\(\\)\\.$#"
775760
count: 1
@@ -845,11 +830,6 @@ parameters:
845830
count: 1
846831
path: app/code/core/Mage/Bundle/Model/Resource/Price/Index.php
847832

848-
-
849-
message: "#^Variable \\$_items might not be defined\\.$#"
850-
count: 1
851-
path: app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php
852-
853833
-
854834
message: "#^Argument of an invalid type string supplied for foreach, only iterables are supported\\.$#"
855835
count: 1
@@ -1210,11 +1190,6 @@ parameters:
12101190
count: 1
12111191
path: app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php
12121192

1213-
-
1214-
message: "#^Method Mage_Catalog_Model_Product_Option\\:\\:groupFactory\\(\\) should return Mage_Catalog_Model_Product_Option_Type_Default but returns Mage_Core_Model_Abstract\\|false\\.$#"
1215-
count: 1
1216-
path: app/code/core/Mage/Catalog/Model/Product/Option.php
1217-
12181193
-
12191194
message: "#^Call to an undefined method Mage_Catalog_Model_Product_Configuration_Item_Option_Interface\\:\\:getId\\(\\)\\.$#"
12201195
count: 2
@@ -1830,11 +1805,6 @@ parameters:
18301805
count: 1
18311806
path: app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
18321807

1833-
-
1834-
message: "#^Argument of an invalid type string supplied for foreach, only iterables are supported\\.$#"
1835-
count: 1
1836-
path: app/code/core/Mage/Core/Controller/Varien/Router/Standard.php
1837-
18381808
-
18391809
message: "#^Negated boolean expression is always true\\.$#"
18401810
count: 1
@@ -1935,11 +1905,6 @@ parameters:
19351905
count: 1
19361906
path: app/code/core/Mage/Core/Model/Design/Fallback.php
19371907

1938-
-
1939-
message: "#^Binary operation \"\\.\" between non\\-falsy\\-string and array results in an error\\.$#"
1940-
count: 1
1941-
path: app/code/core/Mage/Core/Model/Design/Package.php
1942-
19431908
-
19441909
message: "#^Property Mage_Core_Model_Design_Package\\:\\:\\$_store \\(int\\|Mage_Core_Model_Store\\|string\\) on left side of \\?\\? is not nullable\\.$#"
19451910
count: 1
@@ -2020,11 +1985,6 @@ parameters:
20201985
count: 1
20211986
path: app/code/core/Mage/Core/Model/Layout.php
20221987

2023-
-
2024-
message: "#^Method Mage_Core_Model_Layout_Update\\:\\:saveCache\\(\\) should return bool but returns Mage_Core_Model_App\\.$#"
2025-
count: 1
2026-
path: app/code/core/Mage/Core/Model/Layout/Update.php
2027-
20281988
-
20291989
message: "#^Call to an undefined method Mage_Core_Model_Resource_Type_Abstract\\:\\:getConnection\\(\\)\\.$#"
20301990
count: 1
@@ -3830,16 +3790,6 @@ parameters:
38303790
count: 2
38313791
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php
38323792

3833-
-
3834-
message: "#^Method Mage_Usa_Model_Shipping_Carrier_Dhl\\:\\:_doRequest\\(\\) should return Mage_Shipping_Model_Rate_Result\\|Varien_Object but empty return statement found\\.$#"
3835-
count: 1
3836-
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php
3837-
3838-
-
3839-
message: "#^Method Mage_Usa_Model_Shipping_Carrier_Dhl\\:\\:_getQuotes\\(\\) should return Mage_Shipping_Model_Rate_Result but returns Varien_Object\\.$#"
3840-
count: 1
3841-
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php
3842-
38433793
-
38443794
message: "#^Property Mage_Usa_Model_Shipping_Carrier_Dhl\\:\\:\\$_request \\(Mage_Shipping_Model_Rate_Request\\|null\\) does not accept Varien_Object\\.$#"
38453795
count: 1
@@ -3940,11 +3890,6 @@ parameters:
39403890
count: 2
39413891
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php
39423892

3943-
-
3944-
message: "#^Method Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page\\:\\:drawText\\(\\) should return \\$this\\(Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page\\) but returns Zend_Pdf_Canvas_Interface\\.$#"
3945-
count: 1
3946-
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php
3947-
39483893
-
39493894
message: "#^Call to an undefined method Zend_Pdf_Page\\:\\:drawLines\\(\\)\\.$#"
39503895
count: 5

app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @category Mage
66
* @package Mage_Adminhtml
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
8-
* @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://openmage.org)
8+
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://openmage.org)
99
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1010
*/
1111

@@ -23,11 +23,11 @@ public function __construct()
2323

2424
$resources = Mage::getModel('api/roles')->getResourcesList();
2525

26-
$rules_set = Mage::getResourceModel('api/rules_collection')->getByRoles($rid)->load();
26+
$rules = Mage::getResourceModel('api/rules_collection')->getByRoles($rid)->load();
2727

2828
$selrids = [];
2929

30-
foreach ($rules_set->getItems() as $item) {
30+
foreach ($rules->getItems() as $item) {
3131
if (array_key_exists(strtolower($item->getResource_id()), $resources)
3232
&& $item->getApiPermission() == 'allow'
3333
) {

app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public function __construct()
2525
->getCollection()
2626
->load();
2727

28-
$user_roles = Mage::getModel('api/roles')
28+
$userRoles = Mage::getModel('api/roles')
2929
->getUsersCollection()
3030
->setUserFilter($uid)
3131
->load();
3232

3333
$this->setTemplate('api/userroles.phtml')
3434
->assign('roles', $roles)
35-
->assign('user_roles', $user_roles);
35+
->assign('user_roles', $userRoles);
3636
}
3737
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ protected function _prepareColumns()
102102
*
103103
* @return string
104104
*/
105-
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed
106105
public function decorateStatus($value, $row, $column, $isExport)
107106
{
108107
$class = '';

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @category Mage
66
* @package Mage_Adminhtml
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
8-
* @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://openmage.org)
8+
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://openmage.org)
99
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
@@ -233,37 +233,37 @@ public function getOptionValues()
233233
if ($option->getGroupByType() == Mage_Catalog_Model_Product_Option::OPTION_GROUP_SELECT) {
234234
$i = 0;
235235
$itemCount = 0;
236-
foreach ($option->getValues() as $_value) {
237-
/** @var Mage_Catalog_Model_Product_Option_Value $_value */
236+
foreach ($option->getValues() as $optionValue) {
237+
/** @var Mage_Catalog_Model_Product_Option_Value $optionValue */
238238
$value['optionValues'][$i] = [
239-
'item_count' => max($itemCount, $_value->getOptionTypeId()),
240-
'option_id' => $_value->getOptionId(),
241-
'option_type_id' => $_value->getOptionTypeId(),
242-
'title' => $this->escapeHtml($_value->getTitle()),
239+
'item_count' => max($itemCount, $optionValue->getOptionTypeId()),
240+
'option_id' => $optionValue->getOptionId(),
241+
'option_type_id' => $optionValue->getOptionTypeId(),
242+
'title' => $this->escapeHtml($optionValue->getTitle()),
243243
'price' => ($showPrice)
244-
? $this->getPriceValue($_value->getPrice(), $_value->getPriceType()) : '',
245-
'price_type' => ($showPrice) ? $_value->getPriceType() : 0,
246-
'sku' => $this->escapeHtml($_value->getSku()),
247-
'sort_order' => $_value->getSortOrder(),
244+
? $this->getPriceValue($optionValue->getPrice(), $optionValue->getPriceType()) : '',
245+
'price_type' => ($showPrice) ? $optionValue->getPriceType() : 0,
246+
'sku' => $this->escapeHtml($optionValue->getSku()),
247+
'sort_order' => $optionValue->getSortOrder(),
248248
];
249249

250250
if ($this->getProduct()->getStoreId() != '0') {
251251
$value['optionValues'][$i]['checkboxScopeTitle'] = $this->getCheckboxScopeHtml(
252-
$_value->getOptionId(),
252+
$optionValue->getOptionId(),
253253
'title',
254-
is_null($_value->getStoreTitle()),
255-
$_value->getOptionTypeId()
254+
is_null($optionValue->getStoreTitle()),
255+
$optionValue->getOptionTypeId()
256256
);
257-
$value['optionValues'][$i]['scopeTitleDisabled'] = is_null($_value->getStoreTitle())
257+
$value['optionValues'][$i]['scopeTitleDisabled'] = is_null($optionValue->getStoreTitle())
258258
? 'disabled' : null;
259259
if ($scope == Mage_Core_Model_Store::PRICE_SCOPE_WEBSITE) {
260260
$value['optionValues'][$i]['checkboxScopePrice'] = $this->getCheckboxScopeHtml(
261-
$_value->getOptionId(),
261+
$optionValue->getOptionId(),
262262
'price',
263-
is_null($_value->getstorePrice()),
264-
$_value->getOptionTypeId()
263+
is_null($optionValue->getstorePrice()),
264+
$optionValue->getOptionTypeId()
265265
);
266-
$value['optionValues'][$i]['scopePriceDisabled'] = is_null($_value->getStorePrice())
266+
$value['optionValues'][$i]['scopePriceDisabled'] = is_null($optionValue->getStorePrice())
267267
? 'disabled' : null;
268268
}
269269
}
@@ -303,20 +303,20 @@ public function getOptionValues()
303303
* @param string $id
304304
* @param string $name
305305
* @param bool $checked
306-
* @param string $select_id
306+
* @param string $selectId
307307
* @return string
308308
*/
309-
public function getCheckboxScopeHtml($id, $name, $checked = true, $select_id = '-1')
309+
public function getCheckboxScopeHtml($id, $name, $checked = true, $selectId = '-1')
310310
{
311311
$checkedHtml = '';
312312
if ($checked) {
313313
$checkedHtml = ' checked="checked"';
314314
}
315315
$selectNameHtml = '';
316316
$selectIdHtml = '';
317-
if ($select_id != '-1') {
318-
$selectNameHtml = '[values][' . $select_id . ']';
319-
$selectIdHtml = 'select_' . $select_id . '_';
317+
if ($selectId != '-1') {
318+
$selectNameHtml = '[values][' . $selectId . ']';
319+
$selectIdHtml = 'select_' . $selectId . '_';
320320
}
321321
$checkbox = '<input type="checkbox" id="' . $this->getFieldId() . '_' . $id . '_' .
322322
$selectIdHtml . $name . '_use_default" class="product-option-scope-checkbox" name="' .

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ public function usedDefault($attribute)
7878
// special management for "label" and "position" since they're columns of the
7979
// catalog_product_entity_media_gallery_value database table
8080
if ($attributeCode == 'label' || $attributeCode == 'position') {
81-
$media_gallery = $this->getDataObject()->getMediaGallery();
82-
if (!count($media_gallery['images'])) {
81+
$mediaGallery = $this->getDataObject()->getMediaGallery();
82+
if (!count($mediaGallery['images'])) {
8383
return true;
8484
}
85-
return $media_gallery['images'][0]["{$attributeCode}_use_default"];
85+
return $mediaGallery['images'][0]["{$attributeCode}_use_default"];
8686
}
8787

8888
$defaultValue = $this->getDataObject()->getAttributeDefaultValue($attributeCode);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,16 @@ function(v, elem){
243243

244244
$prefix = $form->getHtmlIdPrefix();
245245
if ($sendEmail) {
246-
$_disableStoreField = '';
246+
$disableStoreField = '';
247247
if (!$isSingleMode) {
248-
$_disableStoreField = "$('{$prefix}sendemail_store_id').disabled=(''==this.value || '0'==this.value);";
248+
$disableStoreField = "$('{$prefix}sendemail_store_id').disabled=(''==this.value || '0'==this.value);";
249249
}
250250
$sendEmail->setAfterElementHtml(
251251
'<script type="text/javascript">'
252252
. "
253253
$('{$prefix}website_id').disableSendemail = function() {
254254
$('{$prefix}sendemail').disabled = ('' == this.value || '0' == this.value);" .
255-
$_disableStoreField
255+
$disableStoreField
256256
. "}.bind($('{$prefix}website_id'));
257257
Event.observe('{$prefix}website_id', 'change', $('{$prefix}website_id').disableSendemail);
258258
$('{$prefix}website_id').disableSendemail();

app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Ip.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
*/
1919
class Mage_Adminhtml_Block_Customer_Online_Grid_Renderer_Ip extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
2020
{
21-
/**
22-
* @SuppressWarnings(PHPMD.ErrorControlOperator)
23-
*/
2421
#[\Override]
2522
public function render(Varien_Object $row)
2623
{

app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @category Mage
66
* @package Mage_Adminhtml
77
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
8-
* @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://openmage.org)
8+
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://openmage.org)
99
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
1010
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1111
*/
@@ -83,12 +83,12 @@ public function __construct()
8383

8484
$resources = Mage::getModel('admin/roles')->getResourcesList();
8585

86-
$rules_set = Mage::getResourceModel('admin/rules_collection')->getByRoles($rid)->load();
86+
$rules = Mage::getResourceModel('admin/rules_collection')->getByRoles($rid)->load();
8787

8888
$selrids = [];
8989

9090
/** @var Mage_Admin_Model_Rules $item */
91-
foreach ($rules_set->getItems() as $item) {
91+
foreach ($rules->getItems() as $item) {
9292
$itemResourceId = $item->getResource_id();
9393
if (array_key_exists(strtolower($itemResourceId), $resources)) {
9494
if ($item->isAllowed()) {
@@ -98,7 +98,7 @@ public function __construct()
9898
}
9999
}
100100

101-
$resourcesPermissionsMap = $rules_set->getResourcesPermissionsArray();
101+
$resourcesPermissionsMap = $rules->getResourcesPermissionsArray();
102102
$undefinedResources = array_diff(array_keys($resources), array_keys($resourcesPermissionsMap));
103103

104104
foreach ($undefinedResources as $undefinedResourceId) {

app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public function __construct()
2525
->getCollection()
2626
->load();
2727

28-
$user_roles = Mage::getModel('admin/roles')
28+
$userRoles = Mage::getModel('admin/roles')
2929
->getUsersCollection()
3030
->setUserFilter($uid)
3131
->load();
3232

3333
$this->setTemplate('permissions/userroles.phtml')
3434
->assign('roles', $roles)
35-
->assign('user_roles', $user_roles);
35+
->assign('user_roles', $userRoles);
3636
}
3737
}

0 commit comments

Comments
 (0)