Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/develop' into NORD-FIXES
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanKostiv1 committed Jun 21, 2017
2 parents a6b3229 + 09a4858 commit 4eb8398
Show file tree
Hide file tree
Showing 262 changed files with 1,258 additions and 456 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sudo: required
dist: trusty
group: edge
addons:
apt:
packages:
Expand Down
12 changes: 8 additions & 4 deletions app/code/Magento/Authorization/Model/ResourceModel/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Authorization\Model\ResourceModel;

use Magento\Framework\App\ObjectManager;
Expand Down Expand Up @@ -101,7 +99,10 @@ public function saveRel(\Magento\Authorization\Model\Rules $rule)

// If all was selected save it only and nothing else.
if ($postedResources === [$this->_rootResource->getId()]) {
$insertData = $this->_prepareDataForTable(new \Magento\Framework\DataObject($row), $this->getMainTable());
$insertData = $this->_prepareDataForTable(
new \Magento\Framework\DataObject($row),
$this->getMainTable()
);

$connection->insert($this->getMainTable(), $insertData);
} else {
Expand All @@ -113,7 +114,10 @@ public function saveRel(\Magento\Authorization\Model\Rules $rule)
$row['permission'] = in_array($resourceId, $postedResources) ? 'allow' : 'deny';
$row['resource_id'] = $resourceId;

$insertData = $this->_prepareDataForTable(new \Magento\Framework\DataObject($row), $this->getMainTable());
$insertData = $this->_prepareDataForTable(
new \Magento\Framework\DataObject($row),
$this->getMainTable()
);
$connection->insert($this->getMainTable(), $insertData);
}
}
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Backend/App/AbstractAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* Generic backend controller
*
* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Backend/App/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Magento\Backend\App;

/**
* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
*/
abstract class Action extends \Magento\Backend\App\AbstractAction
Expand Down
12 changes: 11 additions & 1 deletion app/code/Magento/Backend/App/Action/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@
use Magento\Framework\Controller\ResultFactory;

