Skip to content

Commit

Permalink
HeaderCollection constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
SonyPradana committed Oct 25, 2023
1 parent dbccd5c commit aab8eb0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/System/Http/HeaderCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
*/
class HeaderCollection extends Collection
{
/**
* Header collection.
*
* @param array<string, string> $headers
*/
public function __construct($headers)
{
parent::__construct($headers);
}

public function __toString()
{
$headers = $this->clone()->map(fn (string $value, string $key = ''): string => "{$key}: {$value}")->toArray();
Expand Down

0 comments on commit aab8eb0

Please sign in to comment.