Skip to content

Commit 5a68dca

Browse files
merge magento/2.4.0-develop into magento-tsg/MC-35166
2 parents 82f5a36 + d737726 commit 5a68dca

File tree

56 files changed

+872
-382
lines changed

Some content is hidden

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

56 files changed

+872
-382
lines changed

app/code/Magento/Catalog/Model/FilterProductCustomAttribute.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
namespace Magento\Catalog\Model;
99

1010
/**
11-
* Filter custom attributes for product using the blacklist
11+
* Filter custom attributes for product using the excluded list
1212
*/
1313
class FilterProductCustomAttribute
1414
{
1515
/**
1616
* @var array
1717
*/
18-
private $blackList;
18+
private $excludedList;
1919

2020
/**
21-
* @param array $blackList
21+
* @param array $excludedList
2222
*/
23-
public function __construct(array $blackList = [])
23+
public function __construct(array $excludedList = [])
2424
{
25-
$this->blackList = $blackList;
25+
$this->excludedList = $excludedList;
2626
}
2727

2828
/**
@@ -33,6 +33,6 @@ public function __construct(array $blackList = [])
3333
*/
3434
public function execute(array $attributes): array
3535
{
36-
return array_diff_key($attributes, array_flip($this->blackList));
36+
return array_diff_key($attributes, array_flip($this->excludedList));
3737
}
3838
}

app/code/Magento/CatalogInventory/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</type>
3838
<type name="Magento\Catalog\Model\FilterProductCustomAttribute">
3939
<arguments>
40-
<argument name="blackList" xsi:type="array">
40+
<argument name="excludedList" xsi:type="array">
4141
<item name="quantity_and_stock_status" xsi:type="string">quantity_and_stock_status</item>
4242
</argument>
4343
</arguments>

app/code/Magento/Eav/Model/Validator/Attribute/Data.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class Data extends \Magento\Framework\Validator\AbstractValidator
2323
/**
2424
* @var array
2525
*/
26-
protected $_attributesWhiteList = [];
26+
protected $allowedAttributesList = [];
2727

2828
/**
2929
* @var array
3030
*/
31-
protected $_attributesBlackList = [];
31+
protected $deniedAttributesList = [];
3232

3333
/**
3434
* @var array
@@ -68,9 +68,9 @@ public function setAttributes(array $attributes)
6868
* @param array $attributesCodes
6969
* @return $this
7070
*/
71-
public function setAttributesWhiteList(array $attributesCodes)
71+
public function setAllowedAttributesList(array $attributesCodes)
7272
{
73-
$this->_attributesWhiteList = $attributesCodes;
73+
$this->allowedAttributesList = $attributesCodes;
7474
return $this;
7575
}
7676

@@ -82,9 +82,9 @@ public function setAttributesWhiteList(array $attributesCodes)
8282
* @param array $attributesCodes
8383
* @return $this
8484
*/
85-
public function setAttributesBlackList(array $attributesCodes)
85+
public function setDeniedAttributesList(array $attributesCodes)
8686
{
87-
$this->_attributesBlackList = $attributesCodes;
87+
$this->deniedAttributesList = $attributesCodes;
8888
return $this;
8989
}
9090

@@ -171,11 +171,11 @@ protected function _getAttributes($entity)
171171
$attributesCodes[] = $attributeCode;
172172
}
173173

174-
$ignoreAttributes = $this->_attributesBlackList;
175-
if ($this->_attributesWhiteList) {
174+
$ignoreAttributes = $this->deniedAttributesList;
175+
if ($this->allowedAttributesList) {
176176
$ignoreAttributes = array_merge(
177177
$ignoreAttributes,
178-
array_diff($attributesCodes, $this->_attributesWhiteList)
178+
array_diff($attributesCodes, $this->allowedAttributesList)
179179
);
180180
}
181181

app/code/Magento/Eav/Test/Unit/Model/Validator/Attribute/DataTest.php

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ public function testIsValidAttributesFromCollection()
249249
}
250250

