Skip to content

Commit b6cf9bb

Browse files
author
Volodymyr Kublytskyi
committed
Merge remote-tracking branch 'mainline/2.3-develop'
2 parents 2e374a6 + 0f61d2d commit b6cf9bb

File tree

764 files changed

+13018
-2999
lines changed

Some content is hidden

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

764 files changed

+13018
-2999
lines changed

Diff for: .php_cs.dist

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66

77
/**
8-
* Pre-commit hook installation:
9-
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
8+
* PHP Coding Standards fixer configuration
109
*/
10+
1111
$finder = PhpCsFixer\Finder::create()
1212
->name('*.phtml')
1313
->exclude('dev/tests/functional/generated')

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=develop)](https://travis-ci.org/magento/magento2)
1+
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=2.3-develop)](https://travis-ci.org/magento/magento2)
22
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
33
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.png)](https://crowdin.com/project/magento-2)
44
<h2>Welcome</h2>

Diff for: app/code/Magento/AdminNotification/etc/db_schema.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="adminnotification_inbox" resource="default" engine="innodb" comment="Adminnotification Inbox">
1111
<column xsi:type="int" name="notification_id" padding="10" unsigned="true" nullable="false" identity="true"
1212
comment="Notification id"/>

Diff for: app/code/Magento/Analytics/Block/Adminhtml/System/Config/CollectionTimeLabel.php

+26-2
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,45 @@
55
*/
66
namespace Magento\Analytics\Block\Adminhtml\System\Config;
77

8+
use Magento\Framework\App\ObjectManager;
9+
810
/**
911
* Provides label with default Time Zone
1012
*/
1113
class CollectionTimeLabel extends \Magento\Config\Block\System\Config\Form\Field
1214
{
1315
/**
14-
* Add default time zone to comment
16+
* @var \Magento\Framework\Locale\ResolverInterface
17+
*/
18+
private $localeResolver;
19+
20+
/**
21+
* @param \Magento\Backend\Block\Template\Context $context
22+
* @param array $data
23+
* @param \Magento\Framework\Locale\ResolverInterface|null $localeResolver
24+
*/
25+
public function __construct(
26+
\Magento\Backend\Block\Template\Context $context,
27+
array $data = [],
28+
\Magento\Framework\Locale\ResolverInterface $localeResolver = null
29+
) {
30+
$this->localeResolver = $localeResolver ?:
31+
ObjectManager::getInstance()->get(\Magento\Framework\Locale\ResolverInterface::class);
32+
parent::__construct($context, $data);
33+
}
34+
35+
/**
36+
* Add current time zone to comment, properly translated according to locale
1537
*
1638
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
1739
* @return string
1840
*/
1941
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
2042
{
2143
$timeZoneCode = $this->_localeDate->getConfigTimezone();
22-
$getLongTimeZoneName = \IntlTimeZone::createTimeZone($timeZoneCode)->getDisplayName();
44+
$locale = $this->localeResolver->getLocale();
45+
$getLongTimeZoneName = \IntlTimeZone::createTimeZone($timeZoneCode)
46+
->getDisplayName(false, \IntlTimeZone::DISPLAY_LONG, $locale);
2347
$element->setData(
2448
'comment',
2549
sprintf("%s (%s)", $getLongTimeZoneName, $timeZoneCode)

Diff for: app/code/Magento/Analytics/Setup/Patch/Data/PrepareInitialConfig.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
namespace Magento\Analytics\Setup\Patch\Data;
88

99
use Magento\Analytics\Model\Config\Backend\Enabled\SubscriptionHandler;
10-
use Magento\Framework\App\ResourceConnection;
1110
use Magento\Framework\Setup\ModuleDataSetupInterface;
12-
use Magento\Setup\Model\Patch\DataPatchInterface;
13-
use Magento\Setup\Model\Patch\PatchVersionInterface;
11+
use Magento\Framework\Setup\Patch\DataPatchInterface;
12+
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1413

1514
/**
1615
* Initial patch.

Diff for: app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/CollectionTimeLabelTest.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Backend\Block\Template\Context;
1010
use Magento\Framework\Data\Form;
1111
use Magento\Framework\Data\Form\Element\AbstractElement;
12+
use Magento\Framework\Locale\ResolverInterface;
1213
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1314
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1415

@@ -34,6 +35,11 @@ class CollectionTimeLabelTest extends \PHPUnit\Framework\TestCase
3435
*/
3536
private $abstractElementMock;
3637

38+
/**
39+
* @var ResolverInterface|\PHPUnit_Framework_MockObject_MockObject
40+
*/
41+
private $localeResolver;
42+
3743
protected function setUp()
3844
{
3945
$this->abstractElementMock = $this->getMockBuilder(AbstractElement::class)
@@ -53,12 +59,17 @@ protected function setUp()
5359
$this->contextMock->expects($this->any())
5460
->method('getLocaleDate')
5561
->willReturn($this->timeZoneMock);
62+
$this->localeResolver = $this->getMockBuilder(ResolverInterface::class)
63+
->disableOriginalConstructor()
64+
->setMethods(['getLocale'])
65+
->getMockForAbstractClass();
5666

5767
$objectManager = new ObjectManager($this);
5868
$this->collectionTimeLabel = $objectManager->getObject(
5969
CollectionTimeLabel::class,
6070
[
61-
'context' => $this->contextMock
71+
'context' => $this->contextMock,
72+
'localeResolver' => $this->localeResolver
6273
]
6374
);
6475
}
@@ -73,6 +84,9 @@ public function testRender()
7384
$this->abstractElementMock->expects($this->any())
7485
->method('getComment')
7586
->willReturn('Eastern Standard Time (America/New_York)');
87+
$this->localeResolver->expects($this->once())
88+
->method('getLocale')
89+
->willReturn('en_US');
7690
$this->assertRegexp(
7791
"/Eastern Standard Time \(America\/New_York\)/",
7892
$this->collectionTimeLabel->render($this->abstractElementMock)

Diff for: app/code/Magento/AsynchronousOperations/etc/db_schema.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="magento_bulk" resource="default" engine="innodb"
1111
comment="Bulk entity that represents set of related asynchronous operations">
1212
<column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true"

Diff for: app/code/Magento/Authorization/Setup/Patch/Data/InitializeAuthRoles.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
use Magento\Framework\App\ResourceConnection;
1010
use Magento\Framework\Setup\ModuleDataSetupInterface;
11-
use Magento\Setup\Model\Patch\DataPatchInterface;
12-
use Magento\Setup\Model\Patch\PatchVersionInterface;
11+
use Magento\Framework\Setup\Patch\DataPatchInterface;
12+
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1313
use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
1414
use Magento\Authorization\Model\UserContextInterface;
1515

Diff for: app/code/Magento/Authorization/etc/db_schema.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="authorization_role" resource="default" engine="innodb" comment="Admin Role Table">
1111
<column xsi:type="int" name="role_id" padding="10" unsigned="true" nullable="false" identity="true"
1212
comment="Role ID"/>

Diff for: app/code/Magento/Braintree/Setup/Patch/Data/ConvertSerializedDataToJson.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
use Magento\Framework\App\ResourceConnection;
1010
use Magento\Framework\Setup\ModuleDataSetupInterface;
11-
use Magento\Setup\Model\Patch\DataPatchInterface;
12-
use Magento\Setup\Model\Patch\PatchVersionInterface;
11+
use Magento\Framework\Setup\Patch\DataPatchInterface;
12+
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1313

1414
/**
1515
* Convert data fro php native serialized data to JSON.

Diff for: app/code/Magento/Bundle/Setup/Patch/Data/ApplyAttributesUpdate.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
use Magento\Framework\App\ResourceConnection;
1010
use Magento\Framework\Setup\ModuleDataSetupInterface;
11-
use Magento\Setup\Model\Patch\DataPatchInterface;
12-
use Magento\Setup\Model\Patch\PatchVersionInterface;
11+
use Magento\Framework\Setup\Patch\DataPatchInterface;
12+
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1313
use Magento\Eav\Setup\EavSetup;
1414
use Magento\Eav\Setup\EavSetupFactory;
1515

Diff for: app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedEntityTytpes.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use Magento\Eav\Setup\EavSetupFactory;
1010
use Magento\Framework\App\ResourceConnection;
1111
use Magento\Framework\Setup\ModuleDataSetupInterface;
12-
use Magento\Setup\Model\Patch\DataPatchInterface;
13-
use Magento\Setup\Model\Patch\PatchVersionInterface;
12+
use Magento\Framework\Setup\Patch\DataPatchInterface;
13+
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1414
use Magento\Catalog\Api\Data\ProductAttributeInterface;
1515
use Magento\Eav\Setup\EavSetup;
1616

Diff for: app/code/Magento/Bundle/Setup/Patch/Schema/UpdateBundleRelatedSchema.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
namespace Magento\Bundle\Setup\Patch\Schema;
88

99
use Magento\Framework\Setup\SchemaSetupInterface;
10-
use Magento\Setup\Model\Patch\PatchVersionInterface;
11-
use Magento\Setup\Model\Patch\SchemaPatchInterface;
10+
use Magento\Framework\Setup\Patch\PatchVersionInterface;
11+
use Magento\Framework\Setup\Patch\SchemaPatchInterface;
1212

1313
/**
1414
* Class UpdateBundleRelatedSchema

Diff for: app/code/Magento/Bundle/etc/db_schema.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="catalog_product_bundle_option" resource="default" engine="innodb"
1111
comment="Catalog Product Bundle Option">
1212
<column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="true"

Diff for: app/code/Magento/Captcha/etc/db_schema.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="captcha_log" resource="default" engine="innodb" comment="Count Login Attempts">
1111
<column xsi:type="varchar" name="type" nullable="false" length="32" comment="Type"/>
1212
<column xsi:type="varchar" name="value" nullable="false" length="32" comment="Value"/>

Diff for: app/code/Magento/Catalog/Api/Data/CategoryInterface.php

+31
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,37 @@
1414
*/
1515
interface CategoryInterface extends \Magento\Framework\Api\CustomAttributesDataInterface
1616
{
17+
/**#@+
18+
* Constants defined for keys of data array
19+
*/
20+
const KEY_PARENT_ID = 'parent_id';
21+
const KEY_NAME = 'name';
22+
const KEY_IS_ACTIVE = 'is_active';
23+
const KEY_POSITION = 'position';
24+
const KEY_LEVEL = 'level';
25+
const KEY_UPDATED_AT = 'updated_at';
26+
const KEY_CREATED_AT = 'created_at';
27+
const KEY_PATH = 'path';
28+
const KEY_AVAILABLE_SORT_BY = 'available_sort_by';
29+
const KEY_INCLUDE_IN_MENU = 'include_in_menu';
30+
const KEY_PRODUCT_COUNT = 'product_count';
31+
const KEY_CHILDREN_DATA = 'children_data';
32+
33+
const ATTRIBUTES = [
34+
'id',
35+
self::KEY_PARENT_ID,
36+
self::KEY_NAME,
37+
self::KEY_IS_ACTIVE,
38+
self::KEY_POSITION,
39+
self::KEY_LEVEL,
40+
self::KEY_UPDATED_AT,
41+
self::KEY_CREATED_AT,
42+
self::KEY_AVAILABLE_SORT_BY,
43+
self::KEY_INCLUDE_IN_MENU,
44+
self::KEY_CHILDREN_DATA,
45+
];
46+
/**#@-*/
47+
1748
/**
1849
* @return int|null
1950
*/

Diff for: app/code/Magento/Catalog/Api/Data/ProductAttributeInterface.php

+5
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ interface ProductAttributeInterface extends \Magento\Catalog\Api\Data\EavAttribu
3232
const CODE_TIER_PRICE_FIELD_VALUE_TYPE = 'value_type';
3333
const CODE_SEO_FIELD_META_DESCRIPTION = 'meta_description';
3434
const CODE_WEIGHT = 'weight';
35+
36+
/**
37+
* @return \Magento\Eav\Api\Data\AttributeExtensionInterface|null
38+
*/
39+
public function getExtensionAttributes();
3540
}

Diff for: app/code/Magento/Catalog/Api/Data/ProductInterface.php

+18
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@ interface ProductInterface extends \Magento\Framework\Api\CustomAttributesDataIn
3636

3737
const UPDATED_AT = 'updated_at';
3838

39+
const MEDIA_GALLERY = 'media_gallery';
40+
41+
const TIER_PRICE = 'tier_price';
42+
43+
const ATTRIBUTES = [
44+
self::SKU,
45+
self::NAME,
46+
self::PRICE,
47+
self::WEIGHT,
48+
self::STATUS,
49+
self::VISIBILITY,
50+
self::ATTRIBUTE_SET_ID,
51+
self::TYPE_ID,
52+
self::CREATED_AT,
53+
self::UPDATED_AT,
54+
self::MEDIA_GALLERY,
55+
self::TIER_PRICE,
56+
];
3957
/**#@-*/
4058

4159
/**

Diff for: app/code/Magento/Catalog/Block/Product/ImageBuilder.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Catalog\Block\Product;
77

88
use Magento\Catalog\Helper\ImageFactory as HelperFactory;
9+
use Magento\Catalog\Model\Product;
910
use Magento\Catalog\Model\Product\Image\NotLoadInfoImageException;
1011

1112
class ImageBuilder
@@ -21,7 +22,7 @@ class ImageBuilder
2122
protected $helperFactory;
2223

2324
/**
24-
* @var \Magento\Catalog\Model\Product
25+
* @var Product
2526
*/
2627
protected $product;
2728

@@ -50,10 +51,10 @@ public function __construct(
5051
/**
5152
* Set product
5253
*
53-
* @param \Magento\Catalog\Model\Product $product
54+
* @param Product $product
5455
* @return $this
5556
*/
56-
public function setProduct(\Magento\Catalog\Model\Product $product)
57+
public function setProduct(Product $product)
5758
{
5859
$this->product = $product;
5960
return $this;
@@ -79,9 +80,7 @@ public function setImageId($imageId)
7980
*/
8081
public function setAttributes(array $attributes)
8182
{
82-
if ($attributes) {
83-
$this->attributes = $attributes;
84-
}
83+
$this->attributes = $attributes;
8584
return $this;
8685
}
8786

0 commit comments

Comments
 (0)