original_string: public static function scan_file($file, $filename, $deleteinfected) {
          $antiviruses = self::get_enabled();
          foreach ($antiviruses as $antivirus) {
              $result = $antivirus->scan_file($file, $filename);
              if ($result === $antivirus::SCAN_RESULT_FOUND) {
                  // Infection found.
                  if ($deleteinfected) {
                      unlink($file);
                  }
                  throw new \core\antivirus\scanner_exception('virusfound', '', array('item' => $filename));
              }
          }
      }
code: public static function scan_file($file, $filename, $deleteinfected) {
          $antiviruses = self::get_enabled();
          foreach ($antiviruses as $antivirus) {
              $result = $antivirus->scan_file($file, $filename);
              if ($result === $antivirus::SCAN_RESULT_FOUND) {
                  // Infection found.
                  if ($deleteinfected) {
                      unlink($file);
                  }
                  throw new \core\antivirus\scanner_exception('virusfound', '', array('item' => $filename));
              }
          }
      }
code_tokens: public static function scan_file ( $ file , $ filename , $ deleteinfected ) { $ antiviruses = self :: get_enabled ( ) ; foreach ( $ antiviruses as $ antivirus ) { $ result = $ antivirus -> scan_file ( $ file , $ filename ) ; if ( $ result === $ antivirus :: SCAN_RESULT_FOUND ) { // Infection found. if ( $ deleteinfected ) { unlink ( $ file ) ; } throw new \ core \ antivirus \ scanner_exception ( 'virusfound' , '' , array ( 'item' => $ filename ) ) ; } } }
docstring: Scan file using all enabled antiviruses, throws exception in case of infected file.
  
  @param string $file Full path to the file.
  @param string $filename Name of the file (could be different from physical file if temp file is used).
  @param bool $deleteinfected whether infected file needs to be deleted.
  @throws \core\antivirus\scanner_exception If file is infected.
  @return void
docstring_tokens: Scan file using all enabled antiviruses throws exception in case of infected file .