From 98ff311ca519c3aa73ccd3de053bdb377171d7b6 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sat, 2 Mar 2024 07:16:36 +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 e6b8631..d14aadd 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. +## [3.0.6] - 2023-03-02 + +### Changed + +* Do not use implicitly nullable parameters + ## [3.0.5] - 2023-03-01 * No code changes, only updated `.gitattributes` to not export non-essential files. @@ -63,6 +69,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 +[3.0.6]: https://github.com/sebastianbergmann/diff/compare/3.0.5...3.0.6 [3.0.5]: https://github.com/sebastianbergmann/diff/compare/3.0.4...3.0.5 [3.0.4]: https://github.com/sebastianbergmann/diff/compare/3.0.3...3.0.4 [3.0.3]: https://github.com/sebastianbergmann/diff/compare/3.0.2...3.0.3 diff --git a/src/Differ.php b/src/Differ.php index 3c90a5a..74e3144 100644 --- a/src/Differ.php +++ b/src/Differ.php @@ -64,7 +64,7 @@ public function __construct($outputBuilder = null) * * @return string */ - public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null): string + public function diff($from, $to, ?LongestCommonSubsequenceCalculator $lcs = null): string { $diff = $this->diffToArray( $this->normalizeDiffInput($from), @@ -92,7 +92,7 @@ public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null) * * @return array */ - public function diffToArray($from, $to, LongestCommonSubsequenceCalculator $lcs = null): array + public function diffToArray($from, $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 78f16fd..f57ec95 100644 --- a/src/Exception/ConfigurationException.php +++ b/src/Exception/ConfigurationException.php @@ -24,7 +24,7 @@ public function __construct( string $expected, $value, int $code = 0, - \Exception $previous = null + ?\Exception $previous = null ) { parent::__construct( \sprintf(