diff --git a/CHANGELOG.md b/CHANGELOG.md index 29cea5b..1b6b76a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/). +## Unreleased (4.x) + +### Added + +- The `once` method has been added to the server repository interface. This previously existed on the concrete class, + but has now been added to the interface. + ## Unreleased ## [3.3.0] - 2023-11-08 diff --git a/src/Contracts/Server/Repository.php b/src/Contracts/Server/Repository.php index 10298dc..b5bbeae 100644 --- a/src/Contracts/Server/Repository.php +++ b/src/Contracts/Server/Repository.php @@ -21,12 +21,24 @@ interface Repository { - /** * Retrieve the named server. * + * This method MAY use thread-caching to optimise performance + * where multiple servers may be used. + * * @param string $name * @return Server */ public function server(string $name): Server; + + /** + * Retrieve the named server, to use once. + * + * This method MUST NOT use thread-caching. + * + * @param string $name + * @return Server + */ + public function once(string $name): Server; } diff --git a/src/Core/Server/ServerRepository.php b/src/Core/Server/ServerRepository.php index 9099779..ce10b64 100644 --- a/src/Core/Server/ServerRepository.php +++ b/src/Core/Server/ServerRepository.php @@ -62,11 +62,7 @@ public function server(string $name): ServerContract } /** - * Use a server once, without thread-caching it. - * - * @param string $name - * @return ServerContract - * TODO add to interface + * @inheritDoc */ public function once(string $name): ServerContract {