Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
define('analyticsPopupConfig', function () {
return {
analyticsVisible: <?= $block->getNotification()->isAnalyticsVisible() ? 1 : 0; ?>,
releaseVisible: <?= $block->getNotification()->isReleaseVisible() ? 1 : 0; ?>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not needed if it works with trailing comma.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @orlangur here, keeping comma's in javascript objects or php arrays is a good thing, it gives a clearer diff in git when one or multiple lines are added if a comma already existed on the line above the new line.

For javascript, historically this was an issue in older Internet Explorer versions, they couldn't handle that, but according to this comment it was fixed in IE9 and higher and Magento only supports IE11, so we should be fine.

PHP is more and more encouraging this kind of syntax btw, PHP 7.3 got a new feature where arguments in function/method calls can now also have a trailing comma: https://www.php.net/manual/en/migration73.new-features.php#migration73.new-features.core.trailing-commas

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orlangur, comma added after array,
Thanks for suggestion.

releaseVisible: <?= $block->getNotification()->isReleaseVisible() ? 1 : 0; ?>
}
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function render(DataObject $row)
$result .= $this->getColumn()->getEditOnly() ? ''
: '<span class="admin__grid-control-value">' . $this->_getValue($row) . '</span>';

return $result . $this->_getInputValueElement($row) . '</div>' ;
return $result . $this->_getInputValueElement($row) . '</div>';
}
return $this->_getValue($row);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private function addVisibilityFilter(SearchCriteriaInterface $searchCriteria, bo
{
if ($isFilter && $isSearch) {
// Index already contains products filtered by visibility: catalog, search, both
return ;
return;
}
$visibilityIds = $isSearch
? $this->visibility->getVisibleInSearchIds()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SchemaLocator implements SchemaLocatorInterface
*
* @var string
*/
private $schema ;
private $schema;

/**
* @param Reader $moduleReader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ protected function setUp()

public function testGetOrder()
{
$this->assertSame($this->orderMock, $this->model->getOrder()) ;
$this->assertSame($this->orderMock, $this->model->getOrder());
}

public function testGetPayment()
{
$this->assertSame($this->paymentMock, $this->model->getPayment()) ;
$this->assertSame($this->paymentMock, $this->model->getPayment());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class UpdateQuoteItemsTest extends \PHPUnit\Framework\TestCase
/**
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Quote\Model\ResourceModel\Quote
*/
private $quoteResource ;
private $quoteResource;

protected function setUp()
{
Expand Down Expand Up @@ -58,7 +58,7 @@ public function aroundUpdateDataProvider()
[10, 20, 'once'],
[null, 10, 'never'],
[10, 10, 'never'],
[10, 10, 'once', true],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is definitely not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added comma after array

[10, 10, 'once', true]
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected function _addStoresFieldset($model, $form)
'fieldset_html_class' => 'store'
]
);
return ;
return;
}

$renderer = $this->getLayout()->createBlock(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@
var last;

// Skip empty text nodes form the end
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling);

if (last && last.nodeName == 'TABLE')
ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
Expand Down