__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:----GPk8NXHY+4xPR/Koo9guai5CqJftwCP2PVlIJIwe0A3VQg/6ySp/+FEfrzchOq0e6PNcy62VZFG1j1GhNdiWOanGzcioG0AeHWuAiaD07IxaKKFuqCW9jHdgKAUPsrk+jsW1iD16pK/Xth5EN5d13jij+saNC0G/XmFtsiGMtU34FHCnDIlcqY5sVmui3CuB2E/tt+D5idvFDUvN7Qfs+HRJPAMAIm3JxoFA/lSn8FEbswLOrVqK1REAltS1rjaqWFo8tB7fF9Av/TAH7rSkkBCCA0IKYMB95TngnqYiFrQWgkOMWI1pAVkuvvQY+/IMoS/N+6CF8665xZMECbfTmWIjowHqKcdaMuXgoQdCZbxCJ0VIzLwKCXPB62Hd14jR+D/a/DIVcbIIZPsbQA/LCW2b3En7IIOiqvqrE4/cUqB/dGmc1YqmwTfQeeApmJJisgjLTpyNjjaxEwqjJ19sypoFG92rN7UBCScaKs+p9npaoplKdKVUKoUMYKVeWCrfZ51M8LWBjsvr+WQlKlXG/sNk3ElsKs3aA9WZ1pey/02ml+LmeIPxfFhjXjupLVY5p5VEdzMifgjZIfCHHOL/OONaDMyLY+N1JmGTS+gWHCrCFfPCfLZosbawQmoiVB9n33fOiuFdrXwCmIXg3TUaHcYNm77OU8IOmkUYqDCIYvM=----ATTACHMENT:----OTM2ODMxMjI2NzE1OTM1MCAyMzMyOTkwMjExMzkyMzQwIDM4NDU1MzQ0NzExNzc3Nzg=