MediaWiki  1.23.2
UnifiedDiffFormatter Class Reference

A formatter that outputs unified diffs. More...

Inheritance diagram for UnifiedDiffFormatter:
Collaboration diagram for UnifiedDiffFormatter:

Protected Member Functions

 added ( $lines)
 
 blockHeader ( $xbeg, $xlen, $ybeg, $ylen)
 
 changed ( $orig, $closing)
 
 deleted ( $lines)
 
- Protected Member Functions inherited from DiffFormatter
 block ( $xbeg, $xlen, $ybeg, $ylen, &$edits)
 
 context ( $lines)
 
 endBlock ()
 Called at the end of a block of connected edits. More...
 
 endDiff ()
 
 lines ( $lines, $prefix=' ')
 Writes all (optionally prefixed) lines to the output buffer, separated by newlines. More...
 
 startBlock ( $header)
 Called at the start of a block of connected edits. More...
 
 startDiff ()
 

Protected Attributes

int $leadingContextLines = 2
 
int $trailingContextLines = 2
 
- Protected Attributes inherited from DiffFormatter
int $leadingContextLines = 0
 Number of leading context "lines" to preserve. More...
 
int $trailingContextLines = 0
 Number of trailing context "lines" to preserve. More...
 

Additional Inherited Members

- Public Member Functions inherited from DiffFormatter
 format ( $diff)
 Format a diff. More...
 

Detailed Description

A formatter that outputs unified diffs.

Definition at line 31 of file UnifiedDiffFormatter.php.

Member Function Documentation

◆ added()

UnifiedDiffFormatter::added (   $lines)
protected
Parameters
string[]$lines

Reimplemented from DiffFormatter.

Definition at line 40 of file UnifiedDiffFormatter.php.

References $lines, and DiffFormatter\lines().

Referenced by changed().

◆ blockHeader()

UnifiedDiffFormatter::blockHeader (   $xbeg,
  $xlen,
  $ybeg,
  $ylen 
)
protected
Parameters
int$xbeg
int$xlen
int$ybeg
int$ylen
Returns
string

Reimplemented from DiffFormatter.

Definition at line 68 of file UnifiedDiffFormatter.php.

◆ changed()

UnifiedDiffFormatter::changed (   $orig,
  $closing 
)
protected
Parameters
string[]$orig
string[]$closing

Reimplemented from DiffFormatter.

Definition at line 55 of file UnifiedDiffFormatter.php.

References added(), and deleted().

◆ deleted()

UnifiedDiffFormatter::deleted (   $lines)
protected
Parameters
string[]$lines

Reimplemented from DiffFormatter.

Definition at line 47 of file UnifiedDiffFormatter.php.

References $lines, and DiffFormatter\lines().

Referenced by changed().

Member Data Documentation

◆ $leadingContextLines

int UnifiedDiffFormatter::$leadingContextLines = 2
protected

Definition at line 33 of file UnifiedDiffFormatter.php.

◆ $trailingContextLines

int UnifiedDiffFormatter::$trailingContextLines = 2
protected

Definition at line 35 of file UnifiedDiffFormatter.php.


The documentation for this class was generated from the following file: