Skip to content
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 RuntimeException with SplFileInfo->isFile() #231

Open
wants to merge 3 commits into
base: master
from

Conversation

@snelg
Copy link

@snelg snelg commented Nov 9, 2017

Context

With stream_wrapper handling enabled, SplFileInfo->isFile() triggers a RuntimeException for non-existing files.

What has been done

  • Simply added a try/catch around the line triggering the exception, $result = @stat($path);

How to test

  • VCR::turnOn()
  • $path = new \SplFileInfo('missingFile');
  • $path->isFile()
@snelg snelg mentioned this pull request Nov 9, 2017
@snelg
Copy link
Author

@snelg snelg commented Nov 9, 2017

Just noticed #137. I'm not sure if this undoes part of what that PR was trying to fix. This one is catching RuntimeException instead of ErrorException which was removed in the previous PR, so at least it's different in that regard. And the test I added for this PR fails without the try/catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.