Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed coding standard violations in the Magento\Backend namespace #9974

Merged
merged 2 commits into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\Block\Widget\Form\Renderer;

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

/**
* Form element default renderer
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Element extends \Magento\Backend\Block\Template implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
class Element extends \Magento\Backend\Block\Template implements RendererInterface
{
/**
* @var AbstractElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\Block\Widget\Form\Renderer;

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

/**
* Form fieldset default renderer
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
*/
class Fieldset extends \Magento\Backend\Block\Template implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
class Fieldset extends \Magento\Backend\Block\Template implements RendererInterface
{
/**
* @var AbstractElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Backend\Block\Widget\Form\Renderer\Fieldset;

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

/**
* Fieldset element renderer
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Element extends \Magento\Backend\Block\Template implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
class Element extends \Magento\Backend\Block\Template implements RendererInterface
{
/**
* @var AbstractElement
Expand Down
4 changes: 1 addition & 3 deletions app/code/Magento/Backend/Block/Widget/Grid.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\Widget;

/**
Expand Down Expand Up @@ -351,7 +349,7 @@ protected function _prepareCollection()
$dir = $this->getParam($this->getVarNameDir(), $this->_defaultDir);
$filter = $this->getParam($this->getVarNameFilter(), null);

if (is_null($filter)) {
if ($filter === null) {
$filter = $this->_defaultFilter;
}

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\Widget\Grid\Column\Filter;

/**
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\Widget\Grid\Column\Renderer;

/**
Expand Down Expand Up @@ -155,7 +153,8 @@ protected function _transformActionData(&$action, &$actionCaption, \Magento\Fram
break;

case 'popup':
$action['onclick'] = 'popWin(this.href,\'_blank\',\'width=800,height=700,resizable=1,scrollbars=1\');return false;';
$action['onclick'] = 'popWin(this.href,\'_blank\',\'width=800,height=700,resizable=1,'
. 'scrollbars=1\');return false;';
break;
}
}
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\Widget\Grid\Column\Renderer;

/**
Expand Down
10 changes: 5 additions & 5 deletions app/code/Magento/Backend/Block/Widget/Grid/Export.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\Widget\Grid;

use Magento\Framework\App\Filesystem\DirectoryList;
Expand Down Expand Up @@ -263,7 +261,7 @@ public function _exportIterateCollection($callback, array $args)
$originalCollection->setPageSize($this->getExportPageSize());
$originalCollection->setCurPage($page);
$originalCollection->load();
if (is_null($count)) {
if ($count === null) {
$count = $originalCollection->getSize();
$lPage = $originalCollection->getLastPageNumber();
}
Expand All @@ -286,8 +284,10 @@ public function _exportIterateCollection($callback, array $args)
* @param \Magento\Framework\Filesystem\File\WriteInterface $stream
* @return void
*/
protected function _exportCsvItem(\Magento\Framework\DataObject $item, \Magento\Framework\Filesystem\File\WriteInterface $stream)
{
protected function _exportCsvItem(
\Magento\Framework\DataObject $item,
\Magento\Framework\Filesystem\File\WriteInterface $stream
) {
$row = [];
foreach ($this->_getColumns() as $column) {
if (!$column->getIsSystem()) {
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\Controller\Adminhtml\System;

use Magento\Backend\App\Action;
Expand Down Expand Up @@ -129,7 +127,9 @@ protected function _addDeletionNotice($typeTitle)
{
$this->messageManager->addNotice(
__(
'Deleting a %1 will not delete the information associated with the %1 (e.g. categories, products, etc.), but the %1 will not be able to be restored. It is suggested that you create a database backup before deleting the %1.',
'Deleting a %1 will not delete the information associated with the %1 (e.g. categories, products, etc.)'
. ', but the %1 will not be able to be restored. It is suggested that you create a database backup '
. 'before deleting the %1.',
$typeTitle
)
);
Expand Down
9 changes: 5 additions & 4 deletions app/code/Magento/Backend/Model/Menu/Director/Director.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\Model\Menu\Director;

class Director extends \Magento\Backend\Model\Menu\AbstractDirector
Expand Down Expand Up @@ -43,8 +41,11 @@ protected function _getCommand($data, $logger)
* @param \Psr\Log\LoggerInterface $logger
* @return void
*/
public function direct(array $config, \Magento\Backend\Model\Menu\Builder $builder, \Psr\Log\LoggerInterface $logger)
{
public function direct(
array $config,
\Magento\Backend\Model\Menu\Builder $builder,
\Psr\Log\LoggerInterface $logger
) {
foreach ($config as $data) {
$builder->processCommand($this->_getCommand($data, $logger));
}
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Backend/Model/Widget/Grid/AbstractTotals.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\Model\Widget\Grid;

abstract class AbstractTotals implements \Magento\Backend\Model\Widget\Grid\TotalsInterface
Expand Down Expand Up @@ -46,8 +44,10 @@ abstract class AbstractTotals implements \Magento\Backend\Model\Widget\Grid\Tota
* @param \Magento\Framework\DataObject\Factory $factory
* @param \Magento\Backend\Model\Widget\Grid\Parser $parser
*/
public function __construct(\Magento\Framework\DataObject\Factory $factory, \Magento\Backend\Model\Widget\Grid\Parser $parser)
{
public function __construct(
\Magento\Framework\DataObject\Factory $factory,
\Magento\Backend\Model\Widget\Grid\Parser $parser
) {
$this->_factory = $factory;
$this->_parser = $parser;
}
Expand Down
Loading