Skip to content

Commit

Permalink
refactor: Use array_merge to combine string-keyed array
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Nov 19, 2024
1 parent 9abae8b commit decf137
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/Service/Avatar/FaviconDataAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Exception;
use OCA\Mail\Vendor\Favicon\DataAccess;
use OCP\Http\Client\IClientService;
use function array_merge;

class FaviconDataAccess extends DataAccess {

Expand Down Expand Up @@ -45,10 +46,12 @@ public function retrieveHeader($url) {
// Build the data structure get_headers returns. The status reason
// and protocol are inaccurate, but the favicon lib will only extract
// the status code.
return [
0 => 'HTTP/1.1 ' . $response->getStatusCode() . ' FOO',
...array_change_key_case($response->getHeaders()),
];
return array_merge(
[
0 => 'HTTP/1.1 ' . $response->getStatusCode() . ' FOO',
],
array_change_key_case($response->getHeaders()),
);
}

}

0 comments on commit decf137

Please sign in to comment.