Add SplFileInfo support to Image validator#798
Conversation
There was a problem hiding this comment.
Pull request overview
Adds broader file input compatibility for the Image rule handler by accepting SplFileInfo instances and improving robustness when extracting paths from uploaded files.
Changes:
- Extend
ImageHandlerto resolve image paths fromSplFileInfoand to safely handleUploadedFileInterface::getStream()failures. - Add test coverage for validating
SplFileInfoinputs and an uploaded-file edge case with an invalid/missing temp path. - Document the enhancement in the changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/Rule/Image/ImageHandler.php |
Accept SplFileInfo values and guard against RuntimeException when reading uploaded file stream metadata. |
tests/Rule/Image/ImageTest.php |
Add passing/failing cases for SplFileInfo and a failing case for a missing uploaded temp path. |
CHANGELOG.md |
Add an enhancement entry for SplFileInfo support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.