}> */ private static array $entries = []; /** @param array $context */ public static function error(string $provider, string $message, array $context = []): void { self::$entries[] = ['provider' => $provider, 'message' => $message, 'context' => $context]; if (count(self::$entries) > 50) { array_shift(self::$entries); } do_action('zadex/forms/integration_error', $provider, $message, $context); if (defined('WP_DEBUG') && WP_DEBUG && defined('WP_DEBUG_LOG') && WP_DEBUG_LOG) { error_log('[Zadex forms] ' . $provider . ': ' . $message); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- only with WP_DEBUG + WP_DEBUG_LOG on, so site owners can debug failing integrations. } } /** @return array}> */ public static function entries(): array { return self::$entries; } public static function clear(): void { self::$entries = []; } }