Change 'body' property of Message to accept any iterable #2
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Total time spent: 9 minutes 1 second
Due date
c.fahner
9 minutes 1 second
No due date set.
Dependencies
No dependencies set.
Reference
slendium/http#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
$bodyproperty of theMessageinterface currently requires a specific class implementation ofStringable&Traversable. TheStringabletype was initially added for convenience, to be able to treat the message body as any regular string. However, the problem being solved - concatenating aTraversable<Stringable|string>without an additional function invocation - is too trivial to burden all implementations of one of the main interfaces of the library with. The property should also just have a single responsibility, holding the chunked message body, and not also being responsible for its representation / output.This issue changes the
Message::$bodyproperty to accept anyiterable<Stringable|string>directly, removing the need to write the same__toString()method for every implementation.