-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Compare class-names case insensitive #42
Conversation
Thanks! 😊 Could you add simple test so we don't remove it in the future? |
here we go :) |
@TomasVotruba should be good to go |
use TomasVotruba\ClassLeak\Tests\AbstractTestCase; | ||
use TomasVotruba\ClassLeak\ValueObject\FileWithClass; | ||
|
||
final class PossiblyUnusedClassesFilterTest extends AbstractTestCase |
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'd prefer to include this test as a single test fixture in the rule itselft, instead of adding a new unit test.
It would be easier to read for me later.
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.
the class is used at the top level CheckCommand
which means I would need to test at the command level.. with all its dependencies?
are you sure we want that ? :)
class-leak/src/Commands/CheckCommand.php
Lines 113 to 119 in 2fc838e
$possiblyUnusedFilesWithClasses = $this->possiblyUnusedClassesFilter->filter( | |
$existingFilesWithClasses, | |
$usedNames, | |
$typesToSkip, | |
$suffixesToSkip, | |
$attributesToSkip | |
); |
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 see. What I really want is the test to be simpler, as reading is quite complex now :)
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.
On other hand, we should not encourage using wrong class casing. This should be spotted and trigger the class name fix instead.
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.
phpstan itself does already error about class-name-case-mismatches. I think its not the job of class-leak to report it as a problem
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.
Exactly, this tool builds on top of PHPStan best quality code. Let PHPStan handle these 👍
Closing as outsourcing responsibility to PHPStan 👍 |
No description provided.