Skip to content

Commit d234b33

Browse files
committed
Merge remote-tracking branch 'upstream/2.3-develop' into MTF-MFTF-migration-kozan
2 parents 3c43aff + e99537f commit d234b33

File tree

392 files changed

+12425
-1625
lines changed

Some content is hidden

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

392 files changed

+12425
-1625
lines changed

app/code/Magento/Analytics/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<label>Advanced Reporting</label>
1616
<comment><![CDATA[This service provides a dynamic suite of reports with rich insights about your business.
1717
Your reports can be accessed securely on a personalized dashboard outside of the admin panel by clicking on the
18-
"Go to Advanced Reporting" link. </br> For more information, see our <a href="https://magento.com/legal/terms/cloud-terms">
18+
"Go to Advanced Reporting" link. </br> For more information, see our <a target="_blank" href="https://magento.com/legal/terms/cloud-terms">
1919
terms and conditions</a>.]]></comment>
2020
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
2121
<label>Advanced Reporting Service</label>

app/code/Magento/AsynchronousOperations/Model/BulkStatus.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,6 @@ public function getFailedOperationsByBulkId($bulkUuid, $failureType = null)
8787
*/
8888
public function getOperationsCountByBulkIdAndStatus($bulkUuid, $status)
8989
{
90-
if ($status === OperationInterface::STATUS_TYPE_OPEN) {
91-
/**
92-
* Total number of operations that has been scheduled within the given bulk
93-
*/
94-
$allOperationsQty = $this->getOperationCount($bulkUuid);
95-
96-
/**
97-
* Number of operations that has been processed (i.e. operations with any status but 'open')
98-
*/
99-
$allProcessedOperationsQty = (int)$this->operationCollectionFactory->create()
100-
->addFieldToFilter('bulk_uuid', $bulkUuid)
101-
->getSize();
102-
103-
return $allOperationsQty - $allProcessedOperationsQty;
104-
}
105-
10690
/** @var \Magento\AsynchronousOperations\Model\ResourceModel\Operation\Collection $collection */
10791
$collection = $this->operationCollectionFactory->create();
10892
return $collection->addFieldToFilter('bulk_uuid', $bulkUuid)

app/code/Magento/Backend/Block/Widget/Grid.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,10 @@ protected function _addColumnFilterToCollection($column)
300300
if ($this->getCollection()) {
301301
$field = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
302302
if ($column->getFilterConditionCallback()) {
303-
call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
303+
$column->getFilterConditionCallback()[0]->{$column->getFilterConditionCallback()[1]}(
304+
$this->getCollection(),
305+
$column
306+
);
304307
} else {
305308
$condition = $column->getFilter()->getCondition();
306309
if ($field && isset($condition)) {
@@ -363,7 +366,7 @@ protected function _prepareCollection()
363366
$this->_setFilterValues($data);
364367
} elseif ($filter && is_array($filter)) {
365368
$this->_setFilterValues($filter);
366-
} elseif (0 !== sizeof($this->_defaultFilter)) {
369+
} elseif (0 !== count($this->_defaultFilter)) {
367370
$this->_setFilterValues($this->_defaultFilter);
368371
}
369372

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function render(\Magento\Framework\DataObject $row)
4747
return '&nbsp;';
4848
}
4949

50-
if (sizeof($actions) == 1 && !$this->getColumn()->getNoLink()) {
50+
if (count($actions) == 1 && !$this->getColumn()->getNoLink()) {
5151
foreach ($actions as $action) {
5252
if (is_array($action)) {
5353
return $this->_toLinkHtml($action, $row);
@@ -104,6 +104,7 @@ protected function _toLinkHtml($action, \Magento\Framework\DataObject $row)
104104
$this->_transformActionData($action, $actionCaption, $row);
105105

106106
if (isset($action['confirm'])) {
107+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
107108
$action['onclick'] = 'return window.confirm(\'' . addslashes(
108109
$this->escapeHtml($action['confirm'])
109110
) . '\')';
@@ -117,8 +118,8 @@ protected function _toLinkHtml($action, \Magento\Framework\DataObject $row)
117118
/**
118119
* Prepares action data for html render
119120
*
120-
* @param array &$action
121-
* @param string &$actionCaption
121+
* @param &array $action
122+
* @param &string $actionCaption
122123
* @param \Magento\Framework\DataObject $row
123124
* @return $this
124125
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -144,7 +145,7 @@ protected function _transformActionData(&$action, &$actionCaption, \Magento\Fram
144145
if (is_array($action['url']) && isset($action['field'])) {
145146
$params = [$action['field'] => $this->_getValue($row)];
146147
if (isset($action['url']['params'])) {
147-
$params = array_merge($action['url']['params'], $params);
148+
$params[] = $action['url']['params'];
148149
}
149150
$action['href'] = $this->getUrl($action['url']['base'], $params);
150151
unset($action['field']);

app/code/Magento/Backend/Helper/Dashboard/AbstractDashboard.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/**
99
* Adminhtml abstract dashboard helper.
1010
*
11+
* phpcs:disable Magento2.Classes.AbstractApi
1112
* @api
1213
* @since 100.0.2
1314
*/
@@ -28,6 +29,8 @@ abstract class AbstractDashboard extends \Magento\Framework\App\Helper\AbstractH
2829
protected $_params = [];
2930

3031
/**
32+
* Return collections
33+
*
3134
* @return array|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
3235
*/
3336
public function getCollection()
@@ -39,6 +42,8 @@ public function getCollection()
3942
}
4043

4144
/**
45+
* Init collections
46+
*
4247
* @return void
4348
*/
4449
abstract protected function _initCollection();
@@ -54,14 +59,18 @@ public function getItems()
5459
}
5560

5661
/**
62+
* Return items count
63+
*
5764
* @return int
5865
*/
5966
public function getCount()
6067
{
61-
return sizeof($this->getItems());
68+
return count($this->getItems());
6269
}
6370

6471
/**
72+
* Return column
73+
*
6574
* @param string $index
6675
* @return array
6776
*/
@@ -85,6 +94,8 @@ public function getColumn($index)
8594
}
8695

8796
/**
97+
* Set params with value
98+
*
8899
* @param string $name
89100
* @param mixed $value
90101
* @return void
@@ -95,6 +106,8 @@ public function setParam($name, $value)
95106
}
96107

97108
/**
109+
* Set params
110+
*
98111
* @param array $params
99112
* @return void
100113
*/
@@ -104,6 +117,8 @@ public function setParams(array $params)
104117
}
105118

106119
/**
120+
* Get params with name
121+
*
107122
* @param string $name
108123
* @return mixed
109124
*/
@@ -117,6 +132,8 @@ public function getParam($name)
117132
}
118133

119134
/**
135+
* Get params
136+
*
120137
* @return array
121138
*/
122139
public function getParams()

app/code/Magento/Backend/Helper/Dashboard/Data.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function getStores()
6868
*/
6969
public function countStores()
7070
{
71-
return sizeof($this->_stores->getItems());
71+
return count($this->_stores->getItems());
7272
}
7373

7474
/**
@@ -88,15 +88,15 @@ public function getDatePeriods()
8888
}
8989

9090
/**
91-
* Create data hash to ensure that we got valid
92-
* data and it is not changed by some one else.
91+
* Create data hash to ensure that we got valid data and it is not changed by some one else.
9392
*
9493
* @param string $data
9594
* @return string
9695
*/
9796
public function getChartDataHash($data)
9897
{
9998
$secret = $this->_installDate;
99+
// phpcs:disable Magento2.Security.InsecureFunction.FoundWithAlternative
100100
return md5($data . $secret);
101101
}
102102
}

app/code/Magento/Backend/Model/Menu/Item/Validator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
namespace Magento\Backend\Model\Menu\Item;
77

88
/**
9+
* Class Validator
10+
*
11+
* @package Magento\Backend\Model\Menu\Item
912
* @api
1013
* @since 100.0.2
1114
*/
@@ -49,7 +52,7 @@ public function __construct()
4952

5053
$attributeValidator = new \Zend_Validate();
5154
$attributeValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3]));
52-
$attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_]+$/'));
55+
$attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_\-]+$/'));
5356

