Skip to content

Hash::extract() is transforming values. #8053

Closed
@dereuromark

Description

I think Hash::extract() does too much, it should maybe not convert the value itself into an array, but rather return it completely.
This would allow for string casts afterwards, whereas right now it would need information on how the array structure of each transformed object looks like.

Example case: FriendsOfCake/cakephp-csvview#55

We just want the User.created DateTime object from the entity, so we can pass it to _renderRow().
But instead the array of it is returned and we can never transform it again as string without deep knowledge of the structure of this specific array.

Might be a side effect of recent changes, maybe a regression even.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions