Releases: spiral/framework
3.16.1
3.16.0
Highlights
PHP Attributes for Bootloader Methods
The most significant addition in this release is comprehensive support for PHP attributes in bootloaders, providing a modern, type-safe approach to application bootstrapping. You can now use attributes like #[SingletonMethod], #[BindMethod], #[BindScope], and priority-based lifecycle methods for cleaner and more expressive bootloader configuration.
Container Optimization
Major performance improvements to the container's dependency resolution with iterative scope resolution, eliminating recursive overhead and reducing exception handling for faster dependency injection.
Modern PHP Tooling
Full support for PHP 8.4, Psalm v6, Symfony Console 8, and migration to PHPUnit attributes for a modern development experience.
Features
PHP Attributes for Bootloader Methods
This major feature adds PHP attributes for configuring bootloaders, providing a more expressive and type-safe approach to application bootstrapping.
Available Attributes:
#[BindMethod]- Container bindings that create new instances#[SingletonMethod]- Container bindings that create shared instances#[InjectorMethod]- Custom injector methods#[BindAlias]- Multiple aliases for bindings#[BindScope]- Scoped bindings#[InitMethod]- Initialization phase methods with priority control#[BootMethod]- Boot phase methods with priority control
Example:
class DatabaseBootloader extends Bootloader
{
#[SingletonMethod]
#[BindScope('http')]
public function createConnection(): ConnectionInterface
{
return new Connection(...);
}
#[InitMethod(priority: 100)]
public function registerCoreServices(Container $container): void
{
// Register core services first
}
}Benefits:
- Type-safety leveraging PHP's type system
- Clearer intent with attributes vs. method names
- Fine-grained control over execution order
- Modern PHP 8+ attribute syntax
PR #1190 | Author: @butschster
HTTP LINK and UNLINK Methods Support
Extends HTTP method support to include LINK and UNLINK verbs as specified in RFC 2068 and RFC 5988, allowi
E880
ng applications to handle specialized HTTP verbs for managing relationships between resources.
Mailer: Reply-To Header Support
Adds support for the Reply-To email header in the SendIt mailer component. Email messages can now properly set and handle Reply-To headers, allowing recipients to reply to a different address than the sender.
PR #1232 | Author: @burn1ngbear
Mailer: Pre and Post Render Events
Adds event hooks to the email rendering process for better extensibility:
Pre-renderevent: Triggered before email template renderingPost-renderevent: Triggered after email template rendering
This allows modification of email content before rendering and enables logging, validation, or transformation after rendering.
PR #1233 | Author: @burn1ngbear
Reactor: Constant Type Management
Adds missing methods to the Reactor component for working with constant types, improving the code generation capabilities when managing constant type information in generated PHP code.
PR #1220 | Author: @butschster
Performance
Container Optimization
Major performance optimization for the container's dependency resolution and scope handling:**
- Fixed
Invoker::invoke()to avoid unnecessary class instantiation when calling static functions - Added internal Container Actor service for improved service management
- Refactored Tracer to create new instances for each separated Container operation
- Improved resolving traces in container exceptions for better debugging
- Optimized scope resolution to use iterative loop instead of recursive
Factory::make()calls
The iterative scope resolution eliminates recursive overhead and reduces exception handling, resulting in significantly faster dependency resolution.
Queue: Optimize Telemetry Span Names
Optimizes telemetry trace naming for queue job processing by removing job IDs from span names. This reduces cardinality and allows proper grouping of traces by job type in observability tools, resulting in better trace aggregation, easier performance pattern identification, and reduced storage overhead.
PR #1215 | Author: @rauanmayemir
🐛 Bug Fixes
Router: Fix Group Prefix Application
Fixes a bug where route group prefixes were not being automatically applied to routes in the group. Previously, developers had to manually include the prefix in each route path or add it explicitly, which was counter-intuitive. Now group prefixes are automatically applied to all routes in the group as expected.
PR #1219 | Author: @butschster | Closes: #1217
Telemetry: Fix Trace Context Propagation
Critical bug fix for the telemetry component that was preventing trace context from being added to log records. The tracer was not using the scoped proxy container, resulting in empty trace context. Fixed by ensuring TelemetryProcessor uses the scoped container properly.
PR #1212 | Author: @rauanmayemir
Telemetry: Bind TracerInterface as Singleton
Fixes an issue where TracerInterface was overwriting trace context every time it was accessed, causing traces to be lost frequently. The solution binds current TracerInterface as singleton for consistent trace context within request scope and fixes scope handling in AbstractTracer::runScope method.
Benefits:
- Reliable access to trace context during request scope
- Improved integration with Monolog telemetry processor
- Prevents trace context loss during request processing
PR #1214 | Author: @rauanmayemir
Core: Fix static Return Type in Proxy Generator
Fixes a critical bug in the proxy class generator that caused failures when proxying interfaces with static return types. The generator now properly handles static return type, preventing failures in dependency injection and scoped bindings. Also adds resolving trace to resolver exceptions for better debugging.
Console: Fix Symfony Console 7.4+ Deprecation
Fixes deprecation warnings when using Symfony Console 7.4+ and adds support for Symfony 8. Replaced deprecated add() method with addCommand() for Symfony 7.4+ while maintaining backward compatibility with Symfony 6.4. Updated version constraints to ^6.4.17 || ^7.2 || ^8.0.
Queue: Fix Return Type Annotation
Corrects the return type annotation for the getDelay() method to match actual behavior and improve static analysis accuracy.
🔧 Improvements
PHP 8.4 and Psalm v6 Support
- Upgraded to Psalm v6 for static analysis
- Updated Prototype component to use
nikic/php-parserv5 - Added PHP 8.4 to CI pipeline
- Fixed Psalm and Rector issues
General Maintenance
General maintenance update including dependency updates, code cleanup, and minor improvements across the framework.
📦 Full Changelog
Full Changelog: 3.15.0...3.16.0
🙏 Thanks
A huge thank you to all contributors who made this release possible:
3.15.8
What's Changed
- Hotfixes by @roxblnfk in #1226
- Fixed
SpanInterfacesingleton rebinding in the Telemetry component (see spiral/app#157) - Fixed working of Prototype in container scopes
- Fixed
Full Changelog: 3.15.7...3.15.8
3.15.7
3.15.6
What's Changed
- Optimize container and fix invoker by @roxblnfk in #1221
- Invoker::invoke() does not try to instantiate class to call a static function
- Added an internal Container Actor service
- Remove Tracer from services. Now a new one might be created for a separated Container operation
- Reworked resolving traces in container exceptions
Full Changelog: 3.15.5...3.15.6
3.15.5
What's Changed
Bug Fixes
- [spiral/router] Fix issue when group prefix is not applied to routes by @butschster in #1219
Full Changelog: 3.15.0...3.15.6
3.15.4
What's Changed
- Telemetry: removed ID from a consumed job span by @rauanmayemir in #1215
It allows proper grouping of traces by job name
Full Changelog: 3.15.3...3.15.4
3.15.3
What's Changed
- Fixed scoped
TracerInterfacein theAbstractTracer::runScopemethod by @roxblnfk and @rauanmayemir in #1214 \Spiral\Core\Scopeis public now
Full Changelog: 3.15.2...3.15.3
3.15.2
What's Changed
- Fix a bug with telemetry info not propagating into log records by @rauanmayemir in #1212
Full Changelog: 3.15.0...3.15.2