Skip to content

Commit b266126

Browse files
authored
1 parent 53e2375 commit b266126

File tree

187 files changed

+251
-531
lines changed

Some content is hidden

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

187 files changed

+251
-531
lines changed

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@
910910
- any-glob-to-any-file: [
911911
.phpunit*,
912912
tests/*,
913+
tests/**/*,
913914
.github/workflows/phpunit.yml
914915
]
915916

.rector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
CodeQuality\Foreach_\UnusedForeachValueToArrayKeysRector::class,
3030
CodeQuality\FuncCall\ChangeArrayPushToArrayAssignRector::class,
3131
CodeQuality\FuncCall\CompactToVariablesRector::class,
32+
CodeQuality\FunctionLike\SimplifyUselessVariableRector::class,
3233
CodeQuality\Identical\SimplifyArraySearchRector::class,
3334
CodeQuality\Identical\SimplifyConditionsRector::class,
3435
CodeQuality\Identical\StrlenZeroToIdenticalEmptyStringRector::class,

app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ public function getElementHtml()
6363

6464
$html .= ' <label for="' . $htmlId . '" class="normal">'
6565
. Mage::helper('adminhtml')->__('Use Config Settings') . '</label>';
66-
$html .= '<script type="text/javascript">' . 'toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId
67-
. '\').parentNode);' . '</script>';
6866

69-
return $html;
67+
return $html . ('<script type="text/javascript">' . 'toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId
68+
. '\').parentNode);' . '</script>');
7069
}
7170
}

app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ public function getElementHtml()
6161
$html .= ' onclick="toggleValueElements(this, this.parentNode);" class="checkbox" type="checkbox" />';
6262
$html .= ' <label for="' . $htmlId . '" class="normal">'
6363
. Mage::helper('adminhtml')->__('Use All Available Attributes') . '</label>';
64-
$html .= '<script type="text/javascript">toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId
65-
. '\').parentNode);</script>';
6664

67-
return $html;
65+
return $html . ('<script type="text/javascript">toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId
66+
. '\').parentNode);</script>');
6867
}
6968
}

app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ public function getElementHtml()
6262
$html .= ' onclick="toggleValueElements(this, this.parentNode);" class="checkbox" type="checkbox" />';
6363
$html .= ' <label for="' . $htmlId . '" class="normal">'
6464
. Mage::helper('adminhtml')->__('Use Config Settings') . '</label>';
65-
$html .= '<script type="text/javascript">toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId
66-
. '\').parentNode);</script>';
6765

68-
return $html;
66+
return $html . ('<script type="text/javascript">toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId
67+
. '\').parentNode);</script>');
6968
}
7069
}

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,11 @@ protected function _toHtml()
8383
}
8484

8585
$html = parent::_toHtml();
86-
$html .= Mage::helper('adminhtml/js')->getScript(
86+
87+
return $html . Mage::helper('adminhtml/js')->getScript(
8788
"var {$this->getJsObjectName()} = new Product.Attributes('{$this->getId()}');\n"
8889
. "{$this->getJsObjectName()}.setConfig(" . Mage::helper('core')->jsonEncode($this->getConfig()->getData()) . ");\n"
8990
);
90-
91-
return $html;
9291
}
9392