5457
$textValidator = new \Zend_Validate_StringLength(['min' => 3, 'max' => 50]);
5558

@@ -101,6 +104,7 @@ private function checkMenuItemIsRemoved($data)
101104

102105
/**
103106
* Check that menu item contains all required data
107+
*
104108
* @param array $data
105109
*
106110
* @throws \BadMethodCallException

app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
' resource="Test_Value::value"/></menu></config>',
1111
[
1212
"Element 'add', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " .
13-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
13+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
1414
"Element 'add', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
1515
],
1616
],
@@ -20,7 +20,7 @@
2020
'resource="Test_Value::value"/></menu></config>',
2121
[
2222
"Element 'add', attribute 'action': [facet 'pattern'] The value 'ad' is not accepted by the " .
23-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
23+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
2424
"Element 'add', attribute 'action': 'ad' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
2525
],
2626
],
@@ -31,7 +31,7 @@
3131
'</menu></config>',
3232
[
3333
"Element 'add', attribute 'action': [facet 'pattern'] The value 'adm$#@inhtml/notification' is not " .
34-
"accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
34+
"accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
3535
"Element 'add', attribute 'action': 'adm$#@inhtml/notification' is not a valid value of the atomic " .
3636
"type 'typeAction'.\nLine: 1\n"
3737
],
@@ -452,7 +452,7 @@
452452
'<?xml version="1.0"?><config><menu><update action="" ' . 'id="Test_Value::some_value"/></menu></config>',
453453
[
454454
"Element 'update', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " .
455-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
455+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
456456
"Element 'update', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
457457
],
458458
],
@@ -462,7 +462,7 @@
462462
'resource="Test_Value::value"/></menu></config>',
463463
[
464464
"Element 'update', attribute 'action': [facet 'pattern'] The value 'v' is not accepted by the " .
465-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
465+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
466466
"Element 'update', attribute 'action': 'v' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
467467
],
468468
],
@@ -471,7 +471,7 @@
471471
'id="Test_Value::some_value"/></menu></config>',
472472
[
473473
"Element 'update', attribute 'action': [facet 'pattern'] The value '/@##gt;' is not " .
474-
"accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
474+
"accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
475475
"Element 'update', attribute 'action': '/@##gt;' is not a valid value of the atomic" .
476476
" type 'typeAction'.\nLine: 1\n"
477477
],

app/code/Magento/Backend/etc/menu.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
</xs:documentation>
101101
</xs:annotation>
102102
<xs:restriction base="xs:string">
103-
<xs:pattern value="[a-zA-Z0-9/_]{3,}" />
103+
<xs:pattern value="[a-zA-Z0-9/_\-]{3,}" />
104104
</xs:restriction>
105105
</xs:simpleType>
106106

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/checkbox.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<?php $_selections = $_option->getSelections(); ?>
1111
<?php $_skipSaleableCheck = $this->helper(Magento\Catalog\Helper\Product::class)->getSkipSaleableCheck(); ?>
1212

13-
<div class="field admin__field options<?php if ($_option->getRequired()) { echo ' required _required'; } ?>">
13+
<div class="field admin__field options<?php if ($_option->getRequired()) { echo ' _required'; } ?>">
1414
<label class="label admin__field-label">
1515
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
1616
</label>

0 commit comments

Comments
 (0)