original_string: public function change_ext($ext, $file){
      if ( !empty($ext) &&
        !empty($file) &&
        file_exists($file)
      ){
        $pi = pathinfo($file);
        $new = $pi['dirname'].'/'.$pi['filename'].'.'.$ext;
        bbn\file\dir::move($file, $new, true);
        return [
          'file' => $new,
          'file_url' => $this->real_to_url($new)
        ];
      }
      $this->error("Error.");
    }
code: public function change_ext($ext, $file){
      if ( !empty($ext) &&
        !empty($file) &&
        file_exists($file)
      ){
        $pi = pathinfo($file);
        $new = $pi['dirname'].'/'.$pi['filename'].'.'.$ext;
        bbn\file\dir::move($file, $new, true);
        return [
          'file' => $new,
          'file_url' => $this->real_to_url($new)
        ];
      }
      $this->error("Error.");
    }
code_tokens: public function change_ext ( $ ext , $ file ) { if ( ! empty ( $ ext ) && ! empty ( $ file ) && file_exists ( $ file ) ) { $ pi = pathinfo ( $ file ) ; $ new = $ pi [ 'dirname' ] . '/' . $ pi [ 'filename' ] . '.' . $ ext ; bbn \ file \ dir :: move ( $ file , $ new , true ) ; return [ 'file' => $ new , 'file_url' => $ this -> real_to_url ( $ new ) ] ; } $ this -> error ( "Error." ) ; }
docstring: Changes the extension to a file.
  
  @param string $ext The new extension
  @param string $file The file to change
  @return array
docstring_tokens: Changes the extension to a file .