Skip to content

Commit

Permalink
feat: add once method to server repository interface
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Nov 8, 2023
1 parent 5ddbcf2 commit a1bfe3b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion src/Contracts/Server/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
6 changes: 1 addition & 5 deletions src/Core/Server/ServerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit a1bfe3b

Please sign in to comment.