-
Notifications
You must be signed in to change notification settings - Fork 8
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
Sniff to limit the use of new in constructor #153
Sniff to limit the use of new in constructor #153
Conversation
Codecov Report
@@ Coverage Diff @@
## master #153 +/- ##
============================================
+ Coverage 97.41% 97.61% +0.20%
- Complexity 136 149 +13
============================================
Files 16 17 +1
Lines 348 378 +30
============================================
+ Hits 339 369 +30
Misses 9 9
Continue to review full report at Codecov.
|
I think more tests are required. Check there is no warning in this case: <?php
$app = new Application();
$app->run(); Does it work with regular functions? <?php
function newClass(): Class
{
return new Class();
} What about anonymous classes? Maybe we should ignore them. |
Since PHP 8.1 |
Thanks @villfa , I add some tests and case Not simple to implement ^^ Can you review me please ? Thanks |
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.
Thank you :) |
see #25
Thanks in adavnce for reviewing :)
Im not sure for typo use NewInstanceSniff is good ? else i think NewKeywordInstanceSniff ?