Skip to content

Commit

Permalink
Merge pull request #1 from magento/2.2-develop
Browse files Browse the repository at this point in the history
2.2 develop
  • Loading branch information
Janak Bhimani authored Sep 24, 2018
2 parents 1804146 + ea1ace7 commit 332f88f
Show file tree
Hide file tree
Showing 73 changed files with 417 additions and 178 deletions.
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,8 @@ Magento is thankful for any contribution that can improve our code base, documen
</a>

<h3>Labels applied by the Magento team</h3>

| Label | Description |
| ------------- |-------------|
| ![DOC](http://devdocs.magento.com/common/images/github_DOC.png) | Affects Documentation domain. |
| ![PROD](http://devdocs.magento.com/common/images/github_PROD.png) | Affects the Product team (mostly feature requests or business logic change). |
| ![TECH](http://devdocs.magento.com/common/images/github_TECH.png) | Affects Architect Group (mostly to make decisions around technology changes). |
| ![accept](http://devdocs.magento.com/common/images/github_accept.png) | The pull request has been accepted and will be merged into mainline code. |
| ![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. |
| ![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. |
| ![acknowledged](http://devdocs.magento.com/common/images/gitHub_acknowledged.png) | The Magento Team has validated the issue and an internal ticket has been created. |
| ![in progress](http://devdocs.magento.com/common/images/github_inProgress.png) | The internal ticket is currently in progress, fix is scheduled to be delivered. |
| ![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. |

To learn more about issue gate labels click [here](https://github.com/magento/magento2/wiki/Magento-Issue-Gates)
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.
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.

<h2>Reporting security issues</h2>

Expand Down
32 changes: 24 additions & 8 deletions app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ public function getJoins()
* Set joins conditions
*
* @param array $joins
* @return void
* @return $this
*/
public function setJoins($joins)
{
$this->joins = $joins;

return $this;
}

/**
Expand All @@ -108,11 +110,13 @@ public function getConnectionName()
* Set connection name
*
* @param string $connectionName
* @return void
* @return $this
*/
public function setConnectionName($connectionName)
{
$this->connectionName = $connectionName;

return $this;
}

/**
Expand All @@ -129,11 +133,13 @@ public function getColumns()
* Set columns
*
* @param array $columns
* @return void
* @return $this
*/
public function setColumns($columns)
{
$this->columns = $columns;

return $this;
}

/**
Expand All @@ -150,11 +156,13 @@ public function getFilters()
* Set filters
*
* @param array $filters
* @return void
* @return $this
*/
public function setFilters($filters)
{
$this->filters = $filters;

return $this;
}

/**
Expand All @@ -171,11 +179,13 @@ public function getFrom()
* Set from condition
*
* @param array $from
* @return void
* @return $this
*/
public function setFrom($from)
{
$this->from = $from;

return $this;
}

/**
Expand Down Expand Up @@ -238,11 +248,13 @@ public function getGroup()
* Set group
*
* @param array $group
* @return void
* @return $this
*/
public function setGroup($group)
{
$this->group = $group;

return $this;
}

/**
Expand All @@ -259,11 +271,13 @@ public function getParams()
* Set parameters
*
* @param array $params
* @return void
* @return $this
*/
public function setParams($params)
{
$this->params = $params;

return $this;
}

/**
Expand All @@ -280,10 +294,12 @@ public function getHaving()
* Set having condition
*
* @param array $having
* @return void
* @return $this
*/
public function setHaving($having)
{
$this->having = $having;

return $this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ public function testCreate()
['link-type' => 'right', 'table' => 'attribute', 'condition' => 'neq'],
];
$groups = ['id', 'name'];
$this->selectBuilder->setConnectionName($connectionName);
$this->selectBuilder->setFrom($from);
$this->selectBuilder->setColumns($columns);
$this->selectBuilder->setFilters([$filter]);
$this->selectBuilder->setJoins($joins);
$this->selectBuilder->setGroup($groups);
$this->selectBuilder->setConnectionName($connectionName)
->setFrom($from)
->setColumns($columns)
->setFilters([$filter])
->setJoins($joins)
->setGroup($groups);
$this->resourceConnectionMock->expects($this->once())
->method('getConnection')
->with($connectionName)
Expand Down
16 changes: 14 additions & 2 deletions app/code/Magento/Backend/Block/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,23 @@ class Menu extends \Magento\Backend\Block\Template
*/
private $anchorRenderer;

/**
* @var ConfigInterface
*/
private $routeConfig;

/**
* @param Template\Context $context
* @param \Magento\Backend\Model\UrlInterface $url
* @param \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory
* @param \Magento\Backend\Model\Auth\Session $authSession
* @param \Magento\Backend\Model\Menu\Config $menuConfig
* @param \Magento\Framework\Locale\ResolverInterface $localeResolver
* @param \Magento\Framework\App\Route\ConfigInterface $routeConfig
* @param array $data
* @param MenuItemChecker|null $menuItemChecker
* @param AnchorRenderer|null $anchorRenderer
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
Expand All @@ -96,7 +103,8 @@ public function __construct(
\Magento\Framework\Locale\ResolverInterface $localeResolver,
array $data = [],
MenuItemChecker $menuItemChecker = null,
AnchorRenderer $anchorRenderer = null
AnchorRenderer $anchorRenderer = null,
\Magento\Framework\App\Route\ConfigInterface $routeConfig = null
) {
$this->_url = $url;
$this->_iteratorFactory = $iteratorFactory;
Expand All @@ -105,6 +113,9 @@ public function __construct(
$this->_localeResolver = $localeResolver;
$this->menuItemChecker = $menuItemChecker;
$this->anchorRenderer = $anchorRenderer;
$this->routeConfig = $routeConfig ?:
\Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Framework\App\Route\ConfigInterface::class);
parent::__construct($context, $data);
}

Expand Down Expand Up @@ -203,8 +214,9 @@ protected function _afterToHtml($html)
*/
protected function _callbackSecretKey($match)
{
$routeId = $this->routeConfig->getRouteByFrontName($match[1]);
return \Magento\Backend\Model\UrlInterface::SECRET_KEY_PARAM_NAME . '/' . $this->_url->getSecretKey(
$match[1],
$routeId,
$match[2],
$match[3]
);
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Backend/Block/Widget/Button/ButtonList.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public function getItems()
*/
public function sortButtons(Item $itemA, Item $itemB)
{
$sortOrderA = intval($itemA->getSortOrder());
$sortOrderB = intval($itemB->getSortOrder());
$sortOrderA = (int) $itemA->getSortOrder();
$sortOrderB = (int) $itemB->getSortOrder();

if ($sortOrderA == $sortOrderB) {
return 0;
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Model/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function add(Item $item, $parentId = null, $index = null)
}
$parentItem->getChildren()->add($item, null, $index);
} else {
$index = intval($index);
$index = (int) $index;
if (!isset($this[$index])) {
$this->offsetSet($index, $item);
$this->_logger->info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
data-validate="{required:true}"
value=""
placeholder="<?= /* @escapeNotVerified */ __('password') ?>"
autocomplete="new-password"
autocomplete="off"
/>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions app/code/Magento/Backup/Model/Config/Backend/Cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ public function afterSave()

if ($enabled) {
$cronExprArray = [
intval($time[1]), # Minute
intval($time[0]), # Hour
$frequency == $frequencyMonthly ? '1' : '*', # Day of the Month
'*', # Month of the Year
$frequency == $frequencyWeekly ? '1' : '*', # Day of the Week
(int) $time[1], # Minute
(int) $time[0], # Hour
$frequency == $frequencyMonthly ? '1' : '*', # Day of the Month
'*', # Month of the Year
$frequency == $frequencyWeekly ? '1' : '*', # Day of the Week
];
$cronExprString = join(' ', $cronExprArray);
$cronExprString = implode(' ', $cronExprArray);
} else {
$cronExprString = '';
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Bundle/Model/Product/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
foreach ($options as $quoteItemOption) {
if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
if ($optionUpdateFlag) {
$quoteItemOption->setValue(intval($quoteItemOption->getValue()));
$quoteItemOption->setValue((int) $quoteItemOption->getValue());
} else {
$quoteItemOption->setValue($value);
}
Expand All @@ -561,7 +561,7 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
*/
public function prepareQuoteItemQty($qty, $product)
{
return intval($qty);
return (int) $qty;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ protected function _prepareForm()
*/
protected function _getSetId()
{
return intval(
$this->getRequest()->getParam('id')
) > 0 ? intval(
$this->getRequest()->getParam('id')
) : $this->_typeFactory->create()->load(
$this->_coreRegistry->registry('entityType')
)->getDefaultAttributeSetId();
return (int) $this->getRequest()->getParam('id') > 0
? (int) $this->getRequest()->getParam('id')
: $this->_typeFactory->create()->load(
$this->_coreRegistry->registry('entityType')
)->getDefaultAttributeSetId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getFieldSuffix()
public function getStoreId()
{
$storeId = $this->getRequest()->getParam('store');
return intval($storeId);
return (int) $storeId;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public function getRowCount()
*/
public function setColumnCount($columns)
{
if (intval($columns) > 0) {
$this->_columnCount = intval($columns);
if ((int) $columns > 0) {
$this->_columnCount = (int) $columns;
}
return $this;
}
Expand Down Expand Up @@ -214,8 +214,8 @@ public function getIterableItem()
*/
public function setItemLimit($type, $limit)
{
if (intval($limit) > 0) {
$this->_itemLimits[$type] = intval($limit);
if ((int) $limit > 0) {
$this->_itemLimits[$type] = (int) $limit;
}
return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ public function getParentId()
return $parentId;
}
$parentIds = $this->getParentIds();
return intval(array_pop($parentIds));
return (int) array_pop($parentIds);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/ImageExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function process(\DOMElement $mediaNode, $mediaParentTag)
if ($attributeTagName === 'background') {
$nodeValue = $this->processImageBackground($attribute->nodeValue);
} elseif ($attributeTagName === 'width' || $attributeTagName === 'height') {
$nodeValue = intval($attribute->nodeValue);
$nodeValue = (int)$attribute->nodeValue;
} else {
$nodeValue = $attribute->nodeValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function getColumns()
public function getMainStoreTable($storeId = \Magento\Store\Model\Store::DEFAULT_STORE_ID)
{
if (is_string($storeId)) {
$storeId = intval($storeId);
$storeId = (int) $storeId;
}

$suffix = sprintf('store_%d', $storeId);
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,9 @@ public function getStoreIds()
if (!$this->hasStoreIds()) {
$storeIds = [];
if ($websiteIds = $this->getWebsiteIds()) {
if ($this->_storeManager->isSingleStoreMode()) {
$websiteIds = array_keys($websiteIds);
}
foreach ($websiteIds as $websiteId) {
$websiteStores = $this->_storeManager->getWebsite($websiteId)->getStoreIds();
$storeIds = array_merge($storeIds, $websiteStores);
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/Model/Product/Compare/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ public function addProductData($product)
{
if ($product instanceof Product) {
$this->setProductId($product->getId());
} elseif (intval($product)) {
$this->setProductId(intval($product));
} elseif ((int) $product) {
$this->setProductId((int) $product);
}

return $this;
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/Product/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public function resize()
*/
public function rotate($angle)
{
$angle = intval($angle);
$angle = (int) $angle;
$this->getImageProcessor()->rotate($angle);
return $this;
}
Expand Down
Loading

0 comments on commit 332f88f

Please sign in to comment.