PHP Iterator Pattern Generator
Generates type-safe, PHP 8.4-compliant Iterator pattern infrastructure for sequential collection access and encapsulation.
This skill simplifies the implementation of the Iterator design pattern within PHP 8.4 projects, specifically those adhering to Domain-Driven Design (DDD) and Clean Architecture principles. It automates the creation of standard iterators, iterable collections, and the necessary interfaces to provide sequential access to aggregate elements without exposing internal representations. By generating boilerplate for traversal logic, filtering, and unit tests, it ensures architectural consistency, adheres to PSR standards, and promotes type-safe code reusability across diverse collection types.
主要功能
01Automates unit test generation for iterator behavior and collection integrity
02Creates type-safe iterable collections for DDD aggregates and value objects
03Enforces standardized naming conventions and architectural file placement
04Provides templates for concrete, filtered, and paginated iterators
05Generates PHP 8.4-compliant \Iterator and \IteratorAggregate implementations
0645 GitHub stars
使用场景
01Standardizing collection traversal across complex Domain-Driven Design projects
02Implementing custom filtering or pagination logic for domain aggregates
03Encapsulating internal data structures while maintaining full foreach compatibility