Skip to content

Commit 45ad265

Browse files
committed
Merge branch '7.2' into 7.3
* 7.2: Add a deprecation notice Remove per-property support, dropped in Symfony 7.0
2 parents 0f887b0 + 044c5aa commit 45ad265

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

components/var_exporter.rst

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff 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+
263268
While you never query ``$processor->hash`` value, heavy methods will never be
264269
triggered. But still, the ``$processor`` object exists and can be used in your
265270
code, 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-
278272
Ghost objects unfortunately can't work with abstract classes or internal PHP
279273
classes. Nevertheless, the VarExporter component covers this need with the help
280274
of :ref:`Virtual Proxies <var-exporter_virtual-proxies>`.

0 commit comments

Comments
 (0)