MediaWiki
REL1_31
UnifiedDiffFormatter.php
Go to the documentation of this file.
1
<?php
31
class
UnifiedDiffFormatter
extends
DiffFormatter
{
32
34
protected
$leadingContextLines
= 2;
35
37
protected
$trailingContextLines
= 2;
38
43
protected
function
lines
(
$lines
, $prefix =
' '
) {
44
foreach
(
$lines
as
$line
) {
45
$this->
writeOutput
(
"{$prefix}{$line}\n"
);
46
}
47
}
48
52
protected
function
added
(
$lines
) {
53
$this->
lines
(
$lines
,
'+'
);
54
}
55
59
protected
function
deleted
(
$lines
) {
60
$this->
lines
(
$lines
,
'-'
);
61
}
62
67
protected
function
changed
( $orig, $closing ) {
68
$this->
deleted
( $orig );
69
$this->
added
( $closing );
70
}
71
80
protected
function
blockHeader
( $xbeg, $xlen, $ybeg, $ylen ) {
81
return
"@@ -$xbeg,$xlen +$ybeg,$ylen @@"
;
82
}
83
84
}
$line
$line
Definition
cdb.php:59
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:31
UnifiedDiffFormatter\blockHeader
blockHeader( $xbeg, $xlen, $ybeg, $ylen)
Definition
UnifiedDiffFormatter.php:80
UnifiedDiffFormatter\lines
lines( $lines, $prefix=' ')
Definition
UnifiedDiffFormatter.php:43
UnifiedDiffFormatter\$trailingContextLines
int $trailingContextLines
Definition
UnifiedDiffFormatter.php:37
UnifiedDiffFormatter\$leadingContextLines
int $leadingContextLines
Definition
UnifiedDiffFormatter.php:34
UnifiedDiffFormatter\deleted
deleted( $lines)
Definition
UnifiedDiffFormatter.php:59
UnifiedDiffFormatter\changed
changed( $orig, $closing)
Definition
UnifiedDiffFormatter.php:67
UnifiedDiffFormatter\added
added( $lines)
Definition
UnifiedDiffFormatter.php:52
$lines
$lines
Definition
router.php:61
includes
diff
UnifiedDiffFormatter.php
Generated on Mon Nov 25 2024 15:34:42 for MediaWiki by
1.10.0