Skip to content

Commit

Permalink
[PSR-2 Compliance] The Great @codingStandardsIgnoreFile Massacre
Browse files Browse the repository at this point in the history
- apply manual fixes to make PHPCS happy, mainly "Line exceeds maximum limit of 120 characters" violations
  • Loading branch information
orlangur committed Apr 23, 2017
1 parent d813974 commit 40ba673
Show file tree
Hide file tree
Showing 249 changed files with 1,621 additions and 746 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ public function __construct(
*/
public function render(\Magento\Framework\DataObject $row)
{
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' . __(
'Read Details'
) . '</a>' : '';
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">'
. __('Read Details') . '</a>' : '';

$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
'*/*/markAsRead/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\Grid;

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

class Collection extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
{
/**
* Add remove filter
*
* @return \Magento\AdminNotification\Model\ResourceModel\Grid\Collection|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
* @return \Magento\AdminNotification\Model\ResourceModel\Grid\Collection|AbstractCollection
*/
protected function _initSelect()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
ValidatorInterface::ERROR_INVALID_TIER_PRICE_TYPE => 'Value for \'tier_price_value_type\' ' .
'attribute contains incorrect value, acceptable values are Fixed, Discount',
ValidatorInterface::ERROR_TIER_DATA_INCOMPLETE => 'Tier Price data is incomplete',
ValidatorInterface::ERROR_INVALID_ATTRIBUTE_DECIMAL => 'Value for \'%s\' attribute contains incorrect value, acceptable values are in decimal format',
ValidatorInterface::ERROR_INVALID_ATTRIBUTE_DECIMAL
=> 'Value for \'%s\' attribute contains incorrect value, acceptable values are in decimal format',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function isValid($value)
*/
public function getAllWebsitesValue()
{
return AdvancedPricing::VALUE_ALL_WEBSITES . ' [' . $this->websiteModel->getBaseCurrency()->getCurrencyCode() . ']';
return AdvancedPricing::VALUE_ALL_WEBSITES
. ' [' . $this->websiteModel->getBaseCurrency()->getCurrencyCode() . ']';
}
}
10 changes: 8 additions & 2 deletions app/code/Magento/Authorization/Model/ResourceModel/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,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 @@ -111,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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

namespace Magento\Backend\Block\Dashboard;

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

/**
* Adminhtml dashboard tab abstract
*
Expand Down Expand Up @@ -38,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
4 changes: 3 additions & 1 deletion app/code/Magento/Backend/Block/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ protected function _getAnchorLabel($menuItem)
*/
protected function _renderMouseEvent($menuItem)
{
return $menuItem->hasChildren() ? 'onmouseover="Element.addClassName(this,\'over\')" onmouseout="Element.removeClassName(this,\'over\')"' : '';
return $menuItem->hasChildren()
? 'onmouseover="Element.addClassName(this,\'over\')" onmouseout="Element.removeClassName(this,\'over\')"'
: '';
}

/**
Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/Backend/Block/Page/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

namespace Magento\Backend\Block\Page;

use Magento\Store\Model\ScopeInterface;

/**
* Adminhtml header block
*
Expand Down Expand Up @@ -78,6 +80,6 @@ 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', ScopeInterface::SCOPE_STORE);
}
}
6 changes: 4 additions & 2 deletions app/code/Magento/Backend/Block/Page/Notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
*/
namespace Magento\Backend\Block\Page;

use Magento\Store\Model\ScopeInterface;

class Notices extends \Magento\Backend\Block\Template
{
/**
Expand All @@ -20,7 +22,7 @@ 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', ScopeInterface::SCOPE_STORE);
}

/**
Expand All @@ -30,6 +32,6 @@ 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', ScopeInterface::SCOPE_STORE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@

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 @@ -7,13 +7,14 @@
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 <[email protected]>
*/
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 @@ -7,13 +7,14 @@
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
*
* @author Magento Core Team <[email protected]>
*/
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 @@ -7,13 +7,14 @@
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 <[email protected]>
*/
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 @@ -153,7 +153,11 @@ 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
6 changes: 4 additions & 2 deletions app/code/Magento/Backend/Block/Widget/Grid/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,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
7 changes: 5 additions & 2 deletions app/code/Magento/Backend/Model/Menu/Director/Director.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,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
6 changes: 4 additions & 2 deletions app/code/Magento/Backend/Model/Widget/Grid/AbstractTotals.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,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
4 changes: 3 additions & 1 deletion app/code/Magento/Backup/Model/ResourceModel/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ public function getHeader()
$dbConfig = $this->getConnection()->getConfig();

$versionRow = $this->getConnection()->fetchRow('SHOW VARIABLES LIKE \'version\'');
$hostName = !empty($dbConfig['unix_socket']) ? $dbConfig['unix_socket'] : (!empty($dbConfig['host']) ? $dbConfig['host'] : 'localhost');
$hostName = !empty($dbConfig['unix_socket'])
? $dbConfig['unix_socket']
: (!empty($dbConfig['host']) ? $dbConfig['host'] : 'localhost');

$header = "-- Magento DB backup\n" .
"--\n" .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public function getConfig()
'isAllowShippingAddressOverride' => $this->config->isAllowToEditShippingAddress(),
'merchantName' => $this->config->getMerchantName(),
'locale' => strtolower($this->resolver->getLocale()),
'paymentAcceptanceMarkSrc' => 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
'paymentAcceptanceMarkSrc'
=> 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
'vaultCode' => self::PAYPAL_VAULT_CODE,
'skipOrderReview' => $this->config->isSkipOrderReview(),
'paymentIcon' => $this->config->getPayPalIcon(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public function getConfigDataProvider()
'isAllowShippingAddressOverride' => true,
'merchantName' => 'Test',
'locale' => 'en_us',
'paymentAcceptanceMarkSrc' => 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
'paymentAcceptanceMarkSrc'
=> 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
'vaultCode' => ConfigProvider::PAYPAL_VAULT_CODE,
'skipOrderReview' => false,
'paymentIcon' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ public function getProduct()
public function getSelectionQtyTitlePrice($selection, $includeContainer = true)
{
$this->setFormatProduct($selection);
$priceTitle = '<span class="product-name">' . $selection->getSelectionQty() * 1 . ' x ' . $this->escapeHtml($selection->getName()) . '</span>';
$priceTitle = '<span class="product-name">'
. $selection->getSelectionQty() * 1 . ' x ' . $this->escapeHtml($selection->getName())
. '</span>';

$priceTitle .= ' &nbsp; ' . ($includeContainer ? '<span class="price-notice">' : '') . '+' .
$this->renderPriceString($selection, $includeContainer) . ($includeContainer ? '</span>' : '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ protected function setUp()
->disableOriginalConstructor()
->getMock();
$this->model = $helper->getObject(

LinkManagement::class,
[
'productRepository' => $this->productRepository,
Expand Down Expand Up @@ -654,7 +653,7 @@ public function testSaveChild()
$productLink->expects($this->any())->method('getQty')->will($this->returnValue($qty));
$productLink->expects($this->any())->method('getPriceType')->will($this->returnValue($priceType));
$productLink->expects($this->any())->method('getPrice')->will($this->returnValue($price));
$productLink->expects($this->any())->method('getCanChangeQuantity')->will($this->returnValue($canChangeQuantity));
$productLink->expects($this->any())->method('getCanChangeQuantity')->willReturn($canChangeQuantity);
$productLink->expects($this->any())->method('getIsDefault')->will($this->returnValue($isDefault));

$this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ public function modifyMeta(array $meta)
'autoRender' => false,
'componentType' => 'insertListing',
'dataScope' => 'bundle_product_listing',
'externalProvider' => 'bundle_product_listing.bundle_product_listing_data_source',
'selectionsProvider' => 'bundle_product_listing.bundle_product_listing.product_columns.ids',
'externalProvider' =>
'bundle_product_listing.bundle_product_listing_data_source',
'selectionsProvider' =>
'bundle_product_listing.bundle_product_listing.product_columns.ids',
'ns' => 'bundle_product_listing',
'render_url' => $this->urlBuilder->getUrl('mui/index/render'),
'realTimeLink' => false,
Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
*/
namespace Magento\Captcha\Model\Config\Form;

abstract class AbstractForm extends \Magento\Framework\App\Config\Value implements \Magento\Framework\Option\ArrayInterface
use Magento\Framework\Option\ArrayInterface;

abstract class AbstractForm extends \Magento\Framework\App\Config\Value implements ArrayInterface
{
/**
* @var string
Expand Down
14 changes: 7 additions & 7 deletions app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function getStoreSwitcherHtml()
public function getLoadTreeUrl($expanded = null)
{
$params = ['_current' => true, 'id' => null, 'store' => null];
if ($expanded === null&& $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
if ($expanded === null && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
$params['expand_all'] = true;
}
return $this->getUrl('*/*/categoriesJson', $params);
Expand Down Expand Up @@ -310,12 +310,12 @@ public function getBreadcrumbsJavascript($path, $javascriptVarName)
foreach ($categories as $key => $category) {
$categories[$key] = $this->_getNodeJson($category);
}
return '<script>require(["prototype"], function(){' . $javascriptVarName . ' = ' . $this->_jsonEncoder->encode(
$categories
) .
';' .
($this->canAddSubCategory() ? '$("add_subcategory_button").show();' : '$("add_subcategory_button").hide();') .
'});</script>';
return '<script>require(["prototype"], function(){' . $javascriptVarName . ' = '
. $this->_jsonEncoder->encode($categories) . ';'
. ($this->canAddSubCategory()
? '$("add_subcategory_button").show();'
: '$("add_subcategory_button").hide();')
. '});</script>';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ protected function _getAdditionalElementHtml($element)
$checkboxLabel = __('Change');
$html = <<<HTML
<span class="attribute-change-checkbox">
<input type="checkbox" id="$dataCheckboxName" name="$dataCheckboxName" class="checkbox" $nameAttributeHtml onclick="toogleFieldEditMode(this, '{$elementId}')" $dataAttribute />
<input type="checkbox" id="$dataCheckboxName" name="$dataCheckboxName" class="checkbox" $nameAttributeHtml
onclick="toogleFieldEditMode(this, '{$elementId}')" $dataAttribute />
<label class="label" for="$dataCheckboxName">
{$checkboxLabel}
</label>
Expand Down
Loading

0 comments on commit 40ba673

Please sign in to comment.