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::
260
260
$instance->validateHash();
261
261
});
262
262
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
+
263
268
While you never query ``$processor->hash `` value, heavy methods will never be
264
269
triggered. But still, the ``$processor `` object exists and can be used in your
265
270
code, passed to methods, functions, etc.
266
271
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
-
278
272
Ghost objects unfortunately can't work with abstract classes or internal PHP
279
273
classes. Nevertheless, the VarExporter component covers this need with the help
280
274
of :ref: `Virtual Proxies <var-exporter_virtual-proxies >`.
You can’t perform that action at this time.
0 commit comments