Download the PHP package tijmenwierenga/repositories without Composer
On this page you can find all versions of the php package tijmenwierenga/repositories. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tijmenwierenga/repositories
More information about tijmenwierenga/repositories
Files in tijmenwierenga/repositories
Package repositories
Short Description A set of utilities to create repositories with superpowers.
License MIT
Informations about the package repositories
Repository utilities for PHP applications
The in-memory repository
The TijmenWierenga\Repositories\InMemoryRepository is a simple array-based storage that performs persistence related actions.
all(): T[]
Returns all items stored in the repository.
find(Closure $criteria): T|null
Returns the first item that matches the criteria. Returns null is no match is found
findMany(Closure $criteria): T[]
Returns all items that match the criteria.
add(T $item): void
Adds a new item to the collection.
remove(Closure $criteria): void
Removes all items from the collection that match the criteria.
first(): T|null
Returns the first item in the collection. Returns null is the collection is empty.
last(): T|null
Returns the last item in the collection. Returns null is the collection is empty.
map(Closure $function): U
Returns a new repository instance based on the returned values of the closure.