MediaWiki
REL1_39
UnifiedDiffFormatter.php
Go to the documentation of this file.
1
<?php
32
class
UnifiedDiffFormatter
extends
DiffFormatter
{
33
35
protected
$leadingContextLines
= 2;
36
38
protected
$trailingContextLines
= 2;
39
44
protected
function
lines
(
$lines
, $prefix =
' '
) {
45
foreach
(
$lines
as
$line
) {
46
$this->
writeOutput
(
"{$prefix}{$line}\n"
);
47
}
48
}
49
53
protected
function
added
(
$lines
) {
54
$this->
lines
(
$lines
,
'+'
);
55
}
56
60
protected
function
deleted
(
$lines
) {
61
$this->
lines
(
$lines
,
'-'
);
62
}
63
68
protected
function
changed
( $orig, $closing ) {
69
$this->
deleted
( $orig );
70
$this->
added
( $closing );
71
}
72
81
protected
function
blockHeader
( $xbeg, $xlen, $ybeg, $ylen ) {
82
return
"@@ -$xbeg,$xlen +$ybeg,$ylen @@"
;
83
}
84
85
}
DiffFormatter
Base class for diff formatters.
Definition
DiffFormatter.php:36
DiffFormatter\writeOutput
writeOutput( $text)
Writes a string to the output buffer.
Definition
DiffFormatter.php:159
UnifiedDiffFormatter
A formatter that outputs unified diffs.
Definition
UnifiedDiffFormatter.php:32
UnifiedDiffFormatter\blockHeader
blockHeader( $xbeg, $xlen, $ybeg, $ylen)
Definition
UnifiedDiffFormatter.php:81
UnifiedDiffFormatter\lines
lines( $lines, $prefix=' ')
Definition
UnifiedDiffFormatter.php:44
UnifiedDiffFormatter\$trailingContextLines
int $trailingContextLines
Definition
UnifiedDiffFormatter.php:38
UnifiedDiffFormatter\$leadingContextLines
int $leadingContextLines
Definition
UnifiedDiffFormatter.php:35
UnifiedDiffFormatter\deleted
deleted( $lines)
Definition
UnifiedDiffFormatter.php:60
UnifiedDiffFormatter\changed
changed( $orig, $closing)
Definition
UnifiedDiffFormatter.php:68
UnifiedDiffFormatter\added
added( $lines)
Definition
UnifiedDiffFormatter.php:53
$line
$line
Definition
mcc.php:119
$lines
if(!file_exists( $CREDITS)) $lines
Definition
updateCredits.php:45
includes
diff
UnifiedDiffFormatter.php
Generated on Thu Nov 21 2024 05:22:47 for MediaWiki by
1.10.0