Skip to content

Assign with and, or, replaced by &&, || #20628

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

Conversation

lfluvisotto
Copy link
Contributor

@lfluvisotto lfluvisotto commented Jan 25, 2019

Description (*)

It is recommended to use the &&, || operators, instead of and, or to prevent confusion.

I kept the integrity of the source code on the occurrences with xor that returns boolean , if we use ^ instead of xor it'll return integer.

Fixed Issues (if relevant)

N/A

@magento-engcom-team
Copy link
Contributor

Hi @lfluvisotto. 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-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

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

Copy link
Contributor

@novikor novikor left a comment

Choose a reason for hiding this comment

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

Review results: fine.
@swnsma , please approve

@swnsma
Copy link
Contributor

swnsma commented Jan 26, 2019

Hi @lfluvisotto
Thank you for your contribution!
I see at least 20 additional places of using or/add/xor instead of ||/&&/^^.
image
Can I ask you to check them too?

@lfluvisotto lfluvisotto changed the title Assign with or Assign with and, or, xor, replaced by &&, ||, ^ Jan 27, 2019
@lfluvisotto lfluvisotto changed the title Assign with and, or, xor, replaced by &&, ||, ^ Assign with and, or, replaced by &&, || Jan 27, 2019
@lfluvisotto lfluvisotto force-pushed the 2.3-develop-assign-with-or branch from f9ae2a9 to ef1d040 Compare January 27, 2019 23:25
@lfluvisotto lfluvisotto force-pushed the 2.3-develop-assign-with-or branch from bb8606d to e78576e Compare January 27, 2019 23:46
@lfluvisotto
Copy link
Contributor Author

lfluvisotto commented Jan 28, 2019

@swnsma

I decided to keep the integrity of the source code on the occurrences with xor (Logical Operator) that returns boolean, if we use ^ (Bitwise Operator) instead of xor it'll return integer .

I used the regular expression only (and|or) , except on comments and string literals.

The results I got were different of your screenshot, because your results are included string literals.

@okorshenko okorshenko removed this from the Release: 2.3.1 milestone Jan 28, 2019
@magento-engcom-team magento-engcom-team merged commit 6c2d7d9 into magento:2.3-develop Feb 1, 2019
@ghost
Copy link

ghost commented Feb 1, 2019

Hi @lfluvisotto, 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.

@orlangur
Copy link
Contributor

orlangur commented Feb 5, 2019

@sivaschenko @swnsma @novikor guys, please do not merge such changes without a corresponding static test.

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.

8 participants