-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Check if realpath() returns false #7822
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
Conversation
| protected function findMigrations() { | ||
| $directory = realpath($this->migrationsPath); | ||
| if (!file_exists($directory) || !is_dir($directory)) { | ||
| if ($directory === false || !file_exists($directory) || !is_dir($directory)) { |
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'm unsure if we should drop then the file_exists() call or if we want to have this sanity check still available.
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.
Just leave it. Doesn't hurt to check.
realpath() returns false in case the directory does not exist. Found it while preparing strict_typing for PHP7+. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
ee3469e to
1efde41
Compare
Codecov Report
@@ Coverage Diff @@
## master #7822 +/- ##
=============================================
- Coverage 51.23% 34.75% -16.48%
+ Complexity 24973 24972 -1
=============================================
Files 1607 1607
Lines 95008 95008
Branches 1376 1376
=============================================
- Hits 48674 33019 -15655
- Misses 46334 61989 +15655
|
realpath() returns false in case the directory does not exist. Found it while preparing strict_typing for PHP7+. (#7392)