From ba01945089c3a293b01ba9badc29ad55b106b0bc Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann <sb@sebastian-bergmann.de> Date: Sat, 2 Mar 2024 07:30:58 +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 a6ccfad..e62d8f9 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. +## [4.0.6] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + ## [4.0.5] - 2023-05-07 ### Changed @@ -83,6 +89,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 +[4.0.6]: https://github.com/sebastianbergmann/diff/compare/4.0.5...4.0.6 [4.0.5]: https://github.com/sebastianbergmann/diff/compare/4.0.4...4.0.5 [4.0.4]: https://github.com/sebastianbergmann/diff/compare/4.0.3...4.0.4 [4.0.3]: https://github.com/sebastianbergmann/diff/compare/4.0.2...4.0.3 diff --git a/src/Differ.php b/src/Differ.php index 5a4d9d1..98c7a9b 100644 --- a/src/Differ.php +++ b/src/Differ.php @@ -82,7 +82,7 @@ final class Differ * @param array|string $from * @param array|string $to */ - public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null): string + public function diff($from, $to, ?LongestCommonSubsequenceCalculator $lcs = null): string { $diff = $this->diffToArray( $this->normalizeDiffInput($from), @@ -108,7 +108,7 @@ final class Differ * @param array|string $to * @param LongestCommonSubsequenceCalculator $lcs */ - 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 b767b21..8847a2e 100644 --- a/src/Exception/ConfigurationException.php +++ b/src/Exception/ConfigurationException.php @@ -22,7 +22,7 @@ final class ConfigurationException extends InvalidArgumentException string $expected, $value, int $code = 0, - Exception $previous = null + ?Exception $previous = null ) { parent::__construct( sprintf( -- GitLab