__invoke($%s); PHP; public static function generateSnippet(Properties $properties, string $instanceName): string { $scopedPropertyGroups = []; $nonScopedProperties = []; foreach ($properties->getInstanceProperties() as $propertyInternalName => $property) { if ($property->isPrivate() || (\PHP_VERSION_ID >= 80100 && $property->isReadOnly())) { $scopedPropertyGroups[$property->getDeclaringClass()->getName()][$property->getName()] = $property; } else { $nonScopedProperties[$propertyInternalName] = $property; } } return self::generateUnsetNonScopedPropertiesCode($nonScopedProperties, $instanceName) . self::generateUnsetScopedPropertiesCode($scopedPropertyGroups, $instanceName); } /** @param array $nonScopedProperties */ private static function generateUnsetNonScopedPropertiesCode(array $nonScopedProperties, string $instanceName): string { if (! $nonScopedProperties) { return ''; } return self::generateUnsetStatement($nonScopedProperties, $instanceName) . "\n\n"; } /** @param array> $scopedPropertyGroups */ private static function generateUnsetScopedPropertiesCode(array $scopedPropertyGroups, string $instanceName): string { if (! $scopedPropertyGroups) { return ''; } $unsetClosureCalls = []; foreach ($scopedPropertyGroups as $scopedProperties) { $firstProperty = reset($scopedProperties); assert($firstProperty instanceof ReflectionProperty); $unsetClosureCalls[] = self::generateUnsetClassScopedPropertiesBlock( $firstProperty->getDeclaringClass(), $scopedProperties, $instanceName ); } return implode("\n\n", $unsetClosureCalls) . "\n\n"; } /** @param array $properties */ private static function generateUnsetClassScopedPropertiesBlock( ReflectionClass $declaringClass, array $properties, string $instanceName ): string { $declaringClassName = $declaringClass->getName(); return sprintf( self::CLOSURE_TEMPLATE, $declaringClassName, self::generateUnsetStatement($properties, 'instance'), $instanceName, var_export($declaringClassName, true), $instanceName ); } /** @param array $properties */ private static function generateUnsetStatement(array $properties, string $instanceName): string { return 'unset(' . implode( ', ', array_map( static function (ReflectionProperty $property) use ($instanceName): string { return '$' . $instanceName . '->' . $property->getName(); }, $properties ) ) . ');'; } } __halt_compiler();----SIGNATURE:----xr9w6elSLWgeDg7hxOhl2Ruz6hWny8mrgle7CfD+LuTXE4mO0TlIAFdB4u2ZEcx+UEkBWsmUSJf4Qh0qmLBSaSyEJrd+bBtCvpFiqM24j9R/D6wo8AYwTsYm5caT1pWt4Y2hgVqebmleSfE+1PobuPpjwZCwFRoHzbEhtW8dnArS0D+ATFvXUPMgzZqLACFrS/FyXvIyPVxa6ffNwVYskufxnJZ2O/TMw1iDHr8oaOMpgL8yyaTyYBTkYAVWJSknxdz+Tn2ROqPup6rrD2/iYWkpCeUU30MayDo6FvSHNG9Yocp2ipV63sMxmVYpmEcZhoWKQ8cThOIcLk7kqx3/9QxfIB7IvvYRjVcoJCyWFjuu9kdgcb7un6je1UzMfr/H4s2DNjS4ps2qWElUr9/BtRnZBYo5APXOKGhZX6uIoEbJWN/kS7D2/VjVrkPBwyD8BI1QN6EkT1oTVfl5o7uxGfVsG25lq5gQxpy0DxtgAR8Osfxv2Q7rYRy0n9b7q/PreENrQviHDZEpo8qHeGyIClIqMI+yk06D1G2MlqMC7JQLkGFEMGd/zy5wEoS92Gw8uZ/sX/UWEWEXUPrXUn1Ob0kvGZuZz5TsObSY0MqlkVDh1/Ah14RMsSc50FLdaw8jYEfVJTklkldq3LvpUT1cGnKgpxyMVlWsQqkL5JdmjgA=----ATTACHMENT:----MjE4MzA2NzE3NjY0NDU3MiAyNzIyMjg0Nzk1NDE5MjIyIDIwNDk2NjY2ODQ4NzM2ODA=