Migration Guide: 9.8.4 → 9.8.5
Version 9.8.5 improves component run() method handling and adds the new plain template pipe.
Summary
Added
- Component
run()methods can now be declared without parameters. - New
plaintemplate pipe for JSON-safe strings without URL encoding. - This migration guide.
Changed
- DTO parameters in component
run()methods are now detected by inheritance fromODTOinstead of their namespace. - Component
run()signatures are now explicitly validated.
Removed
- Nothing removed.
Component run() Signatures
Components can now use exactly one of the following run() signatures:
public function run(): void
public function run(ORequest $req): void
public function run(MyDTO $dto): void
In the last case, MyDTO must extend ODTO.
DTO detection is now based on inheritance from ODTO, not on the class namespace. DTO classes can therefore be located anywhere in the application.
Other signatures are invalid. A run() method can receive at most one parameter, which must be a non-nullable ORequest or a class extending ODTO.
New plain Template Pipe
The new plain pipe can be used to output strings in JSON templates without applying URL encoding:
{{ user.name | plain }}
For example:
John Doe → "John Doe"
He said "hello" → "He said \"hello\""
The pipe uses JSON-safe encoding, preserves Unicode characters and unescaped slashes, and correctly escapes quotes and other JSON-sensitive characters.
Null values are rendered as null.
The existing string pipe continues to apply urlencode().
Impact on Existing Projects
Existing components using run(ORequest $req) or a DTO extending ODTO remain compatible.
DTOs located in the conventional App\DTO namespace continue to work without changes.
Applications can now use parameterless run() methods when request data is not required.
Backward Compatibility
No changes are required for applications using valid ORequest or ODTO component parameters.
Applications containing unsupported run() signatures should update them to one of the supported forms.
Developer Action Required
No action is required for typical applications. Review custom component run() signatures if they use untyped, nullable, union, unsupported, or multiple parameters.
Notes
No configuration, database, or CLI changes are required.