original_string: public function response($path, $name = null, array $headers = [], $disposition = 'inline')
      {
          $response = new StreamedResponse;
  
          $disposition = $response->headers->makeDisposition($disposition, $name ?? basename($path));
  
          $response->headers->replace($headers + [
              'Content-Type' => $this->mimeType($path),
              'Content-Length' => $this->size($path),
              'Content-Disposition' => $disposition,
          ]);
  
          $response->setCallback(function () use ($path) {
              $stream = $this->readStream($path);
              fpassthru($stream);
              fclose($stream);
          });
  
          return $response;
      }
code: public function response($path, $name = null, array $headers = [], $disposition = 'inline')
      {
          $response = new StreamedResponse;
  
          $disposition = $response->headers->makeDisposition($disposition, $name ?? basename($path));
  
          $response->headers->replace($headers + [
              'Content-Type' => $this->mimeType($path),
              'Content-Length' => $this->size($path),
              'Content-Disposition' => $disposition,
          ]);
  
          $response->setCallback(function () use ($path) {
              $stream = $this->readStream($path);
              fpassthru($stream);
              fclose($stream);
          });
  
          return $response;
      }
code_tokens: public function response ( $ path , $ name = null , array $ headers = [ ] , $ disposition = 'inline' ) { $ response = new StreamedResponse ; $ disposition = $ response -> headers -> makeDisposition ( $ disposition , $ name ?? basename ( $ path ) ) ; $ response -> headers -> replace ( $ headers + [ 'Content-Type' => $ this -> mimeType ( $ path ) , 'Content-Length' => $ this -> size ( $ path ) , 'Content-Disposition' => $ disposition , ] ) ; $ response -> setCallback ( function ( ) use ( $ path ) { $ stream = $ this -> readStream ( $ path ) ; fpassthru ( $ stream ) ; fclose ( $ stream ) ; } ) ; return $ response ; }
docstring: Create a streamed response for a given file.
  
  @param  string  $path
  @param  string|null  $name
  @param  array|null  $headers
  @param  string|null  $disposition
  @return \Symfony\Component\HttpFoundation\StreamedResponse
docstring_tokens: Create a streamed response for a given file .