Skip to content

Commit 5173580

Browse files
committed
fix collection arguments order for 5.3+
1 parent 72549ff commit 5173580

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Middleware/AddHttp2ServerPush.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private function buildLinkHeaderString($url)
109109
'.TIFF' => 'image',
110110
];
111111

112-
$type = collect($linkTypeMap)->first(function ($extension) use ($url) {
112+
$type = collect($linkTypeMap)->first(function ($type, $extension) use ($url) {
113113
return str_contains(strtoupper($url), $extension);
114114
});
115115

tests/AddHttp2ServerPushTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ public function it_will_return_a_js_link_header_for_js()
4949
}
5050

5151
/** @test */
52-
public function it_will_return_a_image_link_header_for_images()
52+
public function it_will_return_an_image_link_header_for_images()
5353
{
5454
$request = new Request();
5555

5656
$response = $this->middleware->handle($request, $this->getNext('pageWithImages'));
5757

5858
$this->assertTrue($this->isServerPushResponse($response));
5959
$this->assertStringEndsWith("as=image", $response->headers->get('link'));
60-
$this->assertCount(6, explode(",", $response->headers));
60+
$this->assertCount(6, explode(",", $response->headers->get('link')));
6161
}
6262

6363
/** @test */
@@ -80,7 +80,7 @@ public function it_will_return_correct_push_headers_for_multiple_assets()
8080
$this->assertTrue($this->isServerPushResponse($response));
8181
$this->assertTrue(str_contains($response->headers, 'style'));
8282
$this->assertTrue(str_contains($response->headers, 'script'));
83-
$this->assertCount(2, explode(",", $response->headers));
83+
$this->assertCount(2, explode(",", $response->headers->get('link')));
8484
}
8585

8686
/** @test */

0 commit comments

Comments
 (0)