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
PSR12 and Object Calisthenics #1161
PSR12 and Object Calisthenics #1161
Conversation
PSR12 - Blank lines may be added to improve readability and to indicate related blocks of code Object Calisthenics - Don’t use “Else” keyword empty - Determines whether the variable is empty or null.
Codecov Report
@@ Coverage Diff @@
## master #1161 +/- ##
=========================================
Coverage 46.06% 46.06%
Complexity 9968 9968
=========================================
Files 505 505
Lines 24475 24475
=========================================
Hits 11274 11274
Misses 13201 13201
Continue to review full report at Codecov.
|
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.
There is a difference between strict type comparison using === and calling the empty() function - using empty() is more "forgiving" and would equate $error being an empty string. and other such equivalent values to null.
Given that the BuildEvent exception property is going to be either null or an exception, there is no need for using empty(), and the extra function call makes means the code is less efficient.
For that reason, would you revert those portions of your changes, please?
Great job otherwise :-)
Revert empty function for strict type comparison
Ok, I understand your point. The comparison is more performative. |
* Added logger test. * Related to #1161
@viniciuseneas thanks for your contribution |
PSR12 - Blank lines may be added to improve readability and to indicate related blocks of code
Object Calisthenics - Don’t use “Else” keyword
empty - Determines whether the variable is empty or null.