-
Notifications
You must be signed in to change notification settings - Fork 150
Serialize into array #219
Serialize into array #219
Conversation
If it ok I will make serializer for response. What are you think about deserializers from arrays? |
@snapshotpl would segregate it to a separate serializer or interface (implementation can be added to existing one, but ISP must be respected IMO) |
@Ocramius as it's static method interface doesn't sense here imo. |
Misread it, good point. Indeed, statics don't need interfaces.
…On 28 Dec 2016 8:01 p.m., "Witold Wasiczko" ***@***.***> wrote:
@Ocramius <https://github.com/Ocramius> as it's static method interface
doesn't sense here imo.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#219 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakD3OM_faQ4jiI0I8SQ04nvQt0jFWks5rMrHtgaJpZM4LXDR0>
.
|
What about array deserializer idea? |
I would create
The purpose of the current serializers is specifically for string de/serialization, and the methods exposed reflect that purpose. New classes specifically for array de/serialization make sense here. |
@weierophinney @Ocramius ready to review |
Merged to develop for release with 1.4.0; thanks, @snapshotpl |
zend-diactoros 1.4.0 Added ----- - [zendframework#219](zendframework#219) adds two new classes, `Zend\Diactoros\Request\ArraySerializer` and `Zend\Diactoros\Response\ArraySerializer`. Each exposes the static methods `toArray()` and `fromArray()`, allowing de/serialization of messages from and to arrays. - [zendframework#236](zendframework#236) adds two new constants to the `Response` class: `MIN_STATUS_CODE_VALUE` and `MAX_STATUS_CODE_VALUE`. Changes ------- - [zendframework#240](zendframework#240) changes the behavior of `ServerRequestFactory::fromGlobals()` when no `$cookies` argument is present. Previously, it would use `$_COOKIES`; now, if a `Cookie` header is present, it will parse and use that to populate the instance instead. This change allows utilizing cookies that contain period characters (`.`) in their names (PHP's built-in cookie handling renames these to replace `.` with `_`, which can lead to synchronization issues with clients). - [zendframework#235](zendframework#235) changes the behavior of `Uri::__toString()` to better follow proscribed behavior in PSR-7. In particular, prior to this release, if a scheme was missing but an authority was present, the class was incorrectly returning a value that did not include a `//` prefix. As of this release, it now does this correctly. Deprecated ---------- - Nothing. Removed ------- - Nothing. Fixed ----- - Nothing.
For me it's useful when I want to serialize messages to log using psr-4 (into context)