__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:----lVoav7r23iWQ3lSQOc2Qh/gHyObn6MipIu4vdKrcL9M8ylShw2a7J40JSANfegK+ZJyBZi6GDAUjkrHr3MNJVamSUaLVbSDjzm6W2e1/u7sdt3jTouL6ad2UpdASUXi5yzqUM/nXj4sN4DGaxm288zupkOp6FNIlfCsTGZihahKaE+IGEUFDA1e0z0cOH9sqS9Bkl5U4kxRQRhiBbUUpfd6PZvIoca0z7GHe2m8R3ZZgzgNvdYu1a3nB83iAxKglmDuKRx9xEhfwI7YIUMJb1S0YjhgjfJZbEtPDKnApML0Jt7fQDqzhu7Hlcgw5EBoV38jSaosusgWbgIebd+VcEX/BYmHIMZbP1VT1n1cmwJujCHTUNXhcCk+7twDuSw5Lzel7jsiIDHQHSLNy3SW4rSWXgHafytF7FmTYPljuJ4LD92YVI1y2obijGVK32kX2eOOa+jwJztFQ+hrq1c4iSBBmu3lT+ad54mRqhWAcv1Rgw1e9pMa6y8dqVSredPDl1W4vIccb1hAAeLhwbtE8XdB8Slcxxm1d9aoggf3Up3nwqkjebb7YB+GQVmVmGHDy1j4Bnv9is2a7WiDGrYIeDIMkUTWZdDK2QcPefkhPCehqdLbtqSswe0EWLoBj2i6i2jmr36Vr2p/koqSrYTLF9zo+Ylbxri55u3syOej3mxU=----ATTACHMENT:----NTk3OTg0OTYxNzI4NTA2NyA0ODc5MzAyMTA3MTY1NDE4IDc2OTI2NzM0NzM1NTcyNTQ=