Skip to content

Commit 33574a3

Browse files
author
Oleksii Korshenko
authored
Merge pull request magento#1800 from magento-engcom/2.2-develop-prs
Public Pull Requests magento#12516 Case mismatch by @lfluvisotto magento#12513 Duplicate array key by @lfluvisotto magento#12499 Format generated config files using the short array syntax by @cykirsch Fixed Public Issues magento#758 Coding standards: arrays
2 parents 7e107e2 + 72af510 commit 33574a3

File tree

59 files changed

+173
-121
lines changed

Some content is hidden

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

59 files changed

+173
-121
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ protected function saveAndReplaceAdvancedPrices()
394394
? $rowData[self::COL_TIER_PRICE] : 0,
395395
'percentage_value' => $rowData[self::COL_TIER_PRICE_TYPE] === self::TIER_PRICE_TYPE_PERCENT
396396
? $rowData[self::COL_TIER_PRICE] : null,
397-
'website_id' => $this->getWebsiteId($rowData[self::COL_TIER_PRICE_WEBSITE])
397+
'website_id' => $this->getWebSiteId($rowData[self::COL_TIER_PRICE_WEBSITE])
398398
];
399399
}
400400
}

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class WebsiteTest extends \PHPUnit\Framework\TestCase
2727

2828
protected function setUp()
2929
{
30-
$this->webSiteModel = $this->getMockBuilder(\Magento\Store\Model\WebSite::class)
30+
$this->webSiteModel = $this->getMockBuilder(\Magento\Store\Model\Website::class)
3131
->setMethods(['getBaseCurrency'])
3232
->disableOriginalConstructor()
3333
->getMock();

app/code/Magento/Backend/Block/System/Store/Edit/AbstractForm.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function _prepareForm()
3737
['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]
3838
);
3939

40-
$this->_prepareStoreFieldSet($form);
40+
$this->_prepareStoreFieldset($form);
4141

4242
$form->addField(
4343
'store_type',

app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public function execute()
5454
$user = $this->_objectManager->create(\Magento\User\Model\User::class)->load($userId);
5555

5656
$user->setId($userId)
57-
->setUsername($this->getRequest()->getParam('username', false))
58-
->setFirstname($this->getRequest()->getParam('firstname', false))
59-
->setLastname($this->getRequest()->getParam('lastname', false))
57+
->setUserName($this->getRequest()->getParam('username', false))
58+
->setFirstName($this->getRequest()->getParam('firstname', false))
59+
->setLastName($this->getRequest()->getParam('lastname', false))
6060
->setEmail(strtolower($this->getRequest()->getParam('email', false)));
6161

6262
if ($this->_objectManager->get(\Magento\Framework\Validator\Locale::class)->isValid($interfaceLocale)) {

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/ColumnSetTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function testSetFilterTypePropagatesFilterTypeToColumns()
117117

118118
public function testGetRowUrlIfUrlPathNotSet()
119119
{
120-
$this->assertEquals('#', $this->_block->getRowUrl(new \StdClass()));
120+
$this->assertEquals('#', $this->_block->getRowUrl(new \stdClass()));
121121
}
122122

123123
public function testGetRowUrl()

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/ColumnTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public function testSetGetGrid()
351351

352352
$this->_block->setFilter('StdClass');
353353

354-
$grid = new \StdClass();
354+
$grid = new \stdClass();
355355
$this->_block->setGrid($grid);
356356
$this->assertEquals($grid, $this->_block->getGrid());
357357
}

app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
data-mage-init='{"dropdown":{}}'
3030
data-toggle="dropdown">
3131
<span class="admin__action-dropdown-text">
32-
<span class="admin-user-account-text"><?= $block->escapeHtml($block->getUser()->getUsername()) ?></span>
32+
<span class="admin-user-account-text"><?= $block->escapeHtml($block->getUser()->getUserName()) ?></span>
3333
</span>
3434
</a>
3535
<ul class="admin__action-dropdown-menu">
@@ -39,7 +39,7 @@
3939
href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/system_account/index') ?>"
4040
<?= /* @escapeNotVerified */ $block->getUiId('user', 'account', 'settings') ?>
4141
title="<?= $block->escapeHtml(__('Account Setting')) ?>">
42-
<?= /* @escapeNotVerified */ __('Account Setting') ?> (<span class="admin-user-name"><?= $block->escapeHtml($block->getUser()->getUsername()) ?></span>)
42+
<?= /* @escapeNotVerified */ __('Account Setting') ?> (<span class="admin-user-name"><?= $block->escapeHtml($block->getUser()->getUserName()) ?></span>)
4343
</a>
4444
</li>
4545
<?php endif; ?>

app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
<script data-template="search-suggest" type="text/x-magento-template">
2929
<ul class="search-global-menu">
3030
<li class="item">
31-
<a id="searchPreviewProducts" href="<?= /* @escapeNotVerified */ $block->getURL('catalog/product/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Products</a>
31+
<a id="searchPreviewProducts" href="<?= /* @escapeNotVerified */ $block->getUrl('catalog/product/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Products</a>
3232
</li>
3333
<li class="item">
34-
<a id="searchPreviewOrders" href="<?= /* @escapeNotVerified */ $block->getURL('sales/order/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Orders</a>
34+
<a id="searchPreviewOrders" href="<?= /* @escapeNotVerified */ $block->getUrl('sales/order/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Orders</a>
3535
</li>
3636
<li class="item">
37-
<a id="searchPreviewCustomers" href="<?= /* @escapeNotVerified */ $block->getURL('customer/index/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Customers</a>
37+
<a id="searchPreviewCustomers" href="<?= /* @escapeNotVerified */ $block->getUrl('customer/index/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Customers</a>
3838
</li>
3939
<li class="item">
40-
<a id="searchPreviewPages" href="<?= /* @escapeNotVerified */ $block->getURL('cms/page/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Pages</a>
40+
<a id="searchPreviewPages" href="<?= /* @escapeNotVerified */ $block->getUrl('cms/page/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Pages</a>
4141
</li>
4242
<% if (data.items.length) { %>
4343
<% _.each(data.items, function(value){ %>

app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ $numColumns = sizeof($block->getColumns());
7272
<?php if ($block->getPagerVisibility()): ?>
7373
<div class="admin__data-grid-pager-wrap">
7474
<select name="<?= /* @escapeNotVerified */ $block->getVarNameLimit() ?>"
75-
id="<?= $block->escapeHTML($block->getHtmlId()) ?>_page-limit"
75+
id="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-limit"
7676
onchange="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.loadByElement(this)"
7777
class="admin__control-select">
7878
<option value="20"<?php if ($block->getCollection()->getPageSize() == 20): ?>
@@ -91,7 +91,7 @@ $numColumns = sizeof($block->getColumns());
9191
selected="selected"<?php endif; ?>>200
9292
</option>
9393
</select>
94-
<label for="<?= $block->escapeHTML($block->getHtmlId()) ?><?= $block->escapeHTML($block->getHtmlId()) ?>_page-limit"
94+
<label for="<?= $block->escapeHtml($block->getHtmlId()) ?><?= $block->escapeHtml($block->getHtmlId()) ?>_page-limit"
9595
class="admin__control-support-text"><?= /* @escapeNotVerified */ __('per page') ?></label>
9696

9797
<div class="admin__data-grid-pager">
@@ -107,12 +107,12 @@ $numColumns = sizeof($block->getColumns());
107107
<button type="button" class="action-previous disabled"><span><?= /* @escapeNotVerified */ __('Previous page') ?></span></button>
108108
<?php endif; ?>
109109
<input type="text"
110-
id="<?= $block->escapeHTML($block->getHtmlId()) ?>_page-current"
110+
id="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-current"
111111
name="<?= /* @escapeNotVerified */ $block->getVarNamePage() ?>"
112112
value="<?= /* @escapeNotVerified */ $_curPage ?>"
113113
class="admin__control-text"
114114
onkeypress="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.inputPage(event, '<?= /* @escapeNotVerified */ $_lastPage ?>')" <?= /* @escapeNotVerified */ $block->getUiId('current-page') ?> />
115-
<label class="admin__control-support-text" for="<?= $block->escapeHTML($block->getHtmlId()) ?>_page-current">
115+
<label class="admin__control-support-text" for="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-current">
116116
<?= /* @escapeNotVerified */ __('of %1', '<span>' . $block->getCollection()->getLastPageNumber() . '</span>') ?>
117117
</label>
118118
<?php if ($_curPage < $_lastPage): ?>

app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php

-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ public function getExtendedElement($switchAttributeCode)
142142
[
143143
'name' => "product[{$switchAttributeCode}]",
144144
'values' => $this->getOptions(),
145-
'value' => $switchAttributeCode,
146145
'class' => 'required-entry next-toinput',
147146
'no_span' => true,
148147
'disabled' => $this->isDisabledField(),

app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public function getValuesHtml()
4444
]
4545
);
4646
if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN) {
47-
$select->setName('options[' . $_option->getid() . ']')->addOption('', __('-- Please Select --'));
47+
$select->setName('options[' . $_option->getId() . ']')->addOption('', __('-- Please Select --'));
4848
} else {
49-
$select->setName('options[' . $_option->getid() . '][]');
49+
$select->setName('options[' . $_option->getId() . '][]');
5050
$select->setClass('multiselect admin__control-multiselect' . $require . ' product-custom-option');
5151
}
5252
foreach ($_option->getValues() as $_value) {

app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/GroupPrice/AbstractTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function setUp()
4747
'scopeOverriddenValue' => $scopeOverriddenValue
4848
]
4949
);
50-
$resource = $this->createPartialMock(\StdClass::class, ['getMainTable']);
50+
$resource = $this->createPartialMock(\stdClass::class, ['getMainTable']);
5151
$resource->expects($this->any())->method('getMainTable')->will($this->returnValue('table'));
5252

5353
$this->_model->expects($this->any())->method('_getResource')->will($this->returnValue($resource));

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/tab/inventory.phtml

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<option value="0"<?php if ($block->getFieldValue('manage_stock') == 0): ?> selected="selected"<?php endif; ?>><?= /* @escapeNotVerified */ __('No') ?></option>
2828
</select>
2929
<input type="hidden" id="inventory_manage_stock_default" value="<?= /* @escapeNotVerified */ $block->getDefaultConfigValue('manage_stock') ?>">
30-
<?php $_checked = ($block->getFieldValue('use_config_manage_stock') || $block->IsNew()) ? 'checked="checked"' : '' ?>
30+
<?php $_checked = ($block->getFieldValue('use_config_manage_stock') || $block->isNew()) ? 'checked="checked"' : '' ?>
3131
<input type="checkbox" id="inventory_use_config_manage_stock" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][use_config_manage_stock]" value="1" <?= /* @escapeNotVerified */ $_checked ?> onclick="toggleValueElements(this, this.parentNode);" <?= /* @escapeNotVerified */ $_readonly ?>>
3232
<label for="inventory_use_config_manage_stock"><?= /* @escapeNotVerified */ __('Use Config Settings') ?></label>
3333
<?php if (!$block->isReadonly()): ?>
@@ -67,7 +67,7 @@ toggleValueElements($('inventory_use_config_manage_stock'), $('inventory_use_con
6767
<input type="text" class="input-text validate-number" id="inventory_min_qty" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][min_qty]" value="<?= /* @escapeNotVerified */ $block->getFieldValue('min_qty') * 1 ?>" <?= /* @escapeNotVerified */ $_readonly ?>>
6868

6969
<div class="control-inner-wrap">
70-
<?php $_checked = ($block->getFieldValue('use_config_min_qty') || $block->IsNew()) ? 'checked="checked"' : '' ?>
70+
<?php $_checked = ($block->getFieldValue('use_config_min_qty') || $block->isNew()) ? 'checked="checked"' : '' ?>
7171
<input type="checkbox" id="inventory_use_config_min_qty" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][use_config_min_qty]" value="1" <?= /* @escapeNotVerified */ $_checked ?> onclick="toggleValueElements(this, this.parentNode);" <?= /* @escapeNotVerified */ $_readonly ?>>
7272
<label for="inventory_use_config_min_qty"><?= /* @escapeNotVerified */ __('Use Config Settings') ?></label>
7373
</div>
@@ -94,7 +94,7 @@ toggleValueElements($('inventory_use_config_min_qty'), $('inventory_use_config_m
9494
name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][min_sale_qty]"
9595
value="<?= /* @escapeNotVerified */ $block->getFieldValue('min_sale_qty') * 1 ?>" <?= /* @escapeNotVerified */ $_readonly ?>>
9696
<div class="control-inner-wrap">
97-
<?php $_checked = ($block->getFieldValue('use_config_min_sale_qty') || $block->IsNew()) ? 'checked="checked"' : '' ?>
97+
<?php $_checked = ($block->getFieldValue('use_config_min_sale_qty') || $block->isNew()) ? 'checked="checked"' : '' ?>
9898
<input type="checkbox" id="inventory_use_config_min_sale_qty" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][use_config_min_sale_qty]" value="1" <?= /* @escapeNotVerified */ $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?= /* @escapeNotVerified */ $_readonly ?>>
9999
<label for="inventory_use_config_min_sale_qty"><?= /* @escapeNotVerified */ __('Use Config Settings') ?></label>
100100
</div>
@@ -117,7 +117,7 @@ toggleValueElements($('inventory_use_config_min_sale_qty'), $('inventory_use_con
117117
</label>
118118
<div class="control">
119119
<input type="text" class="input-text validate-number" id="inventory_max_sale_qty" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][max_sale_qty]" value="<?= /* @escapeNotVerified */ $block->getFieldValue('max_sale_qty') * 1 ?>" <?= /* @escapeNotVerified */ $_readonly ?>>
120-
<?php $_checked = ($block->getFieldValue('use_config_max_sale_qty') || $block->IsNew()) ? 'checked="checked"' : '' ?>
120+
<?php $_checked = ($block->getFieldValue('use_config_max_sale_qty') || $block->isNew()) ? 'checked="checked"' : '' ?>
121121
<div class="control-inner-wrap">
122122
<input type="checkbox" id="inventory_use_config_max_sale_qty" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][use_config_max_sale_qty]" value="1" <?= /* @escapeNotVerified */ $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?= /* @escapeNotVerified */ $_readonly ?>>
123123
<label for="inventory_use_config_max_sale_qty"><?= /* @escapeNotVerified */ __('Use Config Settings') ?></label>
@@ -182,7 +182,7 @@ toggleValueElements($('inventory_use_config_max_sale_qty'), $('inventory_use_con
182182
</select>
183183

184184
<div class="control-inner-wrap">
185-
<?php $_checked = ($block->getFieldValue('use_config_backorders') || $block->IsNew()) ? 'checked="checked"' : '' ?>
185+
<?php $_checked = ($block->getFieldValue('use_config_backorders') || $block->isNew()) ? 'checked="checked"' : '' ?>
186186
<input type="checkbox" id="inventory_use_config_backorders" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][use_config_backorders]" value="1" <?= /* @escapeNotVerified */ $_checked ?> onclick="toggleValueElements(this, this.parentNode);" <?= /* @escapeNotVerified */ $_readonly ?>>
187187
<label for="inventory_use_config_backorders"><?= /* @escapeNotVerified */ __('Use Config Settings') ?></label>
188188
</div>
@@ -207,7 +207,7 @@ toggleValueElements($('inventory_use_config_backorders'), $('inventory_use_confi
207207
<input type="text" class="input-text validate-number" id="inventory_notify_stock_qty" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][notify_stock_qty]" value="<?= /* @escapeNotVerified */ $block->getFieldValue('notify_stock_qty') * 1 ?>" <?= /* @escapeNotVerified */ $_readonly ?>>
208208

209209
<div class="control-inner-wrap">
210-
<?php $_checked = ($block->getFieldValue('use_config_notify_stock_qty') || $block->IsNew()) ? 'checked="checked"' : '' ?>
210+
<?php $_checked = ($block->getFieldValue('use_config_notify_stock_qty') || $block->isNew()) ? 'checked="checked"' : '' ?>
211211
<input type="checkbox" id="inventory_use_config_notify_stock_qty" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][use_config_notify_stock_qty]" value="1" <?= /* @escapeNotVerified */ $_checked ?> onclick="toggleValueElements(this, this.parentNode);" <?= /* @escapeNotVerified */ $_readonly ?>>
212212
<label for="inventory_use_config_notify_stock_qty"><?= /* @escapeNotVerified */ __('Use Config Settings') ?></label>
213213
</div>
@@ -238,7 +238,7 @@ toggleValueElements($('inventory_use_config_notify_stock_qty'), $('inventory_use
238238
<input type="hidden" id="inventory_enable_qty_increments_default" value="<?= /* @escapeNotVerified */ $block->getDefaultConfigValue('enable_qty_increments') ?>">
239239

240240
<div class="control-inner-wrap">
241-
<?php $_checked = ($block->getFieldValue('use_config_enable_qty_inc') || $block->IsNew()) ? 'checked="checked"' : '' ?>
241+
<?php $_checked = ($block->getFieldValue('use_config_enable_qty_inc') || $block->isNew()) ? 'checked="checked"' : '' ?>
242242
<input type="checkbox" id="inventory_use_config_enable_qty_increments" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][use_config_enable_qty_increments]" value="1" <?= /* @escapeNotVerified */ $_checked ?> onclick="toggleValueElements(this, this.parentNode);" <?= /* @escapeNotVerified */ $_readonly ?>>
243243
<label for="inventory_use_config_enable_qty_increments"><?= /* @escapeNotVerified */ __('Use Config Settings') ?></label>
244244
</div>
@@ -262,7 +262,7 @@ toggleValueElements($('inventory_use_config_enable_qty_increments'), $('inventor
262262
<div class="control">
263263
<input type="text" class="input-text validate-digits" id="inventory_qty_increments" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][qty_increments]" value="<?= /* @escapeNotVerified */ $block->getFieldValue('qty_increments') * 1 ?>" <?= /* @escapeNotVerified */ $_readonly ?>>
264264
<div class="control-inner-wrap">
265-
<?php $_checked = ($block->getFieldValue('use_config_qty_increments') || $block->IsNew()) ? 'checked="checked"' : '' ?>
265+
<?php $_checked = ($block->getFieldValue('use_config_qty_increments') || $block->isNew()) ? 'checked="checked"' : '' ?>
266266
<input type="checkbox" id="inventory_use_config_qty_increments" name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[stock_data][use_config_qty_increments]" value="1" <?= /* @escapeNotVerified */ $_checked ?> onclick="toggleValueElements(this, this.parentNode);" <?= /* @escapeNotVerified */ $_readonly ?>>
267267
<label for="inventory_use_config_qty_increments"><?= /* @escapeNotVerified */ __('Use Config Settings') ?></label>
268268
</div>

app/code/Magento/Cms/Helper/Wysiwyg/Images.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function convertIdToPath($id)
148148
*/
149149
public function isUsingStaticUrlsAllowed()
150150
{
151-
$checkResult = new \StdClass();
151+
$checkResult = new \stdClass();
152152
$checkResult->isAllowed = false;
153153
$this->_eventManager->dispatch(
154154
'cms_wysiwyg_images_static_urls_allowed',

app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ protected function generalSettingsIsUsingStaticUrlsAllowed($allowedValue)
293293
{
294294
$storeId = 1;
295295
$this->imagesHelper->setStoreId($storeId);
296-
$checkResult = new \StdClass();
296+
$checkResult = new \stdClass();
297297
$checkResult->isAllowed = false;
298298
$this->eventManagerMock->expects($this->any())
299299
->method('dispatch')

0 commit comments

Comments
 (0)