File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -260,21 +260,15 @@ convert non-lazy classes to lazy ones::
260260 $instance->validateHash();
261261 });
262262
263+ .. deprecated :: 7.0
264+
265+ The ``initializer `` function allowed passing two arguments to it to initialize
266+ properties one by one. This feature was removed in Symfony 7.0.
267+
263268While you never query ``$processor->hash `` value, heavy methods will never be
264269triggered. But still, the ``$processor `` object exists and can be used in your
265270code, passed to methods, functions, etc.
266271
267- Additionally and by adding two arguments to the initializer function, it is
268- possible to initialize properties one-by-one::
269-
270- $processor = LazyHashProcessor::createLazyGhost(initializer: function (HashProcessor $instance, string $propertyName, ?string $propertyScope): mixed {
271- if (HashProcessor::class === $propertyScope && 'hash' === $propertyName) {
272- // Return $hash value
273- }
274-
275- // Then you can add more logic for the other properties
276- });
277-
278272Ghost objects unfortunately can't work with abstract classes or internal PHP
279273classes. Nevertheless, the VarExporter component covers this need with the help
280274of :ref: `Virtual Proxies <var-exporter_virtual-proxies >`.
You can’t perform that action at this time.
0 commit comments