event-engine/php-engine-utils
Utilities for Event Engine in PHP: helper classes and shared tooling to simplify building and running Event Engine-based applications. Includes common infrastructure utilities and convenience functions to reduce boilerplate in your event-driven domain code.
MapIterator) that abstract common traversal/transformation patterns, aligning well with Laravel’s dependency injection (DI) and service container paradigms. These utilities could reduce boilerplate in event-driven workflows (e.g., queue jobs, observers, or custom event listeners) where data transformation or iteration is required.Traversable, Generator, IteratorAggregate) without manual checks for valid()/rewind().Bus or event dispatching systems.foreach loops with MapIterator for side-effectful transformations.Traversable from a database cursor) with built-in error handling.MapIterator type changes in v0.1.2) suggest cautious adoption. A TPM should:
Traversable usage patterns.Illuminate\Support\Collection) to ensure compatibility.MapIterator refactor (v0.1.1+) uses foreach + yield, which may introduce memory overhead for large datasets. Benchmark against native PHP iterators.roave/security-advisories in dev dependencies).Collection::map() vs. MapIterator for side effects.IteratorAggregate implementations in Laravel vs. this package’s utilities.foreach loops with MapIterator?Illuminate\Database\Eloquent\Collection or Illuminate\Pagination\LengthAwarePaginator.MapIterator in Handle methods for event payloads.Traversable results from database cursors (e.g., DB::cursor()).MapIterator for large datasets.foreach loops with MapIterator where side effects are needed.EventEngine::mapIterator($traversable, $callback)).pluck(), filter()).MapIterator works with Collection instances (implements Traversable).Collection::pipe() or tap().DB::cursor() or Eloquent cursors.IteratorAggregate (e.g., spatie/array-to-object).composer.json and validate basic functionality.MapIterator.MapIterator for side-effectful transformations").MapIterator).MapIterator’s foreach + yield approach may not be optimal for very large datasets (e.g., millions of rows). Test with Laravel’s chunking or cursor-based pagination.MapIterator cannot rewind (by design). Document this to avoid bugs in loops expecting rewinding.fail() method.MapIterator simplifies complex transformations.foreach, Collection::map(), and MapIterator for side effects.Collection::map() for pure transformations).How can I help you explore Laravel packages today?