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 */
3030class 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 ;
0 commit comments