Download the PHP package tourze/yield-breakable-caller without Composer
On this page you can find all versions of the php package tourze/yield-breakable-caller. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tourze/yield-breakable-caller
More information about tourze/yield-breakable-caller
Files in tourze/yield-breakable-caller
Download tourze/yield-breakable-caller
More information about tourze/yield-breakable-caller
Files in tourze/yield-breakable-caller
Vendor tourze
Package yield-breakable-caller
Short Description BreakableCaller, using Yield
License MIT
Package yield-breakable-caller
Short Description BreakableCaller, using Yield
License MIT
Please rate this library. Is it a good library?
Informations about the package yield-breakable-caller
YieldBreakableCaller
中文
A lightweight PHP library for breakable step-by-step task execution using Generators (yield). Allows interruption of task flow at any step based on custom conditions.
Features
- Step-by-step task execution based on PHP Generator (yield)
- Interrupt task flow at any step by custom logic
- Simple, dependency-free implementation
- Suitable for scenarios requiring controllable breakpoints in process
Installation
- Requires PHP >= 8.1
- Install via Composer:
Quick Start
Output:
Documentation
Core API
BreakableCaller::invoke(callable $callback, callable $shouldNext): void
$callback: A function returning a generator$shouldNext: A callback to determine whether to continue after each step
Behavior
- After each
yield,$shouldNextis evaluated. If it returnsfalse, all subsequent steps are interrupted. - Supports empty generators, single-yield generators, and will throw if callback does not return a generator.
Contributing
We welcome contributions to improve this library. Please follow these guidelines:
- Submit issues for bugs or feature requests
- Follow PSR coding standards
- Write tests for new features
- Update documentation when needed
Development
- Clone the repository
- Install dependencies:
composer install - Run tests:
composer testorvendor/bin/phpunit - Run static analysis:
composer phpstanorvendor/bin/phpstan analyse
License
This library is licensed under the MIT License. See the LICENSE file for details.
Changelog
See CHANGELOG.md for version history and updates (if available).
All versions of yield-breakable-caller with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package tourze/yield-breakable-caller contains the following files
Loading the files please wait ...