Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trim headers values #197

Closed
wants to merge 1 commit into from
Closed

Fix trim headers values #197

wants to merge 1 commit into from

Conversation

mykolahrytsiuk
Copy link

Fix Type error: trim() expects parameter 1 to be string, integer given" at /vendor/nyholm/psr7/src/MessageTrait.php line 216

@@ -177,7 +177,7 @@ private function setHeaders(array $headers)
private function trimHeaderValues(array $values)
{
return array_map(function ($value) {
return trim($value, " \t");
return trim(strval($value), " \t");
Copy link

Choose a reason for hiding this comment

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

Why not (string) $value ?

@Tobion
Copy link
Member

Tobion commented Apr 13, 2018

This error can only happen if you use strict types which is not enabled in this repo.

/vendor/nyholm/psr7/src/MessageTrait.php line 216

You are using a fork apparently.

@Nyholm
Copy link
Member

Nyholm commented Apr 14, 2018

I see that you are using nyholm/psr7

@Tobion
Copy link
Member

Tobion commented Jun 12, 2019

Fixed in #272

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.

None yet

4 participants