Refactor stats variable names for clarity

Renamed generic 'stats' variables to more specific names such as 'domainStats', 'errorStats', 'tldStats', and 'importStats' across controllers and views. This improves code readability and reduces ambiguity when handling different types of statistics in the application.
This commit is contained in:
Hosteroid
2025-10-20 19:53:28 +03:00
parent 1b84f06c86
commit c4e4196e02
8 changed files with 35 additions and 35 deletions

View File

@@ -41,7 +41,7 @@ class ErrorLogController extends Controller
$errors = $this->errorLogModel->getPaginatedErrors($filters, $perPage, $offset);
// Get statistics using model
$stats = $this->errorLogModel->getAdminStats();
$errorStats = $this->errorLogModel->getAdminStats();
// Pagination data
$totalPages = ceil($totalErrors / $perPage);
@@ -54,7 +54,7 @@ class ErrorLogController extends Controller
'showing_to' => min($offset + $perPage, $totalErrors)
];
$this->view('errors/admin-index', compact('errors', 'stats', 'filters', 'pagination'));
$this->view('errors/admin-index', compact('errors', 'errorStats', 'filters', 'pagination'));
}
/**

View File

@@ -37,12 +37,12 @@ class TldRegistryController extends Controller
$order = $_GET['order'] ?? 'asc';
$result = $this->tldModel->getPaginated($page, $perPage, $search, $sort, $order, $status, $dataType);
$stats = $this->tldModel->getStatistics();
$tldStats = $this->tldModel->getStatistics();
$this->view('tld-registry/index', [
'tlds' => $result['tlds'],
'pagination' => $result['pagination'],
'stats' => $stats,
'tldStats' => $tldStats,
'filters' => [
'search' => $search,
'status' => $status,
@@ -584,7 +584,7 @@ class TldRegistryController extends Controller
$this->view('tld-registry/import-logs', [
'imports' => $result['logs'],
'pagination' => $result['pagination'],
'stats' => $importStats,
'importStats' => $importStats,
'title' => 'TLD Import Logs'
]);
}