Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 332f88f

Browse files
author
Janak Bhimani
authored
Merge pull request #1 from magento/2.2-develop
2.2 develop
2 parents 1804146 + ea1ace7 commit 332f88f

File tree

73 files changed

+417
-178
lines changed

Some content is hidden

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

73 files changed

+417
-178
lines changed

README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,8 @@ Magento is thankful for any contribution that can improve our code base, documen
4141
</a>
4242

4343
<h3>Labels applied by the Magento team</h3>
44-
45-
| Label | Description |
46-
| ------------- |-------------|
47-
| ![DOC](http://devdocs.magento.com/common/images/github_DOC.png) | Affects Documentation domain. |
48-
| ![PROD](http://devdocs.magento.com/common/images/github_PROD.png) | Affects the Product team (mostly feature requests or business logic change). |
49-
| ![TECH](http://devdocs.magento.com/common/images/github_TECH.png) | Affects Architect Group (mostly to make decisions around technology changes). |
50-
| ![accept](http://devdocs.magento.com/common/images/github_accept.png) | The pull request has been accepted and will be merged into mainline code. |
51-
| ![reject](http://devdocs.magento.com/common/images/github_reject.png) | The pull request has been rejected and will not be merged into mainline code. Possible reasons can include but are not limited to: issue has already been fixed in another code contribution, or there is an issue with the code contribution. |
52-
| ![bug report](http://devdocs.magento.com/common/images/github_bug.png) | The Magento Team has confirmed that this issue contains the minimum required information to reproduce. |
53-
| ![acknowledged](http://devdocs.magento.com/common/images/gitHub_acknowledged.png) | The Magento Team has validated the issue and an internal ticket has been created. |
54-
| ![in progress](http://devdocs.magento.com/common/images/github_inProgress.png) | The internal ticket is currently in progress, fix is scheduled to be delivered. |
55-
| ![needs update](http://devdocs.magento.com/common/images/github_needsUpdate.png) | The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request. |
56-
57-
To learn more about issue gate labels click [here](https://github.com/magento/magento2/wiki/Magento-Issue-Gates)
44+
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
45+
Please review the <a href="https://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#labels">Code Contributions guide</a> for detailed information on labels used in Magento 2 repositories.
5846

5947
<h2>Reporting security issues</h2>
6048

app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ public function getJoins()
8787
* Set joins conditions
8888
*
8989
* @param array $joins
90-
* @return void
90+
* @return $this
9191
*/
9292
public function setJoins($joins)
9393
{
9494
$this->joins = $joins;
95+
96+
return $this;
9597
}
9698

9799
/**
@@ -108,11 +110,13 @@ public function getConnectionName()
108110
* Set connection name
109111
*
110112
* @param string $connectionName
111-
* @return void
113+
* @return $this
112114
*/
113115
public function setConnectionName($connectionName)
114116
{
115117
$this->connectionName = $connectionName;
118+
119+
return $this;
116120
}
117121

118122
/**
@@ -129,11 +133,13 @@ public function getColumns()
129133
* Set columns
130134
*
131135
* @param array $columns
132-
* @return void
136+
* @return $this
133137
*/
134138
public function setColumns($columns)
135139
{
136140
$this->columns = $columns;
141+
142+
return $this;
137143
}
138144

139145
/**
@@ -150,11 +156,13 @@ public function getFilters()
150156
* Set filters
151157
*
152158
* @param array $filters
153-
* @return void
159+
* @return $this
154160
*/
155161
public function setFilters($filters)
156162
{
157163
$this->filters = $filters;
164+
165+
return $this;
158166
}
159167

160168
/**
@@ -171,11 +179,13 @@ public function getFrom()
171179
* Set from condition
172180
*
173181
* @param array $from
174-
* @return void
182+
* @return $this
175183
*/
176184
public function setFrom($from)
177185
{
178186
$this->from = $from;
187+
188+
return $this;
179189
}
180190

181191
/**
@@ -238,11 +248,13 @@ public function getGroup()
238248
* Set group
239249
*
240250
* @param array $group
241-
* @return void
251+
* @return $this
242252
*/
243253
public function setGroup($group)
244254
{
245255
$this->group = $group;
256+
257+
return $this;
246258
}
247259

248260
/**
@@ -259,11 +271,13 @@ public function getParams()
259271
* Set parameters
260272
*
261273
* @param array $params
262-
* @return void
274+
* @return $this
263275
*/
264276
public function setParams($params)
265277
{
266278
$this->params = $params;
279+
280+
return $this;
267281
}
268282

269283
/**
@@ -280,10 +294,12 @@ public function getHaving()
280294
* Set having condition
281295
*
282296
* @param array $having
283-
* @return void
297+
* @return $this
284298
*/
285299
public function setHaving($having)
286300
{
287301
$this->having = $having;
302+
303+
return $this;
288304
}
289305
}

app/code/Magento/Analytics/Test/Unit/ReportXml/DB/SelectBuilderTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ public function testCreate()
6767
['link-type' => 'right', 'table' => 'attribute', 'condition' => 'neq'],
6868
];
6969
$groups = ['id', 'name'];
70-
$this->selectBuilder->setConnectionName($connectionName);
71-
$this->selectBuilder->setFrom($from);
72-
$this->selectBuilder->setColumns($columns);
73-
$this->selectBuilder->setFilters([$filter]);
74-
$this->selectBuilder->setJoins($joins);
75-
$this->selectBuilder->setGroup($groups);
70+
$this->selectBuilder->setConnectionName($connectionName)
71+
->setFrom($from)
72+
->setColumns($columns)
73+
->setFilters([$filter])
74+
->setJoins($joins)
75+
->setGroup($groups);
7676
$this->resourceConnectionMock->expects($this->once())
7777
->method('getConnection')
7878
->with($connectionName)

app/code/Magento/Backend/Block/Menu.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,23 @@ class Menu extends \Magento\Backend\Block\Template
7676
*/
7777
private $anchorRenderer;
7878

79+
/**
80+
* @var ConfigInterface
81+
*/
82+
private $routeConfig;
83+
7984
/**
8085
* @param Template\Context $context
8186
* @param \Magento\Backend\Model\UrlInterface $url
8287
* @param \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory
8388
* @param \Magento\Backend\Model\Auth\Session $authSession
8489
* @param \Magento\Backend\Model\Menu\Config $menuConfig
8590
* @param \Magento\Framework\Locale\ResolverInterface $localeResolver
91+
* @param \Magento\Framework\App\Route\ConfigInterface $routeConfig
8692
* @param array $data
8793
* @param MenuItemChecker|null $menuItemChecker
8894
* @param AnchorRenderer|null $anchorRenderer
95+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8996
*/
9097
public function __construct(
9198
\Magento\Backend\Block\Template\Context $context,
@@ -96,7 +103,8 @@ public function __construct(
96103
\Magento\Framework\Locale\ResolverInterface $localeResolver,
97104
array $data = [],
98105
MenuItemChecker $menuItemChecker = null,
99-
AnchorRenderer $anchorRenderer = null
106+
AnchorRenderer $anchorRenderer = null,
107+
\Magento\Framework\App\Route\ConfigInterface $routeConfig = null
100108
) {
101109
$this->_url = $url;
102110
$this->_iteratorFactory = $iteratorFactory;
@@ -105,6 +113,9 @@ public function __construct(
105113
$this->_localeResolver = $localeResolver;
106114
$this->menuItemChecker = $menuItemChecker;
107115
$this->anchorRenderer = $anchorRenderer;
116+
$this->routeConfig = $routeConfig ?:
117+
\Magento\Framework\App\ObjectManager::getInstance()
118+
->get(\Magento\Framework\App\Route\ConfigInterface::class);
108119
parent::__construct($context, $data);
109120
}
110121

@@ -203,8 +214,9 @@ protected function _afterToHtml($html)
203214
*/
204215
protected function _callbackSecretKey($match)
205216
{
217+
$routeId = $this->routeConfig->getRouteByFrontName($match[1]);
206218
return \Magento\Backend\Model\UrlInterface::SECRET_KEY_PARAM_NAME . '/' . $this->_url->getSecretKey(
207-
$match[1],
219+
$routeId,
208220
$match[2],
209221
$match[3]
210222
);

app/code/Magento/Backend/Block/Widget/Button/ButtonList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ public function getItems()
127127
*/
128128
public function sortButtons(Item $itemA, Item $itemB)
129129
{
130-
$sortOrderA = intval($itemA->getSortOrder());
131-
$sortOrderB = intval($itemB->getSortOrder());
130+
$sortOrderA = (int) $itemA->getSortOrder();
131+
$sortOrderB = (int) $itemB->getSortOrder();
132132

133133
if ($sortOrderA == $sortOrderB) {
134134
return 0;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function add(Item $item, $parentId = null, $index = null)
8383
}
8484
$parentItem->getChildren()->add($item, null, $index);
8585
} else {
86-
$index = intval($index);
86+
$index = (int) $index;
8787
if (!isset($this[$index])) {
8888
$this->offsetSet($index, $item);
8989
$this->_logger->info(

app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
data-validate="{required:true}"
4444
value=""
4545
placeholder="<?= /* @escapeNotVerified */ __('password') ?>"
46-
autocomplete="new-password"
46+
autocomplete="off"
4747
/>
4848
</div>
4949
</div>

app/code/Magento/Backup/Model/Config/Backend/Cron.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ public function afterSave()
7676

7777
if ($enabled) {
7878
$cronExprArray = [
79-
intval($time[1]), # Minute
80-
intval($time[0]), # Hour
81-
$frequency == $frequencyMonthly ? '1' : '*', # Day of the Month
82-
'*', # Month of the Year
83-
$frequency == $frequencyWeekly ? '1' : '*', # Day of the Week
79+
(int) $time[1], # Minute
80+
(int) $time[0], # Hour
81+
$frequency == $frequencyMonthly ? '1' : '*', # Day of the Month
82+
'*', # Month of the Year
83+
$frequency == $frequencyWeekly ? '1' : '*', # Day of the Week
8484
];
85-
$cronExprString = join(' ', $cronExprArray);
85+
$cronExprString = implode(' ', $cronExprArray);
8686
} else {
8787
$cronExprString = '';
8888
}

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
539539
foreach ($options as $quoteItemOption) {
540540
if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
541541
if ($optionUpdateFlag) {
542-
$quoteItemOption->setValue(intval($quoteItemOption->getValue()));
542+
$quoteItemOption->setValue((int) $quoteItemOption->getValue());
543543
} else {
544544
$quoteItemOption->setValue($value);
545545
}
@@ -561,7 +561,7 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
561561
*/
562562
public function prepareQuoteItemQty($qty, $product)
563563
{
564-
return intval($qty);
564+
return (int) $qty;
565565
}
566566

567567
/**

app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,10 @@ protected function _prepareForm()
8181
*/
8282
protected function _getSetId()
8383
{
84-
return intval(
85-
$this->getRequest()->getParam('id')
86-
) > 0 ? intval(
87-
$this->getRequest()->getParam('id')
88-
) : $this->_typeFactory->create()->load(
89-
$this->_coreRegistry->registry('entityType')
90-
)->getDefaultAttributeSetId();
84+
return (int) $this->getRequest()->getParam('id') > 0
85+
? (int) $this->getRequest()->getParam('id')
86+
: $this->_typeFactory->create()->load(
87+
$this->_coreRegistry->registry('entityType')
88+
)->getDefaultAttributeSetId();
9189
}
9290
}

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getFieldSuffix()
7474
public function getStoreId()
7575
{
7676
$storeId = $this->getRequest()->getParam('store');
77-
return intval($storeId);
77+
return (int) $storeId;
7878
}
7979

8080
/**

app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ public function getRowCount()
171171
*/
172172
public function setColumnCount($columns)
173173
{
174-
if (intval($columns) > 0) {
175-
$this->_columnCount = intval($columns);
174+
if ((int) $columns > 0) {
175+
$this->_columnCount = (int) $columns;
176176
}
177177
return $this;
178178
}
@@ -214,8 +214,8 @@ public function getIterableItem()
214214
*/
215215
public function setItemLimit($type, $limit)
216216
{
217-
if (intval($limit) > 0) {
218-
$this->_itemLimits[$type] = intval($limit);
217+
if ((int) $limit > 0) {
218+
$this->_itemLimits[$type] = (int) $limit;
219219
}
220220
return $this;
221221
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ public function getParentId()
721721
return $parentId;
722722
}
723723
$parentIds = $this->getParentIds();
724-
return intval(array_pop($parentIds));
724+
return (int) array_pop($parentIds);
725725
}
726726

727727
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function process(\DOMElement $mediaNode, $mediaParentTag)
3636
if ($attributeTagName === 'background') {
3737
$nodeValue = $this->processImageBackground($attribute->nodeValue);
3838
} elseif ($attributeTagName === 'width' || $attributeTagName === 'height') {
39-
$nodeValue = intval($attribute->nodeValue);
39+
$nodeValue = (int)$attribute->nodeValue;
4040
} else {
4141
$nodeValue = $attribute->nodeValue;
4242
}

app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function getColumns()
113113
public function getMainStoreTable($storeId = \Magento\Store\Model\Store::DEFAULT_STORE_ID)
114114
{
115115
if (is_string($storeId)) {
116-
$storeId = intval($storeId);
116+
$storeId = (int) $storeId;
117117
}
118118

119119
$suffix = sprintf('store_%d', $storeId);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,9 @@ public function getStoreIds()
809809
if (!$this->hasStoreIds()) {
810810
$storeIds = [];
811811
if ($websiteIds = $this->getWebsiteIds()) {
812+
if ($this->_storeManager->isSingleStoreMode()) {
813+
$websiteIds = array_keys($websiteIds);
814+
}
812815
foreach ($websiteIds as $websiteId) {
813816
$websiteStores = $this->_storeManager->getWebsite($websiteId)->getStoreIds();
814817
$storeIds = array_merge($storeIds, $websiteStores);

app/code/Magento/Catalog/Model/Product/Compare/Item.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ public function addProductData($product)
158158
{
159159
if ($product instanceof Product) {
160160
$this->setProductId($product->getId());
161-
} elseif (intval($product)) {
162-
$this->setProductId(intval($product));
161+
} elseif ((int) $product) {
162+
$this->setProductId((int) $product);
163163
}
164164

165165
return $this;

app/code/Magento/Catalog/Model/Product/Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ public function resize()
494494
*/
495495
public function rotate($angle)
496496
{
497-
$angle = intval($angle);
497+
$angle = (int) $angle;
498498
$this->getImageProcessor()->rotate($angle);
499499
return $this;
500500
}

0 commit comments

Comments
 (0)