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

per PSR2 recommendation, ElseIf should be used instead of else-if #23101

Closed

Conversation

sankalpshekhar
Copy link
Contributor

Description (*)

This per updates usage of ELSE-IF to ElseIf, per PSR2 recommendation.

Fixed Issues (if relevant)

  1. magento/magento2#<issue_number>: Issue title

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jun 3, 2019

Hi @sankalpshekhar. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@dmytro-ch
Copy link
Contributor

Hi @sankalpshekhar,
thank you for your contribution!
Could you please check and resolve the static test failures?

@orlangur
Copy link
Contributor

orlangur commented Jun 3, 2019

Thanks @sankalpshekhar, we don't need a manual PR for such change though as all such occurrences will be fixed automatically.

@orlangur orlangur closed this Jun 3, 2019
@m2-assistant
Copy link

m2-assistant bot commented Jun 3, 2019

Hi @sankalpshekhar, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@sankalpshekhar sankalpshekhar deleted the psr2-elseif-else-if branch June 3, 2019 11:55
@sankalpshekhar
Copy link
Contributor Author

@orlangur Could you help on the steps laid out for this to be fixed automatically?

From what I see the last commit on these files, the oldest being almost a year old and they haven't been fixed yet.

@sankalpshekhar sankalpshekhar restored the psr2-elseif-else-if branch June 3, 2019 15:11
@orlangur
Copy link
Contributor

orlangur commented Jun 3, 2019

@sankalpshekhar phpcbf will be applied all over the code base. Coding standard is being finalized currently.

@sankalpshekhar
Copy link
Contributor Author

@orlangur I see that the standards are still being finalized, including versioning. Do we have a release date on when this would be applied to the framework?

@orlangur
Copy link
Contributor

orlangur commented Jun 4, 2019

@sankalpshekhar I believe we can do it during June and target 2.3.3 release, here is a corresponding issue: #8612 (comment)

@hostep
Copy link
Contributor

hostep commented Jun 4, 2019

@orlangur: can we attempt to put this code standard changes in as few commits as possible, even maybe dedicate a separate release for this? I don't want to go figuring out again what actually changed in the code besides the code standards changes. Having a dedicated release number for only code standards applying would make it more clear and will help a lot with upgrading shops to a newer version where we can then easily see the more "significant" changes in the codebase (and ignore the code standard changes).

@orlangur
Copy link
Contributor

orlangur commented Jun 4, 2019

@hostep thanks, will keep this in mind. I remember such approach used only once for copyright year update, probably makes sense if we will update PHPDocs massively.

UPD:

With every update of Magento, I go through all changed files manually to see what has changed in between them. Especially the frontend files (phtml, html, js, xml, ...) as they tend to not be backwards compatible

Wow, this is really awkward use case, people usually rely on automation these days. I don't think it justifies a separate release, ignoring minimalistic amount of CS-related commit should be sufficient (and this is much better than hundreds of manual fixes in different commits being contributed currently).

@hostep
Copy link
Contributor

hostep commented Jun 4, 2019

people usually rely on automation these days

If you know of such an automation tool, feel free to share. The best one we found this far is just detecting changes, but not applying those changes automatically, this is https://github.com/AmpersandHQ/ampersand-magento2-upgrade-patch-helper

Sorry for going completely off topic here :)

@orlangur
Copy link
Contributor

orlangur commented Jun 4, 2019

@hostep no-no, I meant it's quite strange to look into diffs, just write enough automated tests and run them whenever you upgrade :)

@hostep
Copy link
Contributor

hostep commented Jun 4, 2019

Magento tends to fix security related issues in phtml files by introducing escape functions for example. I'm not sure if tests can catch these changes in overwritten phtml files in a custom theme? Since the output will be exactly the same if no weird data was passed. While your custom theme then might contain vulnerable code which was fixed in core Magento.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants