From c41e007b4b62af48218231d6c2275e4c9b975b2e Mon Sep 17 00:00:00 2001
From: Sebastian Bergmann <sb@sebastian-bergmann.de>
Date: Sat, 2 Mar 2024 08:15:17 +0100
Subject: [PATCH] Do not use implicitly nullable parameters and prepare release

---
 ChangeLog.md                             | 7 +++++++
 src/Differ.php                           | 4 ++--
 src/Exception/ConfigurationException.php | 2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 8081b37..10c5452 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -2,6 +2,12 @@
 
 All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
 
+## [5.1.1] - 2024-03-02
+
+### Changed
+
+* Do not use implicitly nullable parameters
+
 ## [5.1.0] - 2023-12-22
 
 ### Added
@@ -124,6 +130,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
 
 * This component is no longer supported on PHP 5.6
 
+[5.1.1]: https://github.com/sebastianbergmann/diff/compare/5.1.0...5.1.1
 [5.1.0]: https://github.com/sebastianbergmann/diff/compare/5.0.3...5.1.0
 [5.0.3]: https://github.com/sebastianbergmann/diff/compare/5.0.2...5.0.3
 [5.0.2]: https://github.com/sebastianbergmann/diff/compare/5.0.1...5.0.2
diff --git a/src/Differ.php b/src/Differ.php
index 19ccf97..801fe02 100644
--- a/src/Differ.php
+++ b/src/Differ.php
@@ -42,14 +42,14 @@ final class Differ
         $this->outputBuilder = $outputBuilder;
     }
 
-    public function diff(array|string $from, array|string $to, LongestCommonSubsequenceCalculator $lcs = null): string
+    public function diff(array|string $from, array|string $to, ?LongestCommonSubsequenceCalculator $lcs = null): string
     {
         $diff = $this->diffToArray($from, $to, $lcs);
 
         return $this->outputBuilder->getDiff($diff);
     }
 
-    public function diffToArray(array|string $from, array|string $to, LongestCommonSubsequenceCalculator $lcs = null): array
+    public function diffToArray(array|string $from, array|string $to, ?LongestCommonSubsequenceCalculator $lcs = null): array
     {
         if (is_string($from)) {
             $from = $this->splitStringByLines($from);
diff --git a/src/Exception/ConfigurationException.php b/src/Exception/ConfigurationException.php
index 6b8c79c..b2abf0c 100644
--- a/src/Exception/ConfigurationException.php
+++ b/src/Exception/ConfigurationException.php
@@ -21,7 +21,7 @@ final class ConfigurationException extends InvalidArgumentException
         string $expected,
         $value,
         int $code = 0,
-        Exception $previous = null
+        ?Exception $previous = null
     ) {
         parent::__construct(
             sprintf(
-- 
GitLab