Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

flatten cookies for header #92

Merged
merged 8 commits into from
Jan 25, 2017
Merged

flatten cookies for header #92

merged 8 commits into from
Jan 25, 2017

Conversation

tflori
Copy link
Contributor

@tflori tflori commented Oct 27, 2016

Fix issue #77

@tflori tflori closed this Oct 27, 2016
@tflori tflori reopened this Oct 27, 2016
@jaapio
Copy link
Contributor

jaapio commented Nov 10, 2016

Could you provide a unittest for this?

@tflori
Copy link
Contributor Author

tflori commented Dec 8, 2016

@jaapio I created a test can you please recheck?

@jaapio
Copy link
Contributor

jaapio commented Dec 8, 2016 via email

@tflori
Copy link
Contributor Author

tflori commented Dec 21, 2016

@weierophinney it would be greate if you could review this pr. thanks in advance.

$nvPairs[] = $name . '=' . (($this->encodeValue) ? urlencode($value) : $value);
}

return implode('; ', $nvPairs);
}

protected function flattenCookies(&$result, $data, $prefix = null)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we need a recursive function here? Do we need to manage array of array values in cookies? I think we should simplify the implementation here, for instance just iterating on keys and values of $value, if it is an array.

Copy link
Contributor

Choose a reason for hiding this comment

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

Btw, we discourage the usage of passing value by reference in function. A good use case for reference is performance reason, but this is not the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For me the correct way seems to be what php is doing. So yes we need a recursive function. But you are right we can write it without passing by reference.

@tflori
Copy link
Contributor Author

tflori commented Jan 25, 2017

@ezimuel I modified the function not to use pass by reference.

I don't know why coveralls shows a decreased coverage status - the function I added is tested. Nothing else changed.

@ezimuel ezimuel merged commit 75b0bff into zendframework:master Jan 25, 2017
@ezimuel
Copy link
Contributor

ezimuel commented Jan 25, 2017

@tflori thanks for your contribution! I improved the unit test with a bi-dimensional cookie array.

@tflori tflori deleted the cookie-array-patch branch January 25, 2017 23:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants