This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
composer test # Run all PHPUnit tests
vendor/bin/phpunit # Direct PHPUnit execution
vendor/bin/phpunit tests/KernelTest.php # Run specific test filecomposer psalm # Run static analysis with Psalm
composer cs-check # Check code style with PHP-CS-Fixer
composer cs-fix # Fix code style issues
composer analyze # Run both psalm and cs-checkcomposer benchmark # Run all performance benchmarks
composer benchmark-kernel # Run kernel-specific benchmarks
composer benchmark-middleware # Run middleware-specific benchmarks
php benchmarks/run-benchmarks.php # Direct benchmark executionThis is a high-performance HTTP kernel library built around compile-time middleware optimization. The core principle is to compile middleware stacks once at boot time for zero runtime overhead.
- Kernel (
src/Kernel.php) - Main entry point that compiles middleware pipeline once at construction - MiddlewareStack (
src/MiddlewareStack.php) - Manages middleware collection and compilation into optimized pipeline - OptimizedMiddlewareHandler (
src/OptimizedMiddlewareHandler.php) - Runtime handler for executing compiled middleware - Performance Decorators:
- PerformanceKernel (
src/PerformanceKernel.php) - Measures request processing metrics - CircuitBreakerKernel (
src/CircuitBreakerKernel.php) - Implements circuit breaker pattern
- PerformanceKernel (
- Compile-time optimization: Middleware pipeline is built once at boot, not per request
- Zero-overhead execution: Compiled pipeline executes without runtime reflection or middleware resolution
- PSR compliance: Full PSR-7, PSR-11, and PSR-15 compatibility
- Decorator pattern: Performance and circuit breaker kernels wrap the base kernel
- Container integration: Optional PSR-11 container support for dependency injection
Atomic\Http\- All classes are in this namespace- Tests:
Tests\namespace intests/directory - Benchmarks:
Benchmarks\namespace inbenchmarks/directory
This library prioritizes performance over runtime flexibility. The middleware stack is compiled once and cached, making it extremely fast but requiring application restart when middleware changes.
- 100% test coverage with PHPUnit
- Tests cover all core components, edge cases, and performance decorators
- Benchmark suite included for performance regression testing