9493
/**

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,8 @@ public function getCheckboxScopeHtml($id, $name, $checked = true, $selectId = '-
325325
$selectIdHtml . $name . '_use_default" class="product-option-scope-checkbox" name="' .
326326
$this->getFieldName() . '[' . $id . ']' . $selectNameHtml . '[scope][' . $name . ']" value="1" ' .
327327
$checkedHtml . '/>';
328-
$checkbox .= '<label class="normal" for="' . $this->getFieldId() . '_' . $id . '_' .
329-
$selectIdHtml . $name . '_use_default">' . $this->__('Use Default Value') . '</label>';
330-
return $checkbox;
328+
return $checkbox . ('<label class="normal" for="' . $this->getFieldId() . '_' . $id . '_' .
329+
$selectIdHtml . $name . '_use_default">' . $this->__('Use Default Value') . '</label>');
331330
}
332331

333332
public function getPriceValue($value, $type)

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Frontend/Product/Watermark.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ public function render(Varien_Data_Form_Element_Abstract $element)
6464
$html .= $field->toHtml();
6565
}
6666

67-
$html .= $this->_getFooterHtml($element);
68-
69-
return $html;
67+
return $html . $this->_getFooterHtml($element);
7068
}
7169

7270
protected function _getHeaderHtml($element)
@@ -83,9 +81,8 @@ protected function _getHeaderHtml($element)
8381
if (!$default) {
8482
$html .= '<colgroup class="use-default" />';
8583
}
86-
$html .= '<tbody>';
8784

88-
return $html;
85+
return $html . '<tbody>';
8986
}
9087

9188
protected function _getFooterHtml($element)

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ public function getElementHtml()
3838
. '<option value="0">' . $this->getModeLabels('all') . '</option>'
3939
. '<option value="1" ' . ($this->getValue() == null ? '' : 'selected') . '>' . $this->getModeLabels('custom') . '</option>'
4040
. '</select><br /><br />';
41-
42-
$html .= parent::getElementHtml();
43-
return $html;
41+
return $html . parent::getElementHtml();
4442
}
4543

4644
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ public function getElementHtml()
4242
$html .= '<input id="' . $htmlId . '" name="product[' . $htmlId . ']" ' . $disabled . ' value="1" ' . $checked;
4343
$html .= ' onclick="toggleValueElements(this, this.parentNode);" class="checkbox" type="checkbox" />';
4444
$html .= ' <label for="' . $htmlId . '">' . Mage::helper('adminhtml')->__('Use Config Settings') . '</label>';
45-
$html .= '<script type="text/javascript">toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId . '\').parentNode);</script>';
4645

47-
return $html;
46+
return $html . ('<script type="text/javascript">toggleValueElements($(\'' . $htmlId . '\'), $(\'' . $htmlId . '\').parentNode);</script>');
4847
}
4948

5049
/**

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ function (node, e) {
144144
{jsObject}.categoryName = node.attributes.id != "none" ? node.text : false;
145145
}
146146
';
147-
$js = str_replace('{jsObject}', $this->getJsObjectName(), $js);
148-
return $js;
147+
return str_replace('{jsObject}', $this->getJsObjectName(), $js);
149148
}
150149

151150
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ public function getHeaderText()
8585
public function getFormHtml()
8686
{
8787
$html = parent::getFormHtml();
88-
$html .= $this->getLayout()->createBlock('adminhtml/catalog_product_composite_configure')->toHtml();
89-
return $html;
88+
return $html . $this->getLayout()->createBlock('adminhtml/catalog_product_composite_configure')->toHtml();
9089
}
9190

9291
/**

app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Adminpass.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ public function render(Varien_Data_Form_Element_Abstract $element)
3333
$html .= '<td class="label">' . $element->getLabelHtml() . '</td>';
3434
$html .= '<td class="value">' . $element->getElementHtml() . ' ' . $this->_getScriptHtml($element) . '</td>';
3535
$html .= '</tr>' . "\n";
36-
$html .= '<tr>';
3736

38-
return $html;
37+
return $html . '<tr>';
3938
}
4039

4140
/**

app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Newpass.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public function render(Varien_Data_Form_Element_Abstract $element)
5252
$html .= '<label for="account-send-pass">'
5353
. Mage::helper('customer')->__('Email Link to Set Password')
5454
. '</label></td>';
55-
$html .= '</tr>' . "\n";
5655

57-
return $html;
56+
return $html . ('</tr>' . "\n");
5857
}
5958
}

app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public function render(Varien_Data_Form_Element_Abstract $element)
6868
$selectId . '", ' . Mage::helper('directory')->getRegionJsonByStore($quoteStoreId) . ');' . "\n";
6969
$html .= '</script>' . "\n";
7070

71-
$html .= '</td></tr>' . "\n";
72-
73-
return $html;
71+
return $html . ('</td></tr>' . "\n");
7472
}
7573
}

app/code/core/Mage/Adminhtml/Block/Page/Menu.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,7 @@ protected function _checkAcl($resource)
234234
*/
235235
protected function _afterToHtml($html)
236236
{
237-
$html = preg_replace_callback('#' . Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME . '/\$([^\/].*)/([^\$].*)\$#', [$this, '_callbackSecretKey'], $html);
238-
239-
return $html;
237+
return preg_replace_callback('#' . Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME . '/\$([^\/].*)/([^\$].*)\$#', [$this, '_callbackSecretKey'], $html);
240238
}
241239

