Skip to content

Fix "Undefined array key" error for stream resources without URI - #228

Merged
vjik merged 1 commit into
masterfrom
fix-undefined-array-key
Oct 27, 2026
Merged

vjik merged 1 commit into
masterfrom
fix-undefined-array-key

Conversation

@vjik

@vjik vjik commented Oct 27, 2026

Copy link
Copy Markdown
Member
Q A
Is bugfix? ✔️
New feature? ❌
Breaks BC? ❌

@vjik
vjik requested a balanced review from Copilot October 27, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrow URI guards preserve existing behavior, and regression tests cover filename detection and both upload transports.

No open issues 🎉

What changed in this PR

Fixes undefined-array-key errors when uploading stream resources whose metadata has no URI, while preserving existing handling of file paths and URI-backed streams.

Changes:

  • Guard missing URI metadata in filename detection and cURL upload handling.
  • Add socket-based regression tests for InputFile and both upload transports.
  • Document the bug fix in the changelog.
File Description
tests/​Type/​InputFileTest.php Tests filename and extension detection for streams without a URI.
tests/​Transport/​NativeTransport/​NativeTransportTest.php Tests native uploads using streams without a URI.
tests/​Transport/​CurlTransport/​CurlTransportTest.php Tests the string-file upload fallback for streams without a URI.
tests/​Support/​TestHelper.php Adds a shared socket-pair helper for regression tests.
src/​Type/​InputFile.php Returns no inferred filename when URI metadata is absent.
src/​Transport/​CurlTransport.php Guards URI access before selecting file-based uploads.
CHANGELOG.md Records the stream metadata bug fix.

Review effort: Balanced

@vjik
vjik merged commit 27fe3f4 into master Oct 27, 2026
22 checks passed
@vjik
vjik deleted the fix-undefined-array-key branch October 27, 2026 07:52
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.

2 participants