Skip to content

Add SplFileInfo support to Image validator#798

Merged
vjik merged 4 commits intomasterfrom
feature/591-image-validator
Apr 24, 2026
Merged

Add SplFileInfo support to Image validator#798
vjik merged 4 commits intomasterfrom
feature/591-image-validator

Conversation

@samdark
Copy link
Copy Markdown
Member

@samdark samdark commented Apr 23, 2026

Q A
Is bugfix? ✔️
New feature? ✔️
Breaks BC?

Copilot AI review requested due to automatic review settings April 23, 2026 19:17
@samdark samdark requested a review from vjik April 23, 2026 19:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ImageHandler to resolve image paths from SplFileInfo and to safely handle UploadedFileInterface::getStream() failures.
  • Add test coverage for validating SplFileInfo inputs 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.

Comment thread tests/Rule/Image/ImageTest.php
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread src/Rule/Image/ImageHandler.php Outdated
samdark and others added 2 commits April 24, 2026 10:28
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread CHANGELOG.md
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vjik vjik merged commit 764a172 into master Apr 24, 2026
47 of 48 checks passed
@vjik vjik deleted the feature/591-image-validator branch April 24, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants