mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
strict to phpstan-level-4
This commit is contained in:
@@ -19,17 +19,16 @@ class StaticFileHandler
|
||||
if (strpos($full_path, $path) !== 0) {
|
||||
$response->status(403);
|
||||
$response->end('403 Forbidden');
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
if (is_file($full_path)) {
|
||||
$exp = strtolower(pathinfo($full_path)['extension'] ?? 'unknown');
|
||||
$response->setHeader('Content-Type', ZMConfig::get('file_header')[$exp] ?? 'application/octet-stream');
|
||||
$response->end(file_get_contents($full_path));
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
$response->status(404);
|
||||
$response->end(HttpUtil::getHttpCodePage(404));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user