@@ -80,12 +80,12 @@ public function handle(Request $request, Closure $next, ?int $limit = null, ?int
80
80
/**
81
81
* We only start crawling once the response has already been sent to the client in order to reduce impact on performance.
82
82
*/
83
- public function terminate (Request $ request , \ Symfony \ Component \ HttpFoundation \ Response $ response ): void
83
+ public function terminate (Request $ request , SymfonyResponse $ response ): void
84
84
{
85
85
$ this ->handleGeneratingLinkHeaders ($ request , $ response );
86
86
}
87
87
88
- public function handleGeneratingLinkHeaders (Request $ request , \ Symfony \ Component \ HttpFoundation \ Response $ response )
88
+ public function handleGeneratingLinkHeaders (Request $ request , SymfonyResponse $ response )
89
89
{
90
90
if (
91
91
! $ response instanceof Response
@@ -115,7 +115,7 @@ public function getConfig(mixed $key, mixed $default = false): mixed
115
115
return config ('http3earlyhints. ' .$ key , $ default );
116
116
}
117
117
118
- protected function generateLinkHeaders (Response $ response , ?int $ limit = null , ?int $ sizeLimit = null , ?array $ excludeKeywords = null ): Collection
118
+ protected function generateLinkHeaders (SymfonyResponse $ response , ?int $ limit = null , ?int $ sizeLimit = null , ?array $ excludeKeywords = null ): Collection
119
119
{
120
120
$ excludeKeywords = array_filter ($ excludeKeywords ?? $ this ->getConfig ('exclude_keywords ' , []));
121
121
$ headers = $ this ->fetchLinkableNodes ($ response )
@@ -159,15 +159,15 @@ protected function generateLinkHeaders(Response $response, ?int $limit = null, ?
159
159
/**
160
160
* Get the DomCrawler instance.
161
161
*/
162
- protected function getCrawler (Response $ response ): Crawler
162
+ protected function getCrawler (SymfonyResponse $ response ): Crawler
163
163
{
164
164
return $ this ->crawler ??= new Crawler ($ response ->getContent ());
165
165
}
166
166
167
167
/**
168
168
* Get all nodes we are interested in pushing.
169
169
*/
170
- protected function fetchLinkableNodes (Response $ response ): Collection
170
+ protected function fetchLinkableNodes (SymfonyResponse $ response ): Collection
171
171
{
172
172
$ crawler = $ this ->getCrawler ($ response );
173
173
@@ -221,7 +221,7 @@ private function buildLinkHeaderString(string $url, ?string $rel = 'preload'): ?
221
221
/**
222
222
* Add Link Header
223
223
*/
224
- private function addLinkHeader (\ Symfony \ Component \ HttpFoundation \ Response $ response , mixed $ link ): Response
224
+ private function addLinkHeader (SymfonyResponse $ response , mixed $ link ): SymfonyResponse
225
225
{
226
226
$ link = trim (collect ($ link )->implode (', ' ));
227
227
if (! $ link || !$ response instanceof Response) {
0 commit comments