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

Avoid use of \SplFileInfo(). #146

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Avoid use of \SplFileInfo(). #146

merged 2 commits into from
Oct 7, 2024

Conversation

adam-vessey
Copy link
Contributor

@adam-vessey adam-vessey commented Oct 7, 2024

It can cause arbitrary warnings emitted in underlying stream wrappers to be unexpectedly detected and promoted to runtime exceptions. Warnings are warnings and not fatal errors, after all, especially when they are emitted behind the error-suppression operator.

In particular, having a new \SplFileInfo('foxml://object/{some:pid}');, and the underlying resolution inside the foxml:// stream wrapper testing for the existence of various directories, the testing for those directories might in turn perform existence checks for various directories, which in turn cause warnings about being unable to stat() those directories that do not exist to be emitted; thereby entirely breaking the testing.

It can cause arbitrary warnings emitted in underlying stream wrappers
to be detected and promoted to runtime exceptions, which is rather
unexpected. Warnings are warnings and not fatal errors, after all.
@adam-vessey adam-vessey added the patch Backwards compatible bug fixes. label Oct 7, 2024
Forgot to use the accessor, derp.
@adam-vessey adam-vessey marked this pull request as ready for review October 7, 2024 14:18
@jordandukart jordandukart merged commit a75b679 into main Oct 7, 2024
1 check passed
@jordandukart jordandukart deleted the fix/avoid-spl-file-info branch October 7, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Backwards compatible bug fixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants