Skip to content

Commit d212f41

Browse files
committed
Update docs
Signed-off-by: Jack Cherng <[email protected]>
1 parent 7a45667 commit d212f41

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ $rendererName = 'Unified';
7575
// the Diff class options
7676
$differOptions = [
7777
// show how many neighbor lines
78+
// Differ::CONTEXT_ALL can be used to show the whole file
7879
'context' => 3,
7980
// ignore case difference
8081
'ignoreCase' => false,

example/demo.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
include __DIR__ . '/../vendor/autoload.php';
44

5+
use Jfcherng\Diff\Differ;
56
use Jfcherng\Diff\DiffHelper;
67
use Jfcherng\Diff\Factory\RendererFactory;
78

@@ -25,6 +26,7 @@
2526
// options for Diff class
2627
$diffOptions = [
2728
// show how many neighbor lines
29+
// Differ::CONTEXT_ALL can be used to show the whole file
2830
'context' => 1,
2931
// ignore case difference
3032
'ignoreCase' => false,

src/Differ.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
final class Differ
1717
{
18-
// a safe number for indicating showing all contexts
19-
const CONTEXT_ALL = \PHP_INT_MAX >> 4;
18+
/** @var int a safe number for indicating showing all contexts */
19+
const CONTEXT_ALL = \PHP_INT_MAX >> 3;
2020

2121
/**
2222
* @var array cached properties and their default values
@@ -32,12 +32,12 @@ final class Differ
3232
public $options = [];
3333

3434
/**
35-
* @var string[] the "old" sequence to use as the basis for the comparison
35+
* @var string[] the old sequence
3636
*/
3737
private $old = [];
3838

3939
/**
40-
* @var string[] the "new" sequence to generate the changes for
40+
* @var string[] the new sequence
4141
*/
4242
private $new = [];
4343

@@ -67,6 +67,7 @@ final class Differ
6767
*/
6868
private static $defaultOptions = [
6969
// show how many neighbor lines
70+
// Differ::CONTEXT_ALL can be used to show the whole file
7071
'context' => 3,
7172
// ignore case difference
7273
'ignoreWhitespace' => false,

0 commit comments

Comments
 (0)