Skip to content

Commit 3b93f79

Browse files
authored
Merge pull request #47 from JBlond/phpdoc-update
update doc
2 parents fbea75e + 8555fdd commit 3b93f79

12 files changed

+96
-94
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ modification, are permitted provided that the following conditions are met:
1212
- Redistributions in binary form must reproduce the above copyright notice,
1313
this list of conditions and the following disclaimer in the documentation
1414
and/or other materials provided with the distribution.
15-
- Neither the name of the Chris Boulton nor the names of its contributors
15+
- Neither the name of the Mario Brandt nor the names of its contributors
1616
may be used to endorse or promote products derived from this software
1717
without specific prior written permission.
1818

lib/jblond/Diff.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
*
2222
* PHP version 7.2 or greater
2323
*
24-
* @package jblond
25-
* @author Chris Boulton <[email protected]>
26-
* @author Mario Brandt <[email protected]>
27-
* @author Ferry Cools <[email protected]>
28-
* @copyright (c) 2009 Chris Boulton
29-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
30-
* @version 2.0.0
31-
* @link https://github.com/JBlond/php-diff
24+
* @package jblond
25+
* @author Chris Boulton <[email protected]>
26+
* @author Mario Brandt <[email protected]>
27+
* @author Ferry Cools <[email protected]>
28+
* @copyright (c) 2020 Mario Brandt
29+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
30+
* @version 2.1.0
31+
* @link https://github.com/JBlond/php-diff
3232
*/
3333
class Diff
3434
{
@@ -50,8 +50,9 @@ class Diff
5050
private $groupedCodes;
5151

5252
/**
53-
* @var array Associative array containing the default options available for the diff class and their default
54-
* value.
53+
* @var array<string, string> Associative array containing the default options available
54+
* for the diff class and their default value.
55+
*
5556
* - context The amount of lines to include around blocks that differ.
5657
* - trimEqual Strip blocks of equal lines from the start and end of the text.
5758
* - ignoreWhitespace When true, tabs and spaces are ignored while comparing.
@@ -111,8 +112,8 @@ public function __construct($version1, $version2, array $options = [])
111112
*
112113
* @param mixed $var Variable to get type from.
113114
*
114-
* @return int Number indicating the type of the variable. 0 for array type and 1 for string type.
115-
* @throws InvalidArgumentException When the type isn't 'array' or 'string'.
115+
* @return int Number indicating the type of the variable. 0 for array type and 1 for string type.
116+
* @throws InvalidArgumentException When the type isn't 'array' or 'string'.
116117
*
117118
*/
118119
public function getArgumentType($var): int

lib/jblond/Diff/DiffUtils.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
*
88
* PHP version 7.2 or greater
99
*
10-
* @package jblond\Diff
11-
* @author Mario Brandt <[email protected]>
12-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
13-
* @version 2.0.0
14-
* @link https://github.com/JBlond/php-diff
10+
* @package jblond\Diff
11+
* @author Mario Brandt <[email protected]>
12+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
13+
* @version 2.1.0
14+
* @link https://github.com/JBlond/php-diff
1515
*/
1616
class DiffUtils
1717
{

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@
1111
*
1212
* PHP version 7.2 or greater
1313
*
14-
* @package jblond\Diff\Renderer\Html
15-
* @author Chris Boulton <[email protected]>
16-
* @author Mario Brandt <[email protected]>
17-
* @author Ferry Cools <[email protected]>
18-
* @copyright (c) 2009 Chris Boulton
19-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
20-
* @version 2.0.0
21-
* @link https://github.com/JBlond/php-diff
14+
* @package jblond\Diff\Renderer\Html
15+
* @author Chris Boulton <[email protected]>
16+
* @author Mario Brandt <[email protected]>
17+
* @author Ferry Cools <[email protected]>
18+
* @copyright (c) 2020 Mario Brandt
19+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
20+
* @version 2.1.0
21+
* @link https://github.com/JBlond/php-diff
2222
*/
2323
class HtmlArray extends RendererAbstract
2424
{
2525
/**
26-
* @var array Associative array containing the default options available for this renderer and their default
27-
* value.
26+
* @var array<string, string> Associative array containing the default options available
27+
* for this renderer and their default value.
28+
*
2829
* - tabSize The amount of spaces to replace a tab character with.
2930
* - title_a Title of the "old" version of text.
3031
* - title_b Title of the "new" version of text.
@@ -46,7 +47,7 @@ class HtmlArray extends RendererAbstract
4647
*
4748
* This method is called by the renderers which extends this class.
4849
*
49-
* @param array $changes Contains the op-codes about the differences between "old and "new".
50+
* @param array $changes Contains the op-codes about the differences between "old and "new".
5051
* @param object|Inline|SideBySide|Unified $htmlRenderer Renderer which extends this class.
5152
*
5253
* @return string HTML representation of the differences.

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
*
1010
* PHP version 7.2 or greater
1111
*
12-
* @package jblond\Diff\Renderer\Html
13-
* @author Chris Boulton <[email protected]>
14-
* @author Mario Brandt <[email protected]>
15-
* @author Ferry Cools <[email protected]>
16-
* @copyright (c) 2009 Chris Boulton
17-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
18-
* @version 2.0.0
19-
* @link https://github.com/JBlond/php-diff
12+
* @package jblond\Diff\Renderer\Html
13+
* @author Chris Boulton <[email protected]>
14+
* @author Mario Brandt <[email protected]>
15+
* @author Ferry Cools <[email protected]>
16+
* @copyright (c) 2020 Mario Brandt
17+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
18+
* @version 2.1.0
19+
* @link https://github.com/JBlond/php-diff
2020
*/
2121
class Inline extends HtmlArray
2222
{

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
*
1010
* PHP version 7.2 or greater
1111
*
12-
* @package jblond\Diff\Renderer\Html
13-
* @author Chris Boulton <[email protected]>
14-
* @author Mario Brandt <[email protected]>
15-
* @author Ferry Cools <[email protected]>
16-
* @copyright (c) 2009 Chris Boulton
17-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
18-
* @version 2.0.0
19-
* @link https://github.com/JBlond/php-diff
12+
* @package jblond\Diff\Renderer\Html
13+
* @author Chris Boulton <[email protected]>
14+
* @author Mario Brandt <[email protected]>
15+
* @author Ferry Cools <[email protected]>
16+
* @copyright (c) 2009 Chris Boulton
17+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
18+
* @version 2.1.0
19+
* @link https://github.com/JBlond/php-diff
2020
*/
2121
class SideBySide extends HtmlArray
2222
{

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
* PHP version 7.2 or greater
1111
*
1212
* @package jblond\Diff\Renderer\Html
13-
* @author Mario Brandt <[email protected]>
13+
* @author Mario Brandt <[email protected]>
1414
* @author Ferry Cools <[email protected]>
15-
* @copyright (c) 2009 Chris Boulton
15+
* @copyright (c) 2020 Mario Brandt
1616
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
17-
* @version 2.0.0
17+
* @version 2.1.0
1818
* @link https://github.com/JBlond/php-diff
1919
*/
2020
class Unified extends HtmlArray

lib/jblond/Diff/Renderer/RendererAbstract.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
*
1212
* PHP version 7.2 or greater
1313
*
14-
* @package jblond\Diff\Renderer
15-
* @author Chris Boulton <[email protected]>
16-
* @author Mario Brandt <[email protected]>
17-
* @author Ferry Cools <[email protected]>
18-
* @copyright (c) 2009 Chris Boulton
19-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
20-
* @version 2.0.0
21-
* @link https://github.com/JBlond/php-diff
14+
* @package jblond\Diff\Renderer
15+
* @author Chris Boulton <[email protected]>
16+
* @author Mario Brandt <[email protected]>
17+
* @author Ferry Cools <[email protected]>
18+
* @copyright (c) 2020 Mario Brandt
19+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
20+
* @version 2.1.0
21+
* @link https://github.com/JBlond/php-diff
2222
*/
2323
abstract class RendererAbstract
2424
{
@@ -29,15 +29,15 @@ abstract class RendererAbstract
2929
public $diff;
3030

3131
/**
32-
* @var array Array of the default options that apply to this renderer.
32+
* @var array<string, string> Array of the default options that apply to this renderer.
3333
*/
3434
protected $defaultOptions = [
3535
'title1' => 'Version1',
3636
'title2' => 'Version2',
3737
];
3838

3939
/**
40-
* @var array Array containing the user applied and merged default options for the renderer.
40+
* @var array<string, string> Array containing the user applied and merged default options for the renderer.
4141
*/
4242
protected $options = [];
4343

@@ -57,7 +57,7 @@ public function __construct(array $options = [])
5757
* Options are merged with the default to ensure that there aren't any missing
5858
* options.
5959
*
60-
* @param array $options Array of options to set.
60+
* @param array<string, string> $options Array of options to set.
6161
*/
6262
public function setOptions(array $options)
6363
{

lib/jblond/Diff/Renderer/Text/Context.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
*
1212
* PHP version 7.2 or greater
1313
*
14-
* @package jblond\Diff\Renderer\Text
15-
* @author Chris Boulton <[email protected]>
16-
* @author Mario Brandt <[email protected]>
17-
* @author Ferry Cools <[email protected]>
18-
* @copyright (c) 2009 Chris Boulton
19-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
20-
* @version 2.0.0
21-
* @link https://github.com/JBlond/php-diff
14+
* @package jblond\Diff\Renderer\Text
15+
* @author Chris Boulton <[email protected]>
16+
* @author Mario Brandt <[email protected]>
17+
* @author Ferry Cools <[email protected]>
18+
* @copyright (c) 2009 Chris Boulton
19+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
20+
* @version 2.1.0
21+
* @link https://github.com/JBlond/php-diff
2222
*/
2323
class Context extends RendererAbstract
2424
{

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
*
1212
* PHP version 7.2 or greater
1313
*
14-
* @package jblond\Diff\Renderer\Text
15-
* @author Chris Boulton <[email protected]>
16-
* @author Mario Brandt <[email protected]>
17-
* @copyright (c) 2009 Chris Boulton
18-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
19-
* @version 2.0.0
20-
* @link https://github.com/JBlond/php-diff
14+
* @package jblond\Diff\Renderer\Text
15+
* @author Chris Boulton <[email protected]>
16+
* @author Mario Brandt <[email protected]>
17+
* @copyright (c) 2020 Mario Brandt
18+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
19+
* @version 2.1.0
20+
* @link https://github.com/JBlond/php-diff
2121
*/
2222

2323
/**

lib/jblond/Diff/Renderer/Text/UnifiedCli.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
*
1313
* PHP version 7.2 or greater
1414
*
15-
* @package jblond\Diff\Renderer\Text
16-
* @author Mario Brandt <[email protected]>
17-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
18-
* @version 2.0.0
19-
* @link https://github.com/JBlond/php-diff
15+
* @package jblond\Diff\Renderer\Text
16+
* @author Mario Brandt <[email protected]>
17+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
18+
* @version 2.1.0
19+
* @link https://github.com/JBlond/php-diff
2020
*/
2121

2222
class UnifiedCli extends RendererAbstract
@@ -34,7 +34,7 @@ class UnifiedCli extends RendererAbstract
3434

3535
/**
3636
* UnifiedCli constructor.
37-
* @param array $options
37+
* @param array<string, string> $options
3838
*/
3939
public function __construct(array $options = [])
4040
{
@@ -62,11 +62,11 @@ public function render(): string
6262

6363

6464
/**
65-
* @param $string
65+
* @param string $string
6666
* @param string $color
6767
* @return string
6868
*/
69-
private function colorizeString($string, $color = ''): string
69+
private function colorizeString(string $string, string $color = ''): string
7070
{
7171
if (isset($this->options['cliColor']) && $this->options['cliColor'] == 'simple') {
7272
return $this->colors->getColoredString($string, $color);

lib/jblond/Diff/SequenceMatcher.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
*
1212
* PHP version 7.2 or greater
1313
*
14-
* @package jblond\Diff
15-
* @author Chris Boulton <[email protected]>
16-
* @author Mario Brandt <[email protected]>
17-
* @author Ferry Cools <[email protected]>
18-
* @copyright (c) 2009 Chris Boulton
19-
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
20-
* @version 2.0.0
21-
* @link https://github.com/JBlond/php-diff
14+
* @package jblond\Diff
15+
* @author Chris Boulton <[email protected]>
16+
* @author Mario Brandt <[email protected]>
17+
* @author Ferry Cools <[email protected]>
18+
* @copyright (c) 2020 Mario Brandt
19+
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
20+
* @version 2.1.0
21+
* @link https://github.com/JBlond/php-diff
2222
*/
2323
class SequenceMatcher
2424
{
@@ -79,9 +79,9 @@ class SequenceMatcher
7979
* sequence matcher and it will perform a basic cleanup & calculate junk
8080
* elements.
8181
*
82-
* @param string|array $old A string or array containing the lines to compare against.
83-
* @param string|array $new A string or array containing the lines to compare.
84-
* @param array $options
82+
* @param string|array $old A string or array containing the lines to compare against.
83+
* @param string|array $new A string or array containing the lines to compare.
84+
* @param array $options
8585
* @param string|array|null $junkCallback Either an array or string that references a callback function
8686
* (if there is one) to determine 'junk' characters.
8787
*/
@@ -212,7 +212,7 @@ private function chainB()
212212
* for the list of junk characters.
213213
*
214214
* @param string $bString
215-
* @return bool $b True if the character is considered junk. False if not.
215+
* @return bool True if the character is considered junk. False if not.
216216
*/
217217
private function isBJunk(string $bString): bool
218218
{

0 commit comments

Comments
 (0)