Skip to content

Commit 29183fb

Browse files
committed
Merge pull request php-curl-class#241 from zachborboa/master
Remove unneeded array_map() and array_keys()
2 parents 7eb413b + 1eb4967 commit 29183fb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Curl/Curl.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,11 +663,9 @@ public function setHeader($key, $value)
663663
$this->headers[$key] = $value;
664664
$headers = array();
665665
foreach ($this->headers as $key => $value) {
666-
$headers[$key] = $value;
666+
$headers[] = $key . ': ' . $value;
667667
}
668-
$this->setOpt(CURLOPT_HTTPHEADER, array_map(function($value, $key) {
669-
return $key . ': ' . $value;
670-
}, $headers, array_keys($headers)));
668+
$this->setOpt(CURLOPT_HTTPHEADER, $headers);
671669
}
672670

673671
/**

0 commit comments

Comments
 (0)