/**
* Backend Controller context
* Constructor modification point for Magento\Backend\App\Action.
*
* All context classes were introduced to allow for backwards compatible constructor modifications
* of classes that were supposed to be extended by extension developers.
*
* Do not call methods of this class directly.
*
* As Magento moves from inheritance-based APIs all such classes will be deprecated together with
* the classes they were introduced for.
*
* @api
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Context extends \Magento\Framework\App\Action\Context
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/Backend/App/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\App;

use Magento\Config\App\Config\Type\System;
Expand Down
7 changes: 6 additions & 1 deletion app/code/Magento/Backend/Block/AbstractBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
namespace Magento\Backend\Block;

/**
* Backend abstract block
* Base for all admin blocks.
*
* Avoid using this class. Will be deprecated
*
* Marked as public API because it is actively used now.
* @api
*/
class AbstractBlock extends \Magento\Framework\View\Element\AbstractBlock
{
Expand Down
13 changes: 10 additions & 3 deletions app/code/Magento/Backend/Block/Context.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<?php
/**
* Backend block context
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Backend\Block;

/**
* Backend block context
* Constructor modification point for Magento\Backend\Block\AbstractBlock.
*
* All context classes were introduced to allow for backwards compatible constructor modifications
* of classes that were supposed to be extended by extension developers.
*
* Do not call methods of this class directly.
*
* As Magento moves from inheritance-based APIs all such classes will be deprecated together with
* the classes they were introduced for.
*
* @api
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Context extends \Magento\Framework\View\Element\Context
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/Backend/Block/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\Block;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\Block\Dashboard;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

/**
* Adminhtml dashboard tab abstract
*
Expand Down Expand Up @@ -40,7 +40,7 @@ public function __construct(
}

/**
* @return array|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection|\Magento\Eav\Model\Entity\Collection\Abstract
* @return array|AbstractCollection|\Magento\Eav\Model\Entity\Collection\Abstract
*/
public function getCollection()
{
Expand Down
12 changes: 7 additions & 5 deletions app/code/Magento/Backend/Block/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ protected function _renderMouseEvent($menuItem)
protected function _renderItemCssClass($menuItem, $level)
{
$isLast = 0 == $level && (bool)$this->getMenuModel()->isLast($menuItem) ? 'last' : '';
$output = ($this->menuItemChecker->isItemActive(
$isItemActive = $this->menuItemChecker->isItemActive(
$this->getActiveItemModel(),
$menuItem,
$level
) ? '_current _active' : '') .
$menuItem,
$level
) ? '_current _active' : '';

$output = $isItemActive .
' ' .
($menuItem->hasChildren() ? 'parent' : '') .
' ' .
Expand Down Expand Up @@ -411,7 +413,7 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
*/
public function getActiveItemModel()
{
if (is_null($this->_activeItemModel)) {
if ($this->_activeItemModel === null) {
$this->_activeItemModel = $this->getMenuModel()->get($this->getActive());
if (false == $this->_activeItemModel instanceof \Magento\Backend\Model\Menu\Item) {
$this->_activeItemModel = false;
Expand Down
7 changes: 4 additions & 3 deletions app/code/Magento/Backend/Block/Page/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\Block\Page;

/**
Expand Down Expand Up @@ -81,6 +79,9 @@ public function getLogoutLink()
*/
public function displayNoscriptNotice()
{
return $this->_scopeConfig->getValue('web/browser_capabilities/javascript', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
return $this->_scopeConfig->getValue(
'web/browser_capabilities/javascript',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
}
12 changes: 8 additions & 4 deletions app/code/Magento/Backend/Block/Page/Notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Adminhtml header notices block
*
Expand All @@ -25,7 +23,10 @@ class Notices extends \Magento\Backend\Block\Template
*/
public function displayNoscriptNotice()
{
return $this->_scopeConfig->getValue('web/browser_capabilities/javascript', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
return $this->_scopeConfig->getValue(
'web/browser_capabilities/javascript',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}

/**
Expand All @@ -35,6 +36,9 @@ public function displayNoscriptNotice()
*/
public function displayDemoNotice()
{
return $this->_scopeConfig->getValue('design/head/demonotice', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
return $this->_scopeConfig->getValue(
'design/head/demonotice',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\Block\Page\System\Config\Robots;

use Magento\Framework\App\Config\ScopeConfigInterface;
Expand Down Expand Up @@ -53,7 +51,8 @@ protected function _construct()
public function getRobotsDefaultCustomInstructions()
{
return trim((string)$this->_scopeConfig->getValue(
self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, ScopeConfigInterface::SCOPE_TYPE_DEFAULT
self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS,
ScopeConfigInterface::SCOPE_TYPE_DEFAULT
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\Block\Store\Switcher\Form\Renderer;

use \Magento\Framework\Data\Form\Element\Renderer\RendererInterface;

/**
* Form fieldset renderer
*/
class Fieldset extends \Magento\Backend\Block\Template implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
class Fieldset extends \Magento\Backend\Block\Template implements RendererInterface
{
/**
* Form element which re-rendering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\Block\System\Design\Edit\Tab;

class General extends \Magento\Backend\Block\Widget\Form\Generic
Expand Down Expand Up @@ -66,7 +64,7 @@ protected function _prepareForm()
]
);
$renderer = $this->getLayout()->createBlock(
\Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset\Element::class
\Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset\Element::class
);
$field->setRenderer($renderer);
} else {
Expand Down
15 changes: 14 additions & 1 deletion app/code/Magento/Backend/Block/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@
namespace Magento\Backend\Block;

/**
* Backend abstract block
* Standard admin block. Adds admin-specific behavior and event.
* Should be used when you declare a block in admin layout handle.
*
* Avoid extending this class if possible.
*
* If you need custom presentation logic in your blocks, use this class as block, and declare
* custom view models in block arguments in layout handle file.
*
* Example:
* <block name="my.block" class="Magento\Backend\Block\Template" template="My_Module::template.phtml" >
* <arguments>
* <argument name="viewModel" xsi:type="object">My\Module\ViewModel\Custom</argument>
* </arguments>
* </block>
*
* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
Expand Down
14 changes: 11 additions & 3 deletions app/code/Magento/Backend/Block/Template/Context.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<?php
/**
* Backend block template context
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Backend\Block\Template;

/**
* Constructor modification point for Magento\Backend\Block\Template.
*
* All context classes were introduced to allow for backwards compatible constructor modifications
* of classes that were supposed to be extended by extension developers.
*
* Do not call methods of this class directly.
*
* As Magento moves from inheritance-based APIs all such classes will be deprecated together with
* the classes they were introduced for.
*
* @api
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Context extends \Magento\Framework\View\Element\Template\Context
Expand Down
3 changes: 1 addition & 2 deletions app/code/Magento/Backend/Block/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
/**
* Base widget class
*
* @author Magento Core Team <[email protected]>
*
* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
*/
class Widget extends \Magento\Backend\Block\Template
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Block/Widget/Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Magento_Backend accordion widget
*
* @author Magento Core Team <[email protected]>
* @api
*/
class Accordion extends \Magento\Backend\Block\Widget
{
Expand Down
12 changes: 11 additions & 1 deletion app/code/Magento/Backend/Block/Widget/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Backend\Block\Widget;

/**
* Constructor modification point for Magento\Backend\Block\Widget.
*
* All context classes were introduced to allow for backwards compatible constructor modifications
* of classes that were supposed to be extended by extension developers.
*
* Do not call methods of this class directly.
*
* As Magento moves from inheritance-based APIs all such classes will be deprecated together with
* the classes they were introduced for.
*
* @api
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Context extends \Magento\Backend\Block\Template\Context
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Backend/Block/Widget/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Backend form widget
*
* @api
* @deprecated in favour of UI component implementation
* @SuppressWarnings(PHPMD.NumberOfChildren)
*/
class Form extends \Magento\Backend\Block\Widget
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Backend/Block/Widget/Form/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
/**
* Backend form container block
*
* @author Magento Core Team <[email protected]>
* @api
* @deprecated in favour of UI component implementation
* @SuppressWarnings(PHPMD.NumberOfChildren)
*/
class Container extends \Magento\Backend\Block\Widget\Container
Expand Down
Loading

0 comments on commit 4eb8398

Please sign in to comment.