Explorar o código

analyse fix: The key 'basename' is always present in the return value of `pathinfo`

Chance %!s(int64=2) %!d(string=hai) anos
pai
achega
c106f4c0ee
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Protocols/Http/Response.php

+ 1 - 1
src/Protocols/Http/Response.php

@@ -401,7 +401,7 @@ class Response
 
         $fileInfo = pathinfo($file);
         $extension = $fileInfo['extension'] ?? '';
-        $baseName = $fileInfo['basename'] ?? 'unknown';
+        $baseName = $fileInfo['basename'] ?: 'unknown';
         if (!isset($headers['Content-Type'])) {
             if (isset(self::$mimeTypeMap[$extension])) {
                 $head .= "Content-Type: " . self::$mimeTypeMap[$extension] . "\r\n";