-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Remove extra space before semicolon and remove extra comma in php, phtml and js files #26342
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
Remove extra space before semicolon and remove extra comma in php, phtml and js files #26342
Conversation
|
Hi @tejash-wagento. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
|
Hi @dmytro-ch, thank you for the review.
|
| [10, 20, 'once'], | ||
| [null, 10, 'never'], | ||
| [10, 10, 'never'], | ||
| [10, 10, 'once', true], |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added comma after array
| define('analyticsPopupConfig', function () { | ||
| return { | ||
| analyticsVisible: <?= $block->getNotification()->isAnalyticsVisible() ? 1 : 0; ?>, | ||
| releaseVisible: <?= $block->getNotification()->isReleaseVisible() ? 1 : 0; ?>, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
dmytro-ch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tejash-wagento, could you please also check and fix the static test failures?
|
@dmytro-ch, issue fixed |
…o remove-extra-space-semicolon
|
Hi @dmytro-ch, thank you for the review. |
|
Notice: QA not applicable |
…ma in php, phtml and js files #26342
|
Hi @tejash-wagento, thank you for your contribution! |
Description
Remove extra space before semicolon and remove extra comma in php, phtml and js files
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)