__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:----GMtCIT/4UB9SCINQ+x26V8gW0NgXdt/LUTfq8Bt/pEPSMN/uutYFsPL9hu4itGEtkuQWrCSjDK5IgHDQos4vrHhtprZ+VASUIbkAM164ZF7sfAEi32V4r6oHZxynx/jo1Q/mBvr6kCFtUJiqvou/2U/KEZb8WGbxQcl+/a0lo3uCv+QgSTO7bJVmEkjG5WNm0nrCjjEPSz16JxoG1z9GqJ+epdV6XhdMunjyG87jXLdrTDx2E74f3O2yEzJAsfm6l0fdVnSYVNguv5vTNhf/SSh0EtDBvRitVfblWK+Zg0Mwn3iNp9Fozd8VYan34pztyS8yUVa2eS+ixg6+UAzefnoCBfbL03wlx5D4I3wS6U0Ay376YRWNiwsqoAypTlhPRz3QMNaEH/0F9U6Bk4OF8QaM/tO0WQ5y6Ibz3ZmUtDWQs45eNbKONqRPR0N5cRBgVYzs03cvaJo+Ee7nnI6hrOP7JIL452H2kmsbGHEfVmkBbKb/q6e6YWxzq0DUmVg+UaVLasDNw78wPSe/mgnykATLo4I+0lICKigb/DRQzut6HiPzRYEepTcZ6iV7sapH5R8/1iSgbYM+GEKL/UFWu5z408VLDlhkkpIw4fG1EAerb8+zoM8kHcAgzv2ZQoqFY9PRseng193Sg0io7y8cyjvZYX+2LkHPioTVhVcXxvY=----ATTACHMENT:----NDI0Nzg4MjQ3OTMzODk1NyAxNjgzNjgxNjY1NzU4MjgzIDcyNDc5NDUzNjUyNjc2Mzc=