status_data_provider = $status_data_provider ?? new Cron_Status_Data_Provider(); $this->background_statistics = $background_statistics ?? new Cron_Background_Statistics(); $this->health_diagnostics = $health_diagnostics ?? new Cron_Health_Diagnostics(); } /** * Get complete cron status data by delegating to specialized handlers. * * @return array Complete status data from all specialized providers. */ public function get_complete_status(): array { accessibility_audio_tts_debug_log( 'Cron_Status_Provider: Collecting complete status from specialized handlers.' ); try { // Delegate to specialized handlers. $status_data = $this->status_data_provider->get_basic_status_data(); $background_stats = $this->background_statistics->get_background_processing_stats(); $health_data = $this->health_diagnostics->get_health_status(); // Combine all data. $complete_status = array_merge( $status_data, $background_stats, $health_data ); accessibility_audio_tts_debug_log( 'Cron_Status_Provider: Complete status collected successfully.' ); return $complete_status; } catch ( \Exception $e ) { accessibility_audio_tts_debug_log( 'Cron_Status_Provider: Error collecting status - ' . $e->getMessage() ); // Return minimal error status. return array( 'status' => 'error', 'message' => 'Error collecting cron status: ' . $e->getMessage(), 'cron_enabled' => false, 'total_jobs' => 0, ); } } /** * Get status data provider. * * @return Cron_Status_Data_Provider Provider instance. */ public function get_status_data_provider(): Cron_Status_Data_Provider { return $this->status_data_provider; } /** * Get background statistics provider. * * @return Cron_Background_Statistics Provider instance. */ public function get_background_statistics(): Cron_Background_Statistics { return $this->background_statistics; } /** * Get health diagnostics provider. * * @return Cron_Health_Diagnostics Provider instance. */ public function get_health_diagnostics(): Cron_Health_Diagnostics { return $this->health_diagnostics; } }