Skip to content

Commit 7d973d3

Browse files
committed
Document methods
* Add missing documentation. * Fixes and reformatting.
1 parent 3b48a0f commit 7d973d3

File tree

3 files changed

+12
-23
lines changed

3 files changed

+12
-23
lines changed

lib/jblond/Diff.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ class Diff
4646
private $groupedCodes;
4747

4848
/**
49-
* @var array<string, string> Associative array containing the default options available
50-
* for the diff class and their default value.
49+
* @var array Associative array containing the default options available for the diff class and their default value.
5150
*
5251
* - context The amount of lines to include around blocks that differ.
5352
* - trimEqual Strip blocks of equal lines from the start and end of the text.

lib/jblond/Diff/Renderer/MainRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ protected function renderSequences(): array
124124
* 4 - The end line in the second sequence.
125125
*
126126
* The different types of tags include:
127-
* replace - The string from $startOld to $endOld in $oldText should be replaced by
127+
* replace - The string in $oldText from $startOld to $endOld, should be replaced by
128128
* the string in $newText from $startNew to $endNew.
129129
* delete - The string in $oldText from $startOld to $endNew should be deleted.
130130
* insert - The string in $newText from $startNew to $endNew should be inserted at $startOld in
@@ -291,7 +291,7 @@ public function sequenceToArray(string $pattern, string $sequence): array
291291
* E.g.
292292
* <pre>
293293
* 1234567
294-
* OLd => "abcdefg" Start marker inserted at position 3
294+
* Old => "abcdefg" Start marker inserted at position 3
295295
* New => "ab123fg" End marker inserted at position 6
296296
* </pre>
297297
*

lib/jblond/Diff/SequenceMatcher.php

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,12 @@ class SequenceMatcher
4646
private $b2j = [];
4747

4848
/**
49-
* @var array
50-
*/
51-
private $options = [];
52-
53-
/**
54-
* @var null|array
49+
* @var array A list of all of the op-codes for the differences between the compared strings.
5550
*/
5651
private $opCodes;
5752

5853
/**
59-
* @var null|array
54+
* @var array A nested set of arrays for all of the matching sub-sequences the compared strings.
6055
*/
6156
private $matchingBlocks;
6257

@@ -72,9 +67,8 @@ class SequenceMatcher
7267
];
7368

7469
/**
75-
* The constructor. With the sequences being passed, they'll be set for the
76-
* sequence matcher and it will perform a basic cleanup & calculate junk
77-
* elements.
70+
* The constructor. With the sequences being passed, they'll be set for the sequence matcher and it will perform a
71+
* basic cleanup & calculate junk elements.
7872
*
7973
* @param string|array $old A string or array containing the lines to compare against.
8074
* @param string|array $new A string or array containing the lines to compare.
@@ -295,11 +289,9 @@ public function getGroupedOpCodes(): array
295289
}
296290

297291
/**
298-
* Return a list of all of the op codes for the differences between the
299-
* two strings.
292+
* Return a list of all of the op codes for the differences between the two strings.
300293
*
301-
* The nested array returned contains an array describing the op code
302-
* which includes:
294+
* The nested array returned contains an array describing the op code which includes:
303295
* 0 - The type of tag (as described below) for the op code.
304296
* 1 - The beginning line in the first sequence.
305297
* 2 - The end line in the first sequence.
@@ -366,12 +358,10 @@ public function getOpCodes(): array
366358
}
367359

368360
/**
369-
* Return a nested set of arrays for all of the matching sub-sequences
370-
* in the strings $a and $b.
361+
* Return a nested set of arrays for all of the matching sub-sequences in compared strings $a and $b.
371362
*
372-
* Each block contains the lower constraint of the block in $a, the lower
373-
* constraint of the block in $b and finally the number of lines that the
374-
* block continues for.
363+
* Each block contains the lower constraint of the block in $a, the lower constraint of the block in $b and finally
364+
* the number of lines that the block continues for.
375365
*
376366
* @return array Nested array of the matching blocks, as described by the function.
377367
*/

0 commit comments

Comments
 (0)