From ab9c9862a7c9f5dd060b02f59b5bf4d41d0a354d Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Wed, 25 Mar 2026 21:44:01 +0100 Subject: [PATCH 1/5] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86e2335..d00c90c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Aligned param names with those of PSR interfaces (#37). - Added more generics (#38). +- Added `mixed` typehints where missing ## [0.5.0-beta1] - 2026-03-23 ### Changed From 6a88d4a459f8e48d68db630e22fa213fe9ad4518 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Wed, 25 Mar 2026 21:44:06 +0100 Subject: [PATCH 2/5] Add generics --- src/ContainerFactoryInterface.php | 7 +++++-- src/MapFactoryInterface.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ContainerFactoryInterface.php b/src/ContainerFactoryInterface.php index d6349c5..8feea99 100644 --- a/src/ContainerFactoryInterface.php +++ b/src/ContainerFactoryInterface.php @@ -15,9 +15,12 @@ interface ContainerFactoryInterface /** * Creates a container based on data. * - * @param array $data The data for the container. + * @template K of string + * @template V of mixed * - * @return ContainerInterface The new container. + * @param array $data The data for the container. + * + * @return WritableContainerInterface The new container. * * @throws Exception If problem creating. * diff --git a/src/MapFactoryInterface.php b/src/MapFactoryInterface.php index 816436f..dc21463 100644 --- a/src/MapFactoryInterface.php +++ b/src/MapFactoryInterface.php @@ -16,9 +16,12 @@ interface MapFactoryInterface extends ContainerFactoryInterface /** * Creates a map based on data in an array. * - * @param array $data The data to base the map on. + * @template K of string + * @template V of mixed * - * @return MapInterface The new map. + * @param array $data The data for the container. + * + * @return MapInterface The new container. * * @throws Exception If problem creating. */ From 6f7a46338e0d516d251c803a867a0b9d887eccf9 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Wed, 25 Mar 2026 22:04:17 +0100 Subject: [PATCH 3/5] Fix return type mismatch --- src/ContainerFactoryInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ContainerFactoryInterface.php b/src/ContainerFactoryInterface.php index 8feea99..5d82497 100644 --- a/src/ContainerFactoryInterface.php +++ b/src/ContainerFactoryInterface.php @@ -20,7 +20,7 @@ interface ContainerFactoryInterface * * @param array $data The data for the container. * - * @return WritableContainerInterface The new container. + * @return ContainerInterface The new container. * * @throws Exception If problem creating. * From 4ad17ee977acf3ba8b962be3e97df09f2a681aa5 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Wed, 25 Mar 2026 22:54:24 +0100 Subject: [PATCH 4/5] Add missing PR number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d00c90c..54a8203 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Aligned param names with those of PSR interfaces (#37). - Added more generics (#38). -- Added `mixed` typehints where missing +- Added `mixed` typehints where missing (#38). ## [0.5.0-beta1] - 2026-03-23 ### Changed From 4cc3dc1c3164e01b68d73f6d8beb41761295d92f Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Wed, 25 Mar 2026 22:56:23 +0100 Subject: [PATCH 5/5] Container factories now return Dhii `ContainerInterface` --- CHANGELOG.md | 2 ++ src/ContainerFactoryInterface.php | 1 - src/WritableContainerFactoryInterface.php | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54a8203..7c9b2c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Aligned param names with those of PSR interfaces (#37). - Added more generics (#38). - Added `mixed` typehints where missing (#38). +- Factories now return Dhii `ContainerInterface` (#39). + A small inconvenience for type safety. ## [0.5.0-beta1] - 2026-03-23 ### Changed diff --git a/src/ContainerFactoryInterface.php b/src/ContainerFactoryInterface.php index 5d82497..656b421 100644 --- a/src/ContainerFactoryInterface.php +++ b/src/ContainerFactoryInterface.php @@ -5,7 +5,6 @@ namespace Dhii\Collection; use Exception; -use Psr\Container\ContainerInterface; /** * Creates containers based on data maps. diff --git a/src/WritableContainerFactoryInterface.php b/src/WritableContainerFactoryInterface.php index 364ea17..bbc1ff8 100644 --- a/src/WritableContainerFactoryInterface.php +++ b/src/WritableContainerFactoryInterface.php @@ -4,8 +4,6 @@ namespace Dhii\Collection; -use Psr\Container\ContainerInterface; - /** * A map that can create a writable container. */