original_string: public static function handleStatic($swooleRequest, $swooleResponse, string $publicPath)
      {
          $uri = $swooleRequest->server['request_uri'] ?? '';
          $extension = strtok(pathinfo($uri, PATHINFO_EXTENSION), '?');
          $fileName = $publicPath . $uri;
  
          if ($extension && in_array($extension, static::EXTENSION_BLACKLIST)) {
              return false;
          }
  
          if (! is_file($fileName) || ! filesize($fileName)) {
              return false;
          }
  
          $swooleResponse->status(IlluminateResponse::HTTP_OK);
          $swooleResponse->header('Content-Type', MimeType::get($extension));
          $swooleResponse->sendfile($fileName);
  
          return true;
      }
code: public static function handleStatic($swooleRequest, $swooleResponse, string $publicPath)
      {
          $uri = $swooleRequest->server['request_uri'] ?? '';
          $extension = strtok(pathinfo($uri, PATHINFO_EXTENSION), '?');
          $fileName = $publicPath . $uri;
  
          if ($extension && in_array($extension, static::EXTENSION_BLACKLIST)) {
              return false;
          }
  
          if (! is_file($fileName) || ! filesize($fileName)) {
              return false;
          }
  
          $swooleResponse->status(IlluminateResponse::HTTP_OK);
          $swooleResponse->header('Content-Type', MimeType::get($extension));
          $swooleResponse->sendfile($fileName);
  
          return true;
      }
code_tokens: public static function handleStatic ( $ swooleRequest , $ swooleResponse , string $ publicPath ) { $ uri = $ swooleRequest -> server [ 'request_uri' ] ?? '' ; $ extension = strtok ( pathinfo ( $ uri , PATHINFO_EXTENSION ) , '?' ) ; $ fileName = $ publicPath . $ uri ; if ( $ extension && in_array ( $ extension , static :: EXTENSION_BLACKLIST ) ) { return false ; } if ( ! is_file ( $ fileName ) || ! filesize ( $ fileName ) ) { return false ; } $ swooleResponse -> status ( IlluminateResponse :: HTTP_OK ) ; $ swooleResponse -> header ( 'Content-Type' , MimeType :: get ( $ extension ) ) ; $ swooleResponse -> sendfile ( $ fileName ) ; return true ; }
docstring: Handle static request.
  
  @param \Swoole\Http\Request $swooleRequest
  @param \Swoole\Http\Response $swooleResponse
  @param string $publicPath
  
  @return boolean
docstring_tokens: Handle static request .