fast-forward/enum is a standalone PHP 8.3+ library for enum ergonomics and reusable enum catalogs in the Fast Forward ecosystem.
The public surface is centered on:
src/Trait/for reusable enum traits such asHasValues,HasNames,HasLabel,HasDescription, andComparablesrc/Helper/EnumHelper.phpfor generic static helpers overUnitEnumandBackedEnum- root public interfaces such as
LabeledEnumInterface,DescribedEnumInterface, andReversibleInterface - focused domain namespaces such as
Calendar/,Common/,Sort/,Logger/,Runtime/,DateTime/,Comparison/,Outcome/,Http/,Process/,Event/,Container/, andPipeline/ src/StateMachine/for enum-based workflow transitions
Keep new public API small, explicit, and framework-agnostic. Avoid vague “bucket” namespaces when a more specific domain namespace fits.
Install dependencies with:
composer installThis package uses fast-forward/dev-tools as a dev dependency and inherits its test and repo-maintenance workflows.
Use these commands for minimum local validation:
./vendor/bin/dev-tools tests
composer dump-autoloadThe PHPUnit config comes from vendor/fast-forward/dev-tools/phpunit.xml, so do not recreate a local phpunit.xml.dist unless there is a very strong reason.
Use broader checks when the change touches those surfaces:
./vendor/bin/dev-tools standards
./vendor/bin/dev-tools phpdoc
./vendor/bin/dev-tools docs
./vendor/bin/dev-tools dependencies
./vendor/bin/dev-tools changelog:checkUse ./vendor/bin/dev-tools wiki only when wiki output or wiki-related docs need to be regenerated.
The current dev-tools version in this repo has known issues:
./vendor/bin/dev-tools --fixcompletes, but may emit noisy Composer plugin errors related to Symfony Console command discovery.composer agentsis not a reliable entrypoint in this checkout; prefer./vendor/bin/dev-tools agentsand./vendor/bin/dev-tools skillswhen synchronizing those assets../vendor/bin/dev-tools dev-tools:sync --overwrite --no-interactioncan fail when copying Git hooks into.git/hooksbecause of permissions.
If you need to format or refactor code, prefer small, targeted edits and re-run the test commands above.
Packaged project-agent prompts live in .agents/agents/. They are synchronized from fast-forward/dev-tools as relative symlinks into vendor/, so they are expected to resolve after composer install. Do not replace those links with absolute paths or local copies unless the task explicitly requires changing the packaging model.
Available agents:
agents-maintainerkeepsAGENTS.mdaligned with the current repository workflows, packaged skills, and agent surface.docs-writermaintains the Sphinx documentation tree underdocs/.readme-maintainerkeepsREADME.mdaligned with the public package surface, install flow, badges, links, and onboarding examples.test-guardianaudits and extends PHPUnit coverage.php-style-curatornormalizes PHP headers, PHPDoc, imports, and style without changing behavior.quality-pipeline-auditorchecks test, style, docs, CI, and generated-output risk across the quality pipeline.review-guardianperforms findings-first review passes for bugs, regressions, missing docs, missing tests, and workflow risk.consumer-sync-auditorreviews downstream impact for synchronized DevTools assets, workflow wrappers, wiki/bootstrap files, packaged agents, and packaged skills.changelog-maintainermaintains Keep a Changelog entries and release-note material.issue-editorturns rough maintenance, bug, or feature requests into implementation-ready GitHub issues.issue-implementercarries ready issues through implementation, verification, and PR publication.
When delegating, read the matching prompt in .agents/agents/<agent>.md and keep the assignment narrow. Agent prompts define role boundaries; procedural steps still come from .agents/skills/.
Important paths:
src/main library codetests/PHPUnit suitetests/Support/enum fixtures used across testsREADME.mdpackage onboarding and usage examplesdocs/Sphinx documentation for installation, quickstart, usage, API references, and advanced integration notes.github/wiki/generated wiki content used by wiki workflows.agents/agents/packaged role prompts for repository-specific delegation.agents/skills/procedural skills used by the packaged agents.github/workflows/CI workflows managed bydev-tools
The current test layout is intentionally split by concern:
tests/Common/tests/Sort/tests/StateMachine/tests/Helper/tests/Trait/tests/Support/tests/DomainEnumTest.phpfor smaller domain namespaces
When adding tests, keep them close to the namespace or feature they exercise instead of rebuilding monolithic test files.
Follow existing Fast Forward PHP conventions:
- keep
declare(strict_types=1); - preserve the repository file header block
- keep PHPDoc in English
- prefer precise namespace names over catch-all buckets
- keep interfaces in the root namespace when they are part of the public package surface
- do not introduce framework dependencies
- avoid reflection-heavy or attribute-heavy abstractions unless there is already an established pattern
For enum design:
- prefer methods that express behavior, not just metadata duplication
- avoid enums that encode framework- or PSR-specific runtime policies unless they stay useful in a raw, non-opinionated consumer
- do not call something a polyfill unless it truly mirrors native behavior and loading semantics
For any code change:
- run
composer dump-autoloadif files or namespaces changed - run
./vendor/bin/dev-tools tests
When reorganizing namespaces, verify both autoload and test imports before finalizing.
Any meaningful API or namespace change should be reflected in:
README.mddocs/CHANGELOG.mdonce release tracking is initialized- tests with real usage examples
Prefer onboarding-friendly examples for new users. Show practical enum calls instead of only listing cases.
Use README.md as the canonical short-form package guide and expand from there into Sphinx docs rather than duplicating content blindly. For new-user documentation, explain what each helper or enum catalog solves, then show the smallest useful example.
When wiki output is part of the task, update .github/wiki/ through the supported dev-tools wiki command instead of hand-editing generated pages.
This repository may already contain uncommitted work. Check git status before editing and do not revert unrelated changes.
When changing public API:
- preserve the package’s framework-agnostic posture
- keep naming coherent across namespaces
- update tests and README in the same pass
When opening repo-maintenance issues against dev-tools, prefer separate issues per bug instead of mixing unrelated failures into one report.