When we pass arguments to the constructor for dependency injection, we expect these arguments to be properly initialized and available for use with the object's methods after deserialization.
public function __construct(
private readonly NewsService $newsService,
private readonly CatalogService $catalogService,
private readonly ConstructorService $constructorService
) {
// ...
}
However, in the current implementation, this can lead to errors such as:
Serialization of 'Closure' is not allowed
This change aims to ensure the reinitialization of the class with all its arguments after deserialization, similar to how it is handled for GET requests. This will help avoid serialization issues and correctly restore the object's state.
When we pass arguments to the constructor for dependency injection, we expect these arguments to be properly initialized and available for use with the object's methods after deserialization.
However, in the current implementation, this can lead to errors such as:
This change aims to ensure the reinitialization of the class with all its arguments after deserialization, similar to how it is handled for GET requests. This will help avoid serialization issues and correctly restore the object's state.