251251
/**
252-
* @dataProvider whiteBlackListProvider
252+
* @dataProvider allowDenyListProvider
253253
* @param callable $callback
254254
*/
255-
public function testIsValidBlackListWhiteListChecks($callback)
255+
public function testIsValidExclusionInclusionListChecks($callback)
256256
{
257257
$attribute = $this->_getAttributeMock(
258258
[
@@ -302,19 +302,19 @@ public function testIsValidBlackListWhiteListChecks($callback)
302302
/**
303303
* @return array
304304
*/
305-
public function whiteBlackListProvider()
305+
public function allowDenyListProvider()
306306
{
307-
$whiteCallback = function ($validator) {
308-
$validator->setAttributesWhiteList(['attribute']);
307+
$allowedCallbackList = function ($validator) {
308+
$validator->setAllowedAttributesList(['attribute']);
309309
};
310310

311-
$blackCallback = function ($validator) {
312-
$validator->setAttributesBlackList(['attribute2']);
311+
$deniedCallbackList = function ($validator) {
312+
$validator->setDeniedAttributesList(['attribute2']);
313313
};
314-
return ['white_list' => [$whiteCallback], 'black_list' => [$blackCallback]];
314+
return ['allowed' => [$allowedCallbackList], 'denied' => [$deniedCallbackList]];
315315
}
316316

317-
public function testSetAttributesWhiteList()
317+
public function testSetAttributesAllowedList()
318318
{
319319
$this->markTestSkipped('Skipped in #27500 due to testing protected/private methods and properties');
320320

@@ -328,12 +328,14 @@ public function testSetAttributesWhiteList()
328328
)
329329
->getMock();
330330
$validator = new Data($attrDataFactory);
331-
$result = $validator->setAttributesWhiteList($attributes);
332-
$this->assertAttributeEquals($attributes, '_attributesWhiteList', $validator);
331+
$result = $validator->setIncludedAttributesList($attributes);
332+
333+
// phpstan:ignore
334+
$this->assertAttributeEquals($attributes, '_attributesAllowed', $validator);
333335
$this->assertEquals($validator, $result);
334336
}
335337

336-
public function testSetAttributesBlackList()
338+
public function testSetAttributesDeniedList()
337339
{
338340
$this->markTestSkipped('Skipped in #27500 due to testing protected/private methods and properties');
339341

@@ -347,8 +349,9 @@ public function testSetAttributesBlackList()
347349
)
348350
->getMock();
349351
$validator = new Data($attrDataFactory);
350-
$result = $validator->setAttributesBlackList($attributes);
351-
$this->assertAttributeEquals($attributes, '_attributesBlackList', $validator);
352+
$result = $validator->setDeniedAttributesList($attributes);
353+
// phpstan:ignore
354+
$this->assertAttributeEquals($attributes, '_attributesDenied', $validator);
352355
$this->assertEquals($validator, $result);
353356
}
354357

app/code/Magento/Elasticsearch/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"magento/module-store": "*",
1313
"magento/module-catalog-inventory": "*",
1414
"magento/framework": "*",
15-
"elasticsearch/elasticsearch": "~7.6"
15+
"elasticsearch/elasticsearch": "~7.7.0"
1616
},
1717
"suggest": {
1818
"magento/module-config": "*"

app/code/Magento/Elasticsearch/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@
537537
</type>
538538
<type name="Magento\Search\Model\SearchEngine\Validator">
539539
<arguments>
540-
<argument name="engineBlacklist" xsi:type="array">
540+
<argument name="excludedEngineList" xsi:type="array">
541541
<item name="elasticsearch" xsi:type="string">Elasticsearch 2</item>
542542
</argument>
543543
<argument name="engineValidators" xsi:type="array">

app/code/Magento/Elasticsearch6/Block/Adminhtml/System/Config/TestConnection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* Elasticsearch 6.x test connection block
10+
* @deprecated the new minor release supports compatibility with Elasticsearch 7
1011
*/
1112
class TestConnection extends \Magento\AdvancedSearch\Block\Adminhtml\System\Config\TestConnection
1213
{

app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/Product/FieldProvider/FieldName/Resolver/DefaultResolver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
/**
1414
* Default name resolver.
15+
*
16+
* @deprecated the new minor release supports compatibility with Elasticsearch 7
1517
*/
1618
class DefaultResolver extends Base
1719
{

app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
/**
1313
* Elasticsearch client
14+
*
15+
* @deprecated the new minor release supports compatibility with Elasticsearch 7
1416
*/
1517
class Elasticsearch implements ClientInterface
1618
{

app/code/Magento/Elasticsearch6/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/module-catalog-search": "*",
99
"magento/module-search": "*",
1010
"magento/module-elasticsearch": "*",
11-
"elasticsearch/elasticsearch": "~7.6"
11+
"elasticsearch/elasticsearch": "~7.7.0"
1212
},
1313
"suggest": {
1414
"magento/module-config": "*"

0 commit comments

Comments
 (0)