diff --git a/CHANGELOG.md b/CHANGELOG.md index 86e2335..7c9b2c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ 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 (#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 d6349c5..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. @@ -15,9 +14,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 ContainerInterface 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. */ 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. */