Skip to content

3.16.0

Latest

Choose a tag to compare

@butschster butschster released this 14 Dec 11:36
· 1 commit to master since this release
3.16.0
997f93a

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, allowing applications to handle specialized HTTP verbs for managing relationships between resources.

PR #1230 | Author: @gam6itko

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-render event: Triggered before email template rendering
  • Post-render event: 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.

PR #1221 | Author: @roxblnfk

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.

PR #1222 | Author: @roxblnfk

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.

PR #1240 | Author: @gam6itko

Queue: Fix Return Type Annotation

Corrects the return type annotation for the getDelay() method to match actual behavior and improve static analysis accuracy.

PR #1238 | Author: @roxblnfk


🔧 Improvements

PHP 8.4 and Psalm v6 Support

  • Upgraded to Psalm v6 for static analysis
  • Updated Prototype component to use nikic/php-parser v5
  • Added PHP 8.4 to CI pipeline
  • Fixed Psalm and Rector issues

PR #1205 | Author: @msmakouz

General Maintenance

General maintenance update including dependency updates, code cleanup, and minor improvements across the framework.

PR #1236 | Author: @roxblnfk


📦 Full Changelog

Full Changelog: 3.15.0...3.16.0


🙏 Thanks

A huge thank you to all contributors who made this release possible: