@@ -17,7 +17,7 @@ public function __construct(
1717
1818 /**
1919 * Perform comprehensive health check
20- * @return array Health status
20+ * @return array{overall_status: string, timestamp: int, checks: array<string, mixed>, issues: array<mixed>, warnings: array<mixed>, recommendations: array<string>} Health status
2121 */
2222 public function performHealthCheck (): array {
2323 $ health = [
@@ -83,7 +83,7 @@ public function performHealthCheck(): array {
8383
8484 /**
8585 * Attempt automatic recovery for detected issues
86- * @return array Recovery results
86+ * @return array{timestamp: int, actions_taken: array<string>, recovered_tables: array<string>, failed_recoveries: array<string>, cleanup_performed: bool} Recovery results
8787 */
8888 public function performAutoRecovery (): array {
8989 $ results = [
@@ -109,8 +109,8 @@ public function performAutoRecovery(): array {
109109
110110 /**
111111 * Process health issues and attempt recovery
112- * @param array $issues
113- * @param array &$results
112+ * @param array<mixed> $issues
113+ * @param array{timestamp: int, actions_taken: array<string>, recovered_tables: array<string>, failed_recoveries: array<string>, cleanup_performed: bool} &$results
114114 */
115115 private function processHealthIssues (array $ issues , array &$ results ): void {
116116 foreach ($ issues as $ issue ) {
@@ -124,8 +124,8 @@ private function processHealthIssues(array $issues, array &$results): void {
124124
125125 /**
126126 * Recover stuck operations for given tables
127- * @param array $tables
128- * @param array &$results
127+ * @param array<string> $tables
128+ * @param array{timestamp: int, actions_taken: array<string>, recovered_tables: array<string>, failed_recoveries: array<string>, cleanup_performed: bool} &$results
129129 */
130130 private function recoverStuckOperations (array $ tables , array &$ results ): void {
131131 foreach ($ tables as $ tableName ) {
@@ -144,8 +144,8 @@ private function recoverStuckOperations(array $tables, array &$results): void {
144144
145145 /**
146146 * Recover failed operations for given tables
147- * @param array $tables
148- * @param array &$results
147+ * @param array<string> $tables
148+ * @param array{timestamp: int, actions_taken: array<string>, recovered_tables: array<string>, failed_recoveries: array<string>, cleanup_performed: bool} &$results
149149 */
150150 private function recoverFailedOperations (array $ tables , array &$ results ): void {
151151 foreach ($ tables as $ tableName ) {
@@ -164,8 +164,8 @@ private function recoverFailedOperations(array $tables, array &$results): void {
164164
165165 /**
166166 * Perform cleanup if warnings exist
167- * @param array $warnings
168- * @param array &$results
167+ * @param array<mixed> $warnings
168+ * @param array{timestamp: int, actions_taken: array<string>, recovered_tables: array<string>, failed_recoveries: array<string>, cleanup_performed: bool} &$results
169169 */
170170 private function performCleanupIfNeeded (array $ warnings , array &$ results ): void {
171171 if (empty ($ warnings )) {
@@ -180,7 +180,7 @@ private function performCleanupIfNeeded(array $warnings, array &$results): void
180180
181181 /**
182182 * Check for stuck rebalancing operations
183- * @return array Check results
183+ * @return array{stuck_tables: array<string>, check_time: int, error?: string} Check results
184184 */
185185 private function checkStuckOperations (): array {
186186 $ results = ['stuck_tables ' => [], 'check_time ' => time ()];
@@ -223,7 +223,7 @@ private function checkStuckOperations(): array {
223223
224224 /**
225225 * Check for failed operations
226- * @return array Check results
226+ * @return array{failed_tables: array<string>, check_time: int, error?: string} Check results
227227 */
228228 private function checkFailedOperations (): array {
229229 $ results = ['failed_tables ' => [], 'check_time ' => time ()];
@@ -262,7 +262,7 @@ private function checkFailedOperations(): array {
262262
263263 /**
264264 * Check for orphaned resources
265- * @return array Check results
265+ * @return array{orphaned_count: int, details: array<string>, check_time: int, error?: string} Check results
266266 */
267267 private function checkOrphanedResources (): array {
268268 $ results = ['orphaned_count ' => 0 , 'details ' => [], 'check_time ' => time ()];
@@ -275,7 +275,7 @@ private function checkOrphanedResources(): array {
275275 $ clusters = $ data [0 ]['data ' ] ?? [];
276276
277277 foreach ($ clusters as $ cluster ) {
278- $ clusterName = $ cluster ['cluster ' ] ?? '' ;
278+ $ clusterName = $ cluster ['cluster ' ];
279279 if (strpos ($ clusterName , 'temp_move_ ' ) !== 0 ) {
280280 continue ;
281281 }
@@ -292,7 +292,7 @@ private function checkOrphanedResources(): array {
292292
293293 /**
294294 * Check queue health
295- * @return array Check results
295+ * @return array{depth: int, threshold: int, high_depth: bool, check_time: int, error?: string} Check results
296296 */
297297 private function checkQueueHealth (): array {
298298 $ results = ['depth ' => 0 , 'threshold ' => 100 , 'high_depth ' => false , 'check_time ' => time ()];
@@ -322,8 +322,8 @@ private function checkQueueHealth(): array {
322322
323323 /**
324324 * Generate recommendations based on health check
325- * @param array $health
326- * @return array Recommendations
325+ * @param array{overall_status: string, timestamp: int, checks: array<string, mixed>, issues: array<mixed>, warnings: array<mixed>, recommendations: array<string>} $health
326+ * @return array<string> Recommendations
327327 */
328328 private function generateRecommendations (array $ health ): array {
329329 $ recommendations = [];
@@ -361,7 +361,7 @@ private function generateRecommendations(array $health): array {
361361 /**
362362 * Recover stuck operation
363363 * @param string $tableName
364- * @return array Recovery result
364+ * @return array{success: bool, message?: string, error?: string} Recovery result
365365 */
366366 private function recoverStuckOperation (string $ tableName ): array {
367367 try {
@@ -377,7 +377,7 @@ private function recoverStuckOperation(string $tableName): array {
377377 /**
378378 * Recover failed operation
379379 * @param string $tableName
380- * @return array Recovery result
380+ * @return array{success: bool, message?: string, error?: string} Recovery result
381381 */
382382 private function recoverFailedOperation (string $ tableName ): array {
383383 try {
0 commit comments