Skip to content

Commit

Permalink
refacto: remove useless function toReadableHeaderValue
Browse files Browse the repository at this point in the history
  • Loading branch information
GCalmels authored and cdaguerre committed Apr 23, 2024
1 parent 7b2f7d4 commit f2b25a0
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/Http/TracedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,6 @@ public function getHeaders(bool $throw = true): array
return $this->response->getHeaders($throw);
}

private function toReadableHeaderValue(mixed $value): string
{
if (null === $value) {
return 'null';
} elseif (\is_array($value)) {
return implode(', ', array_map([$this, __FUNCTION__], $value));
} elseif (\is_scalar($value)) {
if (\is_bool($value)) {
return true === $value ? 'true' : 'false';
}

return (string) $value;
} elseif (\is_object($value)) {
if (method_exists($value, '__toString')) {
return (string) $value;
}

return '(object)#'.$value::class;
}

return \gettype($value);
}

public function getContent(bool $throw = true): string
{
try {
Expand Down

0 comments on commit f2b25a0

Please sign in to comment.