original_string: protected function formatFileInfo($fileInfo)
      {
          if(empty($fileInfo) || !is_array($fileInfo) || isset($fileInfo[0])){
              return $fileInfo;
          }
  
          $file = [];
          foreach ($fileInfo as $key => $value){
              if(is_array($value)){
                  foreach ($value as $k => $v){
                      $file[$k][$key] = $v;
                  }
              } else {
                  $file[$key] = $value;
              }
          }
  
          return $file;
      }
code: protected function formatFileInfo($fileInfo)
      {
          if(empty($fileInfo) || !is_array($fileInfo) || isset($fileInfo[0])){
              return $fileInfo;
          }
  
          $file = [];
          foreach ($fileInfo as $key => $value){
              if(is_array($value)){
                  foreach ($value as $k => $v){
                      $file[$k][$key] = $v;
                  }
              } else {
                  $file[$key] = $value;
              }
          }
  
          return $file;
      }
code_tokens: protected function formatFileInfo ( $ fileInfo ) { if ( empty ( $ fileInfo ) || ! is_array ( $ fileInfo ) || isset ( $ fileInfo [ 0 ] ) ) { return $ fileInfo ; } $ file = [ ] ; foreach ( $ fileInfo as $ key => $ value ) { if ( is_array ( $ value ) ) { foreach ( $ value as $ k => $ v ) { $ file [ $ k ] [ $ key ] = $ v ; } } else { $ file [ $ key ] = $ value ; } } return $ file ; }
docstring: Format file data for ease of use
  
  @param array|null $fileInfo
  
  @return array
docstring_tokens: Format file data for ease of use