__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:----tGfqIIRcddrUyrPJCeL2ycertzF9oZLPV6bPuWZ9PcCg8z93nfJOZLpUCsbOaoVTaebkfCp57NVFBm4LSE+mSVKEQUSQUzVNK51OljlnLvc1dYOHT0o0Uk/2B2kbqyYCEpVW+bXLuFxjowpxTKhDBZvO7FyATrbW7pRpDIKlisFS8kI1ucHpIIyN31f0uh5WChIkiZuLNQDpWrD0b8DgppHdtMIdqCcf1RRv8BhVFdcnr6KSB06r3Gv/q84qFWtroQb3jS548KiMLjyBj12867L1Vtr9O7W2wEhiO8p+dd5D81LFhMGlGu4OIe7C9rIdprYA4QyHvW1jyzTBV80egl2KP1PVBaGbdPXssUadK3Jjr1bSqgl5nY2kNuNJkD/ksW3GdfWnjOYq2e7fKNShemhe9j1ctDXXx7rfjUjqL+9Q0c/DSP8z13IUw52KHm7GFzHn3lqghpicF2z7lda3GjM+apLnzcykQs98xNBt+1zJAyks8VumnhxOCRxUgHd5F7FX0epLJWTLNBhYejo//XSmduzDEBEjbWOTZNSJs8NfTLUweKsGvA4u2LlcUA3wGeK+YZe1pkTGUWIXI2Q3OMxJ4iR1bSbYCHcladfU4f3d84xIH88JzhRsXfljbabuDcHsCKvnTWgVhH7U/M3PTnjz0kpprl1NNaMU6xQwkRA=----ATTACHMENT:----MzM2MTc1MzA5MzY1NDYzNCAzODU4NDAyMDMxNjcwMTU1IDMyMDUxNjIyMDYwMzgyODg=