-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Always skip hidden files #6567
Always skip hidden files #6567
Conversation
Hi, I just added my other email and accepted the license agreement - again... |
@@ -87,6 +87,10 @@ public function getList($path) | |||
*/ | |||
private function isExclude(\SplFileInfo $fileItem, $patterns) | |||
{ | |||
if($fileItem->getBasename()[0] == '.') { |
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.
If you add this check here, it will be invoked for every pattern, while it need to be invoked just once per file. The better place for this piece will be here as a third skipped case
if ($fileItem->isDir() || $fileItem->getExtension() !== 'php') {
continue;
}
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.
Thanks for reviewing. I've updated the patch per your request.
@quickshiftin Merged! Thank you for your support. |
Thank you guys! |
On Linux with Emacs or VI, hidden files can be generated by the editor, which are then picked up by the ClassScanner, so periodically I run into errors like this when running
bin/magento di:compile
You may prefer to implement it as another
excludePattern
, however I think it's worth adding in some fashion.