-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Missed method findRealpathInIncludePath() in Zend\Code\Reflection\FileReflection #4618
Conversation
So, to be clear, you feel that an error should be raised earlier if the file does not exist? |
Yes |
- method was not properly detecting when a file does not exist, in part due to using no longer implemented methods of FileReflection.
Just for the record this patch use the same logic present in Zend\Code\Reflection\FileReflection constructor |
$realpath = stream_resolve_include_path($filePath); | ||
} | ||
|
||
if (!$realpath || !in_array($realPath, get_included_files())) { |
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.
There is a typo in the second var $realpath !== $realPath. I'll fix this while merging.
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.
Finally the check for included files can't be done here since $includeIfNotAlreadyIncluded
parameter becomes unusable. I'm looking how to throubleshoot this situation.
Please review Maks3w@41310ce Really the |
@Maks3w Makes sense -- I'll update shortly to include your commit. |
Actually, @Maks3w -- are you merging now? Don't want to mess things up for you... |
I reviewed Maks3w's 41310ce commit and ran into some broken tests -- he's fixing them now. |
done |
- method was not properly detecting when a file does not exist, in part due to using no longer implemented methods of FileReflection.
…ause $includeIfNotAlreadyIncluded lost his functionality
Fatal error: Call to undefined method Zend\Code\Reflection\FileReflection::findRealpathInIncludePath() in /home/home/www/vendor/library/Zend/Code/Generator/FileGenerator.php on line 78
This occurs when data is non-existent file
$generator = new \Zend\Code\Generator\FileGenerator();
$file = $generator->fromReflectedFileName('/home/user/www/not_exists.php');