242240
/**
@@ -281,9 +279,8 @@ public function getMenuLevel($menu, $level = 0)
281279
}
282280
$html .= '</li>' . PHP_EOL;
283281
}
284-
$html .= '</ul>' . PHP_EOL;
285282

286-
return $html;
283+
return $html . ('</ul>' . PHP_EOL);
287284
}
288285

289286
/**

app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public function render(Varien_Data_Form_Element_Abstract $element)
3939
$element->getNote()
4040
);
4141
$html = '<td class="label">&nbsp;</td>';
42-
$html .= '<td class="value">' . $elementHtml . '</td>';
4342

44-
return $html;
43+
return $html . ('<td class="value">' . $elementHtml . '</td>');
4544
}
4645
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ public function getHeaderHtml()
9696
public function getFormHtml()
9797
{
9898
$html = parent::getFormHtml();
99-
$html .= $this->getLayout()->createBlock('adminhtml/catalog_product_composite_configure')->toHtml();
100-
return $html;
99+
return $html . $this->getLayout()->createBlock('adminhtml/catalog_product_composite_configure')->toHtml();
101100
}
102101

103102
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public function getButtonsHtml()
5555
'onclick' => 'order.setCustomerIsGuest()',
5656
'class' => 'add',
5757
];
58-
$html .= $this->getLayout()->createBlock('adminhtml/widget_button')->setData($addButtonData)->toHtml();
5958

60-
return $html;
59+
return $html . $this->getLayout()->createBlock('adminhtml/widget_button')->setData($addButtonData)->toHtml();
6160
}
6261
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ protected function _toHtml()
4646
$out .= Mage::helper('sales')->__('Create New Order');
4747
}
4848
$out = $this->escapeHtml($out);
49-
$out = '<h3 class="icon-head head-sales-order">' . $out . '</h3>';
50-
return $out;
49+
return '<h3 class="icon-head head-sales-order">' . $out . '</h3>';
5150
}
5251
}

app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Qty.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public function render(Varien_Object $row)
6060
if ($isInactive) {
6161
$html .= 'disabled="disabled" ';
6262
}
63-
$html .= 'class="input-text ' . $this->getColumn()->getInlineCss() . ($isInactive ? ' input-inactive' : '') . '" />';
64-
return $html;
63+
return $html . ('class="input-text ' . $this->getColumn()->getInlineCss() . ($isInactive ? ' input-inactive' : '') . '" />');
6564
}
6665
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public function includeTax()
3232
public function getTotalExclTax()
3333
{
3434
$excl = $this->getTotal()->getAddress()->getGrandTotal() - $this->getTotal()->getAddress()->getTaxAmount();
35-
$excl = max($excl, 0);
36-
return $excl;
35+
return max($excl, 0);
3736
}
3837
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,7 @@ protected function _afterToHtml($html)
543543
if ($this->_getDependence()) {
544544
$html .= $this->_getDependence()->toHtml();
545545
}
546-
$html = parent::_afterToHtml($html);
547-
return $html;
546+
return parent::_afterToHtml($html);
548547
}
549548

550549
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ class Mage_Adminhtml_Block_System_Config_Form_Field_File extends Varien_Data_For
3030
public function getElementHtml()
3131
{
3232
$html = parent::getElementHtml();
33-
$html .= $this->_getDeleteCheckbox();
34-
return $html;
33+
return $html . $this->_getDeleteCheckbox();
3534
}
3635

3736
/**

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ function checkConditionName(event)
5353
</script>
5454
EndHTML;
5555

56-
$html .= parent::getElementHtml();
57-
58-
return $html;
56+
return $html . parent::getElementHtml();
5957
}
6058
}

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ public function render(Varien_Data_Form_Element_Abstract $element)
3636
$html .= $field->toHtml();
3737
}
3838

39-
$html .= $this->_getFooterHtml($element);
40-
41-
return $html;
39+
return $html . $this->_getFooterHtml($element);
4240
}
4341

4442
/**
@@ -69,9 +67,8 @@ protected function _getHeaderHtml($element)
6967
if ($this->getRequest()->getParam('website') || $this->getRequest()->getParam('store')) {
7068
$html .= '<colgroup class="use-default" />';
7169
}
72-
$html .= '<colgroup class="scope-label" /><colgroup class="" /><tbody>';
7370

74-
return $html;
71+
return $html . '<colgroup class="scope-label" /><colgroup class="" /><tbody>';
7572
}
7673

7774
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ public function render(Varien_Data_Form_Element_Abstract $element)
4545
}
4646
$html .= $this->_getFieldHtml($element, $moduleName);
4747
}
48-
$html .= $this->_getFooterHtml($element);
4948

50-
return $html;
49+
return $html . $this->_getFooterHtml($element);
5150
}
5251

5352
protected function _getDummyElement()

app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Filter/Action.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public function getHtml()
3636
foreach ($values as $k => $v) {
3737
$html .= '<option value="' . $k . '"' . ($value == $k ? ' selected="selected"' : '') . '>' . $v . '</option>';
3838
}
39-
$html .= '</select>';
40-
return $html;
39+
return $html . '</select>';
4140
}
4241
}

app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ public function __construct()
3030

3131
public function getRunButtonHtml()
3232
{
33-
$html = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')
33+
return $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')
3434
->setClass('save')->setLabel($this->__('Run Profile in Popup'))
3535
->setOnClick('runProfile(true)')
3636
->toHtml();
37-
38-
return $html;
3937
}
4038

4139
public function getProfileId()

app/code/core/Mage/Adminhtml/Block/Widget/Accordion/Item.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ public function getTitle()
3939
{
4040
$title = $this->getData('title');
4141
$url = $this->getContentUrl() ? $this->getContentUrl() : '#';
42-
$title = '<a href="' . $url . '" class="' . $this->getTarget() . '">' . $title . '</a>';
4342

44-
return $title;
43+
return '<a href="' . $url . '" class="' . $this->getTarget() . '">' . $title . '</a>';
4544
}
4645

4746
public function getContent()
@@ -73,7 +72,6 @@ protected function _toHtml()
7372
$html .= '</dt>';
7473
$html .= '<dd id="dd-' . $this->getHtmlId() . '" class="' . $this->getClass() . '">';
7574
$html .= $content;
76-
$html .= '</dd>';
77-
return $html;
75+
return $html . '</dd>';
7876
}
7977
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,7 @@ public function getXml()
13091309
if ($this->getCountTotals()) {
13101310
$xml .= $this->getTotals()->toXml($indexes);
13111311
}
1312-
$xml .= '</items>';
1313-
return $xml;
1312+
return $xml . '</items>';
13141313
}
13151314

13161315
/**

app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function getHtml()
6868
. '</div></div>';
6969
$html .= '<input type="hidden" name="' . $this->_getHtmlName() . '[locale]"'
7070
. 'value="' . $this->getLocale()->getLocaleCode() . '"/>';
71-
$html .= '<script type="text/javascript">
71+
return $html . ('<script type="text/javascript">
7272
Calendar.setup({
7373
inputField : "' . $htmlId . '_from",
7474
ifFormat : "' . $format . '",
@@ -107,8 +107,7 @@ function showCalendar(event){
107107
};
108108
});
109109
};
110-
</script>';
111-
return $html;
110+
</script>');
112111
}
113112

114113
public function getEscapedValue($index = null)

0 commit comments

Comments
 (0)