original_string: public function getDiskData($wmiConnection) {
  
          $LogicalDisk = $wmiConnection->query("SELECT Size, FreeSpace, DeviceID FROM Win32_LogicalDisk");
  
          $return = Array();
  
          $index = 0;
          foreach ($LogicalDisk as $wmi_LogicalDisk) {
              if (isset($wmi_LogicalDisk->Size) and $wmi_LogicalDisk->Size > 0) {
                  $return['index'][$index] = $index;
                  $return['total_size'][$index] = $wmi_LogicalDisk->Size;
                  $return['free_size'][$index] = $wmi_LogicalDisk->FreeSpace;
                  $return['used_size'][$index] = $return['total_size'][$index] - $return['free_size'][$index];
                  $return['used_percent'][$index] = round((($return['free_size'][$index] / $return['total_size'][$index]) * 100), 2);
                  $return['free_percent'][$index] = round((($return['used_size'][$index] / $return['total_size'][$index]) * 100), 2);
                  $return['path'][$index] = $wmi_LogicalDisk->DeviceID;
                  $index++;
              }
          }
  
          return $return;
      }
code: public function getDiskData($wmiConnection) {
  
          $LogicalDisk = $wmiConnection->query("SELECT Size, FreeSpace, DeviceID FROM Win32_LogicalDisk");
  
          $return = Array();
  
          $index = 0;
          foreach ($LogicalDisk as $wmi_LogicalDisk) {
              if (isset($wmi_LogicalDisk->Size) and $wmi_LogicalDisk->Size > 0) {
                  $return['index'][$index] = $index;
                  $return['total_size'][$index] = $wmi_LogicalDisk->Size;
                  $return['free_size'][$index] = $wmi_LogicalDisk->FreeSpace;
                  $return['used_size'][$index] = $return['total_size'][$index] - $return['free_size'][$index];
                  $return['used_percent'][$index] = round((($return['free_size'][$index] / $return['total_size'][$index]) * 100), 2);
                  $return['free_percent'][$index] = round((($return['used_size'][$index] / $return['total_size'][$index]) * 100), 2);
                  $return['path'][$index] = $wmi_LogicalDisk->DeviceID;
                  $index++;
              }
          }
  
          return $return;
      }
code_tokens: public function getDiskData ( $ wmiConnection ) { $ LogicalDisk = $ wmiConnection -> query ( "SELECT Size, FreeSpace, DeviceID FROM Win32_LogicalDisk" ) ; $ return = Array ( ) ; $ index = 0 ; foreach ( $ LogicalDisk as $ wmi_LogicalDisk ) { if ( isset ( $ wmi_LogicalDisk -> Size ) and $ wmi_LogicalDisk -> Size > 0 ) { $ return [ 'index' ] [ $ index ] = $ index ; $ return [ 'total_size' ] [ $ index ] = $ wmi_LogicalDisk -> Size ; $ return [ 'free_size' ] [ $ index ] = $ wmi_LogicalDisk -> FreeSpace ; $ return [ 'used_size' ] [ $ index ] = $ return [ 'total_size' ] [ $ index ] - $ return [ 'free_size' ] [ $ index ] ; $ return [ 'used_percent' ] [ $ index ] = round ( ( ( $ return [ 'free_size' ] [ $ index ] / $ return [ 'total_size' ] [ $ index ] ) * 100 ) , 2 ) ; $ return [ 'free_percent' ] [ $ index ] = round ( ( ( $ return [ 'used_size' ] [ $ index ] / $ return [ 'total_size' ] [ $ index ] ) * 100 ) , 2 ) ; $ return [ 'path' ] [ $ index ] = $ wmi_LogicalDisk -> DeviceID ; $ index ++ ; } } return $ return ; }
docstring: Return Disk Data
  @param object $wmiConnection
  @return array
docstring_tokens: Return Disk Data