-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Fix bug with handling bad symlinks #1938
Fix bug with handling bad symlinks #1938
Conversation
Not empty string
@inderpreet99 CI restarted, your change seems make PHPStan notice:
The |
I thought Symfony's SplFileInfo is inherited from \SplFileInfo, so it should behave the same. Anyhow I like your suggestion in this case @samsonasik, so I'll accept the change to cast it. |
It seems phpstan show another notice:
Could you provide a failing fixture or sample repository for it that demo-ing your use case? Thank you. |
Please add |
Thank you @inderpreet99 |
When the path being operated upon has a file with a bad symlink on Mac OSX (somewhere in the hierarchy), rector will throw up the below cryptic error. This is due to the FilesFinder code expecting empty string from
SplFileInfo->getRealPath()
for bad symlinks/files. That function however actually only outputsfalse
or the real string path.Ref: https://www.php.net/manual/en/splfileinfo.getrealpath.php