Skip to content

Commit 7e5890f

Browse files
committed
Add documentation for container compilation feature, including usage and CLI reference
1 parent 6b76ad4 commit 7e5890f

3 files changed

Lines changed: 916 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ All Notable changes to `League\Container` will be documented in this file
55
## Unreleased (6.0.0)
66

77
### Added
8+
- **Container compilation** - compile a bootstrapped container into a standalone PHP class implementing PSR-11 `ContainerInterface`, eliminating reflection and definition resolution at runtime (#279)
9+
- `Compiler` entry point with `compile()` and `isStale()` methods
10+
- `DefinitionAnalyser` for inspecting definitions, classifying types, resolving autowiring, and building the dependency graph
11+
- `CodeGenerator` for producing compiled PHP source via string templating (zero new dependencies)
12+
- `ArgumentCompiler` for converting argument descriptors to PHP code expressions
13+
- `DependencyGraph` with cycle detection (DFS with visited/in-stack colouring) and topological ordering
14+
- Value objects: `CompiledDefinition`, `CompilationConfig`, `CompilationResult`, `AnalysisResult`, `ConcreteType` enum
15+
- `CompilationException` with structured errors (service ID, error type, message, suggested fix)
16+
- `ContainerFactory` for switching between compiled and dynamic containers based on environment
17+
- `bin/container-compile` CLI binary with `--input`, `--output`, `--class`, `--namespace`, `--check`, `--dry-run` options
18+
- `ServiceProviderAggregateInterface::registerAll()` for force-registering all lazy providers before compilation
19+
- Pre-flight validation collecting all errors before failing, with actionable suggested fixes
20+
- SHA-256 source hash for staleness detection based on normalised definition state
821
- PHP 8.5 support (first-class CI target)
922
- Typed class constants throughout (`ReflectionContainer`, `LiteralArgument`, `DependencyGraph`)
1023
- `#[\Override]` attribute on all interface implementations and trait methods

0 commit comments

Comments
 (0)