Releases: spiral/framework
Release list
3.17.2
3.17.1
What's Changed
Fixes
Code quality
- QA fix: regenerate psalm baseline, bump rector to ~2.4.5 and re-run it, apply cs fix by @samsonasik in #1258
- Apply cs fix by @samsonasik in #1259
- Add StructArmed to QA by @samsonasik in #1260
- Enable FinalizeTestCaseClassRector by @samsonasik in #1261
- Update composer audit to run without dev dependencies and run composer cs:fix by @samsonasik in #1262
- Enable CreateStubOverCreateMockArgRector by @samsonasik in #1263
- Enable StaticToSelfOnFinalClassRector and StringCastAssertStringContainsStringRector by @samsonasik in #1264
- Enable PreferPHPUnitSelfCallRector by @samsonasik in #1265
- Enable DeclareStrictTypesTestsRector by @samsonasik in #1266
- Enable RemoveNullArgOnNullDefaultParamRector by @samsonasik in #1268
- Set layerPattern and ruleSet on StructArmed config by @samsonasik in #1267
- Enable ArrowFunctionDelegatingCallToFirstClassCallableRector by @samsonasik in #1269
- Apply fix psr-4 namespaces under src/*/tests by @samsonasik in #1270
- Enable AddInstanceofAssertForNullableInstanceRector by @samsonasik in #1271
- Fix cs: remove unnecessary use statements by @samsonasik in #1273
- Enable TypedPropertyFromCreateMockAssignRector by @samsonasik in #1272
- Avoid chmod warnings when writing files into existing macOS temp directories by @samsonasik in #1274
- Enable NarrowWideUnionReturnTypeRector by @samsonasik in #1275
- Enable Rector TypeCoverageLevel 10 by @samsonasik in #1276
- Bump Rector to ~2.4.6 and clean up skip config by @samsonasik in #1277
- Enable Rector TypeCoverageLevel 13 by @samsonasik in #1278
- Enable Rector TypeCoverageLevel 14 by @samsonasik in #1279
- Enable Rector TypeCoverageLevel 16 by @samsonasik in #1280
- Enable Rector TypeCoverageLevel 18 by @samsonasik in #1281
- Enable Rector TypeCoverageLevel 21 by @samsonasik in #1282
- Enable Rector TypeCoverageLevel 23 by @samsonasik in #1283
- Bump to Rector ~2.5.2 and clean up unused skip config by @samsonasik in #1285
- Bump structarmed to ^0.14 and use new expanded +LayerName in the config by @samsonasik in #1286
- Use @psalm-import-type over @phpstan-import-type on Bootloader by @samsonasik in #1287
- Bump Rector to ~2.5.3 and re-run it with cleaned up skip configs by @samsonasik in #1288
- Enable RemoveUselessUnionReturnDocblockRector by @samsonasik in #1289
- Bump Rector to ~2.5.5 and clean up skip configs by @samsonasik in #1290
Full Changelog: 3.17.0...3.17.1
3.13.1
3.17.0
New features
1. Added command aliases support to #[AsCommand]
The #[AsCommand] attribute now accepts an aliases parameter, allowing a console command to be registered and invoked under several names. The scaffolder was also updated to generate commands with aliases out of the box.
Example Usage:
use Spiral\Console\Attribute\AsCommand;
#[AsCommand(name: 'app:user:create', aliases: ['user:new', 'user:add'])]
final class CreateUserCommand extends Command
{
// ...
}Other
- [spiral/csrf] Fixed
CsrfMiddlewarecookie missing thePathattribute by adding a configurablepathoption (default/) by @roxblnfk in #1257 - [spiral/framework] Fixed
route:listcommand crash onLINK/UNLINKverbs by @gam6itko in #1254 - [spiral/pagination] Hardened
Paginatorlimit handling and documented the component by @gam6itko in #1255
Full Changelog: 3.16.2...3.17.0
3.16.2
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, allowing 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