svensp / callection
Track 'current' items for stacked closure calls
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/svensp/callection
Requires (Dev)
- phpunit/phpunit: ^9.3
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-09-22 19:45:32 UTC
README
nested callable collection helps you keep track of 'something' that is used by callables like closures.
There are 2 componentes to this
- a stack keeping track of the 'current' item
- a collection, saving the items by name or index of appearance
Install
nested-callable-collection is installed via composer
composer require svensp/nested-callable-collection
Use case
The idea behind nested-callable-collection is to support the following way of defining the world in a unit test:
$this->asUser(function() { $this->withGame(function() { $this->withUser(function() { $this->withUnit(); }); $this->withUser(); }); });