MediaWiki  master
DiffOp.php
Go to the documentation of this file.
1 <?php
37 abstract class DiffOp {
38 
43  public $type;
44 
49  public $orig;
50 
55  public $closing;
56 
60  public function getType() {
61  return $this->type;
62  }
63 
70  public function getOrig() {
71  return $this->orig;
72  }
73 
83  public function getClosing( $i = null ) {
84  if ( $i === null ) {
85  return $this->closing;
86  }
87  if ( array_key_exists( $i, $this->closing ) ) {
88  return $this->closing[$i];
89  }
90  return null;
91  }
92 
96  abstract public function reverse();
97 
101  public function norig() {
102  return $this->orig ? count( $this->orig ) : 0;
103  }
104 
108  public function nclosing() {
109  return $this->closing ? count( $this->closing ) : 0;
110  }
111 }
The base class for all other DiffOp classes.
Definition: DiffOp.php:37
getOrig()
Returns either all lines on the left ("old") side of the diff, or false when it's an add operation.
Definition: DiffOp.php:70
string[] false $orig
The left ("old") side of the diff, or false when it's an "add".
Definition: DiffOp.php:49
nclosing()
Definition: DiffOp.php:108
getClosing( $i=null)
Without a line number this returns either all lines on the right ("new") side of the diff,...
Definition: DiffOp.php:83
string $type
Definition: DiffOp.php:43
getType()
Definition: DiffOp.php:60
string[] false $closing
The right ("new") side of the diff, or false when it's a "delete".
Definition: DiffOp.php:55
norig()
Definition: DiffOp.php:101