MediaWiki
master
DiffOp.php
Go to the documentation of this file.
1
<?php
14
namespace
Wikimedia\Diff
;
15
24
abstract
class
DiffOp
{
25
30
public
$type
;
31
36
public
$orig
;
37
42
public
$closing
;
43
47
public
function
getType
() {
48
return
$this->type
;
49
}
50
57
public
function
getOrig
() {
58
return
$this->orig
;
59
}
60
70
public
function
getClosing
( $i =
null
) {
71
if
( $i ===
null
) {
72
return
$this->closing
;
73
}
74
if
( array_key_exists( $i, $this->closing ) ) {
75
return
$this->closing[$i];
76
}
77
return
null
;
78
}
79
83
abstract
public
function
reverse
();
84
88
public
function
norig
() {
89
return
$this->orig ? count( $this->orig ) : 0;
90
}
91
95
public
function
nclosing
() {
96
return
$this->closing ? count( $this->closing ) : 0;
97
}
98
}
99
101
class_alias( DiffOp::class,
'DiffOp'
);
Wikimedia\Diff\DiffOp
The base class for all other DiffOp classes.
Definition
DiffOp.php:24
Wikimedia\Diff\DiffOp\getClosing
getClosing( $i=null)
Without a line number this returns either all lines on the right ("new") side of the diff,...
Definition
DiffOp.php:70
Wikimedia\Diff\DiffOp\nclosing
nclosing()
Definition
DiffOp.php:95
Wikimedia\Diff\DiffOp\getOrig
getOrig()
Returns either all lines on the left ("old") side of the diff, or false when it's an add operation.
Definition
DiffOp.php:57
Wikimedia\Diff\DiffOp\norig
norig()
Definition
DiffOp.php:88
Wikimedia\Diff\DiffOp\$type
string $type
Definition
DiffOp.php:30
Wikimedia\Diff\DiffOp\getType
getType()
Definition
DiffOp.php:47
Wikimedia\Diff\DiffOp\reverse
reverse()
Wikimedia\Diff\DiffOp\$closing
string[] false $closing
The right ("new") side of the diff, or false when it's a "delete".
Definition
DiffOp.php:42
Wikimedia\Diff\DiffOp\$orig
string[] false $orig
The left ("old") side of the diff, or false when it's an "add".
Definition
DiffOp.php:36
Wikimedia\Diff
Definition
ArrayDiffFormatter.php:13
includes
libs
Diff
DiffOp.php
Generated on Wed Dec 10 2025 11:25:07 for MediaWiki by
1.10.0