MediaWiki REL1_37
DiffOp Class Reference

The base class for all other DiffOp classes. More...

Inheritance diagram for DiffOp:

Public Member Functions

 getClosing ( $i=null)
 Without a line number this returns either all lines on the right ("new") side of the diff, or false when it's a delete operation.
 
 getOrig ()
 Returns either all lines on the left ("old") side of the diff, or false when it's an add operation.
 
 getType ()
 
 nclosing ()
 
 norig ()
 
 reverse ()
 

Public Attributes

string[] false $closing
 The right ("new") side of the diff, or false when it's a "delete".
 
string[] false $orig
 The left ("old") side of the diff, or false when it's an "add".
 
string $type
 

Detailed Description

The base class for all other DiffOp classes.

The classes that extend DiffOp are: DiffOpCopy, DiffOpDelete, DiffOpAdd and DiffOpChange. FakeDiffOp also extends DiffOp, but it is not located in this file.

Access: internal

Definition at line 37 of file DiffOp.php.

Member Function Documentation

◆ getClosing()

DiffOp::getClosing (   $i = null)

Without a line number this returns either all lines on the right ("new") side of the diff, or false when it's a delete operation.

With a line number this returns either the line or null if the line doesn't exist.

Parameters
int | null$iLine number, or null for all lines in the operation
Returns
string[]|false|string|null

Definition at line 83 of file DiffOp.php.

References $closing.

◆ getOrig()

DiffOp::getOrig ( )

Returns either all lines on the left ("old") side of the diff, or false when it's an add operation.

Returns
string[]|false

Definition at line 70 of file DiffOp.php.

References $orig.

◆ getType()

DiffOp::getType ( )
Returns
string Either "add", "change", "copy", or "delete"

Definition at line 60 of file DiffOp.php.

References $type.

◆ nclosing()

DiffOp::nclosing ( )
Returns
int Number of lines on the right ("new") side of the diff, see {
See also
getClosing}

Definition at line 108 of file DiffOp.php.

◆ norig()

DiffOp::norig ( )
Returns
int Number of lines on the left ("old") side of the diff, {
See also
getOrig}

Definition at line 101 of file DiffOp.php.

◆ reverse()

DiffOp::reverse ( )
abstract
Returns
self Inverted operation (a.k.a. revert or undo), e.g. "delete" becomes "add"

Reimplemented in DiffOpAdd, DiffOpChange, DiffOpCopy, and DiffOpDelete.

Member Data Documentation

◆ $closing

string [] false DiffOp::$closing

The right ("new") side of the diff, or false when it's a "delete".

Access: private
Please use {
See also
getClosing}

Definition at line 55 of file DiffOp.php.

Referenced by DiffOpChange\__construct(), DiffOpCopy\__construct(), and getClosing().

◆ $orig

string [] false DiffOp::$orig

The left ("old") side of the diff, or false when it's an "add".

Access: private
Please use {
See also
getOrig}

Definition at line 49 of file DiffOp.php.

Referenced by DiffOpChange\__construct(), DiffOpCopy\__construct(), and getOrig().

◆ $type

string DiffOp::$type
Access: private
Please use {
See also
getType}

Definition at line 43 of file DiffOp.php.

Referenced by getType().


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