Skip to content

Commit

Permalink
refactor: Check for web response
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jun 23, 2024
1 parent cd5b5dd commit 554790c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/Redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public function doRedirect(string $fullUrl, string $pathOnly, $redirect): bool
// Sanitize the URL
$dest = UrlHelper::sanitizeUrl($dest);
// Optionally set the no-cache headers
if (Retour::$settings->setNoCacheHeaders) {
if (Retour::$settings->setNoCacheHeaders && $response instanceof \yii\web\Response) {
$response->setNoCacheHeaders();

Check failure on line 336 in src/services/Redirects.php

View workflow job for this annotation

GitHub Actions / PHPStan

Call to an undefined method yii\web\Response::setNoCacheHeaders().
}
// Add any additional headers (existing ones will be replaced)
Expand Down

0 comments on commit 554790c

Please sign in to comment.