From 7e4a272cbd2c09ca281acbc0093cd37048b63c61 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Sat, 21 Sep 2024 23:14:15 +0200 Subject: [PATCH 1/3] Fix absent return typehint This is a non-breaking change according to spec, as the PHPDoc already had the right type. However, the formal PHP return typehint has become narrower, which may cause BC problems. Therefore, this is to be considered a BC-breaking change. --- CHANGELOG.md | 2 ++ src/MapFactoryInterface.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cc5c51..fbfc274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [[*next-version*]] - YYYY-MM-DD +### Fixed +- Absence of return typehint for `MapFactoryInterface` (#32). ## [0.4.0-alpha1] - 2024-09-21 ### Added diff --git a/src/MapFactoryInterface.php b/src/MapFactoryInterface.php index ddcefbd..4d549ae 100644 --- a/src/MapFactoryInterface.php +++ b/src/MapFactoryInterface.php @@ -23,5 +23,5 @@ interface MapFactoryInterface extends ContainerFactoryInterface * * @throws Exception If problem creating. */ - public function createContainerFromArray(array $data): BaseContainerInterface; + public function createContainerFromArray(array $data): MapInterface; } From 1a029413cce2cc95c2960f73598748869f550e5c Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Sat, 21 Sep 2024 23:17:37 +0200 Subject: [PATCH 2/3] Remove unused import --- src/MapFactoryInterface.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/MapFactoryInterface.php b/src/MapFactoryInterface.php index 4d549ae..36c1b82 100644 --- a/src/MapFactoryInterface.php +++ b/src/MapFactoryInterface.php @@ -5,7 +5,6 @@ namespace Dhii\Collection; use Exception; -use Psr\Container\ContainerInterface as BaseContainerInterface; /** * A factory that can create maps. From 7692c37913761e98e9081b90ce1380261ea1f3b5 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Sat, 21 Sep 2024 23:22:27 +0200 Subject: [PATCH 3/3] Correct return typehint --- CHANGELOG.md | 3 ++- src/WritableMapFactoryInterface.php | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbfc274..9948690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [[*next-version*]] - YYYY-MM-DD ### Fixed -- Absence of return typehint for `MapFactoryInterface` (#32). +- Wrong return typehint for `MapFactoryInterface` + and `WritableMapFactoryInterface` (#32). ## [0.4.0-alpha1] - 2024-09-21 ### Added diff --git a/src/WritableMapFactoryInterface.php b/src/WritableMapFactoryInterface.php index 1a0c512..f7ce286 100644 --- a/src/WritableMapFactoryInterface.php +++ b/src/WritableMapFactoryInterface.php @@ -4,8 +4,6 @@ namespace Dhii\Collection; -use Psr\Container\ContainerInterface as BaseContainerInterface; - /** * Creates writable maps. * @@ -18,5 +16,5 @@ interface WritableMapFactoryInterface extends WritableContainerFactoryInterface, * * @return WritableMapInterface The new map. */ - public function createContainerFromArray(array $data): BaseContainerInterface; + public function createContainerFromArray(array $data): WritableMapInterface; }