From 2af4cbece3c63074ea77e2a3bae2717b03c89e07 Mon Sep 17 00:00:00 2001 From: Sherin Bloemendaal Date: Mon, 17 Feb 2025 15:27:01 +0100 Subject: [PATCH] Remove per-property support, dropped in Symfony 7.0 --- components/var_exporter.rst | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/components/var_exporter.rst b/components/var_exporter.rst index 6aa4279788e..fc6b34868db 100644 --- a/components/var_exporter.rst +++ b/components/var_exporter.rst @@ -264,17 +264,6 @@ While you never query ``$processor->hash`` value, heavy methods will never be triggered. But still, the ``$processor`` object exists and can be used in your code, passed to methods, functions, etc. -Additionally and by adding two arguments to the initializer function, it is -possible to initialize properties one-by-one:: - - $processor = LazyHashProcessor::createLazyGhost(initializer: function (HashProcessor $instance, string $propertyName, ?string $propertyScope): mixed { - if (HashProcessor::class === $propertyScope && 'hash' === $propertyName) { - // Return $hash value - } - - // Then you can add more logic for the other properties - }); - Ghost objects unfortunately can't work with abstract classes or internal PHP classes. Nevertheless, the VarExporter component covers this need with the help of :ref:`Virtual Proxies `.