Skip to content

Commit 5e5cf20

Browse files
authored
Merge branch 'master' into php-diff-82
2 parents 280eb83 + 3f44195 commit 5e5cf20

22 files changed

+57
-50
lines changed

changelog.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Changelog
22

3-
## 2.3.2 (2021-03-27)
3+
## 2.3.3 (2021-08-23)
44

5-
* Bump library version ([6e42d96](https://github.com/JBlond/php-diff/commit/6e42d96))
5+
* Fix Autoload test classes only in development ([31b4222](https://github.com/JBlond/php-diff/commit/31b4222))
6+
7+
## v2.3.2 (2021-03-27)
8+
9+
* Bump library version und update Changelog ([8a83b39](https://github.com/JBlond/php-diff/commit/8a83b39))
610
* Fix [#90](https://github.com/JBlond/php-diff/issues/90) - Merged Diff shows result only partially ([acbfd7d](https://github.com/JBlond/php-diff/commit/acbfd7d))
711
* Fix colors ([7eba340](https://github.com/JBlond/php-diff/commit/7eba340))
812
* Fix repeating class assignment of line header ([fb32453](https://github.com/JBlond/php-diff/commit/fb32453))

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
},
4444
"autoload": {
4545
"psr-4": {
46-
"jblond\\": "lib/jblond",
46+
"jblond\\": "lib/jblond"
47+
}
48+
},
49+
"autoload-dev": {
50+
"psr-4": {
4751
"Tests\\": "tests"
4852
}
4953
},

generateChangelog.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
require 'vendor/autoload.php';
66

77
$changelogOptions = [
8-
'headTagName' => '2.3.2',
9-
'headTagDate' => '2021-03-27',
8+
'headTagName' => '2.3.3',
9+
'headTagDate' => '2021-08-23',
1010
'titleOrder' => 'ASC',
1111
];
1212
$changelogLabels = ['Add', 'Cut', 'Fix', 'Bump', 'Document','Optimize'];

lib/jblond/Diff.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @author Ferry Cools <[email protected]>
2525
* @copyright (c) 2020 Mario Brandt
2626
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
27-
* @version 2.3.2
27+
* @version 2.3.3
2828
* @link https://github.com/JBlond/php-diff
2929
*/
3030
class Diff implements ConstantsInterface
@@ -89,7 +89,7 @@ class Diff implements ConstantsInterface
8989
* The values can be of type string or array.
9090
* If the type is string, it's split into array elements by line-end characters.
9191
*
92-
* Options for comparison can be set by using the third parameter. The format of this value is expected to be a
92+
* Options for comparison can be set by using the third parameter. The format of this value is expected to be an
9393
* associative array where each key-value pair represents an option and its value (E.g. ['context' => 3], ...).
9494
* When a keyName matches the name of a default option, that option's value will be overridden by the key's value.
9595
* Any other keyName (and it's value) can be added as an option, but will not be used if not implemented.
@@ -112,7 +112,7 @@ public function __construct($version1, $version2, array $options = [])
112112
}
113113

114114
/**
115-
* Get the type of a variable.
115+
* Get the kind of variable.
116116
*
117117
* The return value depend on the type of variable:
118118
* 0 If the type is 'array'
@@ -202,11 +202,11 @@ public function render(object $renderer)
202202
* @param int|null $end The last element of the range to get.
203203
* If not supplied, only the element at start will be returned.
204204
*
205-
* @return array Array containing all of the elements of the specified range.
205+
* @return array Array containing all the elements of the specified range.
206206
* @throws OutOfRangeException When the value of start or end are invalid to define a range.
207207
*
208208
*/
209-
public function getArrayRange(array $array, int $start = 0, $end = null): array
209+
public function getArrayRange(array $array, int $start = 0, ?int $end = null): array
210210
{
211211
if ($start < 0 || $end < 0 || $end < $start) {
212212
throw new OutOfRangeException('Start parameter must be lower than End parameter while both are positive!');
@@ -276,7 +276,7 @@ public function getGroupedOpCodes(): array
276276
*
277277
* @return float Similarity ratio.
278278
*/
279-
public function getSimilarity($method = Similarity::CALC_DEFAULT): float
279+
public function getSimilarity(int $method = Similarity::CALC_DEFAULT): float
280280
{
281281
if ($this->similarity !== null) {
282282
return $this->similarity;

lib/jblond/Diff/DiffUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @author Mario Brandt <[email protected]>
1212
* @copyright (c) 2020 Mario Brandt
1313
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
14-
* @version 2.3.2
14+
* @version 2.3.3
1515
* @link https://github.com/JBlond/php-diff
1616
*/
1717
class DiffUtils

lib/jblond/Diff/Renderer/Html/Merged.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
* @author Ferry Cools <[email protected]>
1515
* @copyright (c) 2020 Ferry Cools
1616
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
17-
* @version 2.3.2
17+
* @version 2.3.3
1818
* @link https://github.com/JBlond/php-diff
1919
*/
2020
class Merged extends MainRenderer implements SubRendererInterface
2121
{
2222
/**
2323
* @var array Associative array containing the default options available for this renderer and their default
2424
* value.
25-
* - format Format of the texts.
25+
* - format The Format of the texts.
2626
* - insertMarkers Markers for inserted text.
2727
* - deleteMarkers Markers for removed text.
2828
* - title1 Title of the 1st version of text.

lib/jblond/Diff/Renderer/Html/SideBySide.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
* @author Ferry Cools <[email protected]>
1919
* @copyright (c) 2009 Chris Boulton
2020
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
21-
* @version 2.3.2
21+
* @version 2.3.3
2222
* @link https://github.com/JBlond/php-diff
2323
*/
2424
class SideBySide extends MainRenderer implements SubRendererInterface
2525
{
2626
/**
2727
* @var array Associative array containing the default options available for this renderer and their default
2828
* value.
29-
* - format Format of the texts.
29+
* - format The Format of the texts.
3030
* - insertMarkers Markers for inserted text.
3131
* - deleteMarkers Markers for removed text.
3232
* - title1 Title of the 1st version of text.

lib/jblond/Diff/Renderer/Html/Unified.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
* @author Ferry Cools <[email protected]>
1919
* @copyright (c) 2009 Chris Boulton
2020
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
21-
* @version 2.3.2
21+
* @version 2.3.3
2222
* @link https://github.com/JBlond/php-diff
2323
*/
2424
class Unified extends MainRenderer implements SubRendererInterface
2525
{
2626
/**
2727
* @var array Associative array containing the default options available for this renderer and their default
2828
* value.
29-
* - format Format of the texts.
29+
* - format The Format of the texts.
3030
* - insertMarkers Markers for inserted text.
3131
* - deleteMarkers Markers for removed text.
3232
* - title1 Title of the 1st version of text.

lib/jblond/Diff/Renderer/MainRenderer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @author Ferry Cools <[email protected]>
1818
* @copyright (c) 2009 Chris Boulton
1919
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
20-
* @version 2.3.2
20+
* @version 2.3.3
2121
* @link https://github.com/JBlond/php-diff
2222
*/
2323
class MainRenderer extends MainRendererAbstract
@@ -136,7 +136,7 @@ protected function renderSequences(): array
136136
foreach ($group as $code) {
137137
[$tag, $startOld, $endOld, $startNew, $endNew] = $code;
138138
/**
139-
* $code is an array describing a op-code which includes:
139+
* $code is an array describing an op-code which includes:
140140
* 0 - The type of tag (as described below) for the op code.
141141
* 1 - The beginning line in the first sequence.
142142
* 2 - The end line in the first sequence.
@@ -373,7 +373,7 @@ private function getOuterChange(string $oldString, string $newString): array
373373
$limit = min(mb_strlen($oldString), mb_strlen($newString));
374374

375375
// Find the position of the first character which is different between old and new.
376-
// Starts at the begin of the strings.
376+
// Starts at the beginning of the strings.
377377
// Stops at the end of the shortest string.
378378
while ($start < $limit && mb_substr($oldString, $start, 1) == mb_substr($newString, $start, 1)) {
379379
++$start;
@@ -397,7 +397,7 @@ private function getOuterChange(string $oldString, string $newString): array
397397

398398
/**
399399
* Helper function that will fill the changes-array for the renderer with default values.
400-
* Every time a operation changes (specified by $tag) , a new element will be appended to this array.
400+
* Every time an operation changes (specified by $tag) , a new element will be appended to this array.
401401
*
402402
* The index of the last element of the array is always returned.
403403
*

lib/jblond/Diff/Renderer/MainRendererAbstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @author Ferry Cools <[email protected]>
1717
* @copyright (c) 2020 Ferry Cools
1818
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
19-
* @version 2.3.2
19+
* @version 2.3.3
2020
* @link https://github.com/JBlond/php-diff
2121
*/
2222
abstract class MainRendererAbstract

0 commit comments

Comments
 (0)