Skip to content

Commit 9e16a29

Browse files
committed
Moved to PHP 8.4
1 parent 0bb0eda commit 9e16a29

File tree

1,049 files changed

+34743
-34427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,049 files changed

+34743
-34427
lines changed

.github/workflows/vendor-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: Build Vendor Package
3030
runs-on: ubuntu-latest
3131
env:
32-
PHP_VERSION: '8.2'
32+
PHP_VERSION: '8.4'
3333
PACKAGE_NAME: 'vendor.tar.gz'
3434
steps:
3535
- name: Checkout code

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# First stage: PHP with Apache
2-
FROM php:8.2-apache AS php-apache
2+
FROM php:8.4-apache AS php-apache
33

44
# Install system dependencies and PHP extensions
55
RUN apt-get update && \

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> **Integrated Laboratory Information & Sample Tracking System**
44
> Simple, open-source LIS to manage and track samples for HIV VL, EID, TB, Hepatitis, COVID-19, CD4 and other priority diseases.
55
6-
![PHP](https://img.shields.io/badge/PHP-8.2+-blue)
6+
![PHP](https://img.shields.io/badge/PHP-8.4+-blue)
77
![Ubuntu](https://img.shields.io/badge/Ubuntu-22.04%2B-orange)
88
![Status](https://img.shields.io/badge/status-stable-success)
99
![License: InteLIS Community Copyleft License (Non-Commercial)](https://img.shields.io/badge/License-Community%20Copyleft%20v1.0-blue)
@@ -53,7 +53,7 @@ See the full license text in [LICENSE.md](LICENSE.md).
5353

5454
- Apache 2.x (with `rewrite` and `headers` modules enabled)
5555
- MySQL 5.7 or higher
56-
- PHP 8.2.x
56+
- PHP 8.4.x
5757
- [Composer](https://getcomposer.org/download/)
5858

5959
------

app/admin/api-dashboard/api-dashboard.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,22 +242,22 @@
242242
<td><strong><?= _translate('Test Type'); ?>&nbsp;:</strong></td>
243243
<td>
244244
<select id="testType" name="testType" class="form-control" style="width:150px;">
245-
<?php if (!empty($activeTests) && in_array('vl', $activeTests)) { ?>
245+
<?php if ($activeTests !== [] && in_array('vl', $activeTests)) { ?>
246246
<option value="vl"><?= _translate("Viral Load"); ?></option>
247247
<?php }
248-
if (!empty($activeTests) && in_array('eid', $activeTests)) { ?>
248+
if ($activeTests !== [] && in_array('eid', $activeTests)) { ?>
249249
<option value="eid"><?= _translate("Early Infant Diagnosis"); ?></option>
250250
<?php }
251-
if (!empty($activeTests) && in_array('covid19', $activeTests)) { ?>
251+
if ($activeTests !== [] && in_array('covid19', $activeTests)) { ?>
252252
<option value="covid19"><?= _translate("Covid-19"); ?></option>
253253
<?php }
254-
if (!empty($activeTests) && in_array('hepatitis', $activeTests)) { ?>
254+
if ($activeTests !== [] && in_array('hepatitis', $activeTests)) { ?>
255255
<option value='hepatitis'><?= _translate("Hepatitis"); ?></option>
256256
<?php }
257-
if (!empty($activeTests) && in_array('tb', $activeTests)) { ?>
257+
if ($activeTests !== [] && in_array('tb', $activeTests)) { ?>
258258
<option value='tb'><?= _translate("TB"); ?></option>
259259
<?php }
260-
if (!empty($activeTests) && in_array('cd4', $activeTests)) { ?>
260+
if ($activeTests !== [] && in_array('cd4', $activeTests)) { ?>
261261
<option value='cd4'><?= _translate("CD4"); ?></option>
262262
<?php } ?>
263263
</select>

app/admin/api-dashboard/duplicates-detail.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
<div class="box-header">
6868
<h3 class="box-title"><?= _translate('Potential Duplicate Test Requests'); ?></h3>
6969
<div class="box-tools pull-right">
70-
<span class="label label-info">Test Type: <?= strtoupper($testType); ?></span>
70+
<span class="label label-info">Test Type: <?= strtoupper((string) $testType); ?></span>
7171
<?php if ($dateRange): ?>
72-
<span class="label label-primary">Period: <?= htmlspecialchars($dateRange); ?></span>
72+
<span class="label label-primary">Period: <?= htmlspecialchars((string) $dateRange); ?></span>
7373
<?php endif; ?>
7474
</div>
7575
</div>

app/admin/api-dashboard/get-api-dashboard-alerts.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
// get-smart-dashboard-alerts.php
3-
3+
use App\Utilities\MiscUtility;
4+
use Laminas\Diactoros\ServerRequest;
45
use App\Services\TestsService;
56
use App\Utilities\DateUtility;
67
use App\Registries\AppRegistry;
@@ -9,7 +10,7 @@
910
use App\Services\DatabaseService;
1011
use App\Registries\ContainerRegistry;
1112

12-
/** @var Laminas\Diactoros\ServerRequest $request */
13+
/** @var ServerRequest $request */
1314
$request = AppRegistry::get('request');
1415
$_POST = _sanitizeInput($request->getParsedBody());
1516

@@ -25,20 +26,20 @@
2526
$duplicatesWhere = [];
2627

2728
// Date range filter
28-
if (isset($_POST['dateRange']) && trim((string) $_POST['dateRange']) != '') {
29+
if (isset($_POST['dateRange']) && trim((string) $_POST['dateRange']) !== '') {
2930
[$start_date, $end_date] = DateUtility::convertDateRange($_POST['dateRange'] ?? '', includeTime: true);
3031
$sWhere[] = " t.request_created_datetime BETWEEN '$start_date' AND '$end_date' ";
3132
$duplicatesWhere[] = " t1.request_created_datetime BETWEEN '$start_date' AND '$end_date' ";
3233
}
3334

3435
// Lab filter
35-
if (isset($_POST['labName']) && trim((string) $_POST['labName']) != '') {
36+
if (isset($_POST['labName']) && trim((string) $_POST['labName']) !== '') {
3637
$sWhere[] = " t.lab_id IN (" . $_POST['labName'] . ")";
3738
$duplicatesWhere[] = " t1.lab_id IN (" . $_POST['labName'] . ")";
3839
}
3940

4041
// Facility filter
41-
if (isset($_POST['facilityId']) && trim((string) $_POST['facilityId']) != '') {
42+
if (isset($_POST['facilityId']) && trim((string) $_POST['facilityId']) !== '') {
4243
$facilityId = implode(',', $_POST['facilityId']);
4344
$sWhere[] = " t.facility_id IN ($facilityId)";
4445
$duplicatesWhere[] = " t1.facility_id IN ($facilityId)";
@@ -51,20 +52,20 @@
5152
$facilityJoin = ' LEFT JOIN facility_details as f ON t.facility_id = f.facility_id ';
5253
$duplicatesFacilityJoin = ' LEFT JOIN facility_details as f1 ON t1.facility_id = f1.facility_id ';
5354

54-
if (isset($_POST['state']) && trim((string) $_POST['state']) != '') {
55+
if (isset($_POST['state']) && trim((string) $_POST['state']) !== '') {
5556
$provinceId = implode(',', $_POST['state']);
5657
$sWhere[] = " f.facility_state_id IN ($provinceId)";
5758
$duplicatesWhere[] = " f1.facility_state_id IN ($provinceId)";
5859
}
5960

60-
if (isset($_POST['district']) && trim((string) $_POST['district']) != '') {
61+
if (isset($_POST['district']) && trim((string) $_POST['district']) !== '') {
6162
$districtId = implode(',', $_POST['district']);
6263
$sWhere[] = " f.facility_district_id IN ($districtId)";
6364
$duplicatesWhere[] = " f1.facility_district_id IN ($districtId)";
6465
}
6566
}
6667

67-
$whereSql = !empty($sWhere) ? (' WHERE ' . implode(' AND ', $sWhere)) : '';
68+
$whereSql = $sWhere === [] ? ('') : ' WHERE ' . implode(' AND ', $sWhere);
6869

6970
$alerts = [];
7071

@@ -98,7 +99,7 @@
9899
// Base conditions for duplicates
99100
$duplicatesWhere[] = " (t1.$patientFirstNameColumn IS NOT NULL OR t1.$patientIdColumn IS NOT NULL) ";
100101
$duplicatesWhere[] = " t1.sample_collection_date IS NOT NULL ";
101-
$duplicatesWhereSql = !empty($duplicatesWhere) ? (' WHERE ' . implode(' AND ', $duplicatesWhere)) : '';
102+
$duplicatesWhereSql = $duplicatesWhere === [] ? ('') : ' WHERE ' . implode(' AND ', $duplicatesWhere);
102103

103104
// Alert 2: High number of potential duplicates - ALIGNED WITH METRICS LOGIC
104105
$duplicatesQuery = "
@@ -229,7 +230,7 @@
229230
// Generate HTML output for alerts
230231
$alertsHtml = '';
231232

232-
if (empty($alerts)) {
233+
if ($alerts === []) {
233234
$alertsHtml = '<div class="alert-card success">
234235
<strong><em class="fa-solid fa-check-circle"></em> ' . _translate('All Good!') . '</strong><br>
235236
' . _translate('No critical issues detected in the current time period.') . '
@@ -257,8 +258,8 @@
257258
'last_db_error' => $db->getLastError(),
258259
'last_db_query' => $db->getLastQuery()
259260
]);
260-
echo '<div class="alert-card danger">
261+
MiscUtility::safeCliEcho('<div class="alert-card danger">
261262
<strong>' . _translate('Error') . '</strong><br>
262263
' . _translate('Failed to load alerts') . $e->getMessage() . '
263-
</div>';
264+
</div>');
264265
}

app/admin/api-dashboard/get-api-dashboard-metrics.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
// get-api-dashboard-metrics.php
3-
3+
use Laminas\Diactoros\ServerRequest;
44
use App\Services\TestsService;
55
use App\Utilities\DateUtility;
66
use App\Utilities\JsonUtility;
@@ -10,7 +10,7 @@
1010
use App\Services\DatabaseService;
1111
use App\Registries\ContainerRegistry;
1212

13-
/** @var Laminas\Diactoros\ServerRequest $request */
13+
/** @var ServerRequest $request */
1414
$request = AppRegistry::get('request');
1515
$_POST = _sanitizeInput($request->getParsedBody());
1616

@@ -25,35 +25,35 @@
2525
$sWhere = [];
2626

2727
// Date range filter
28-
if (isset($_POST['dateRange']) && trim((string) $_POST['dateRange']) != '') {
28+
if (isset($_POST['dateRange']) && trim((string) $_POST['dateRange']) !== '') {
2929
[$start_date, $end_date] = DateUtility::convertDateRange($_POST['dateRange'] ?? '', includeTime: true);
3030
$sWhere[] = " t.request_created_datetime BETWEEN '$start_date' AND '$end_date' ";
3131
}
3232

3333
// Lab filter
34-
if (isset($_POST['labName']) && trim((string) $_POST['labName']) != '') {
34+
if (isset($_POST['labName']) && trim((string) $_POST['labName']) !== '') {
3535
$sWhere[] = " t.lab_id IN (" . $_POST['labName'] . ")";
3636
}
3737

3838
// State filter
39-
if (isset($_POST['state']) && trim((string) $_POST['state']) != '') {
39+
if (isset($_POST['state']) && trim((string) $_POST['state']) !== '') {
4040
$provinceId = implode(',', $_POST['state']);
4141
$sWhere[] = " f.facility_state_id IN ($provinceId)";
4242
}
4343

4444
// District filter
45-
if (isset($_POST['district']) && trim((string) $_POST['district']) != '') {
45+
if (isset($_POST['district']) && trim((string) $_POST['district']) !== '') {
4646
$districtId = implode(',', $_POST['district']);
4747
$sWhere[] = " f.facility_district_id IN ($districtId)";
4848
}
4949

5050
// Facility filter
51-
if (isset($_POST['facilityId']) && trim((string) $_POST['facilityId']) != '') {
51+
if (isset($_POST['facilityId']) && trim((string) $_POST['facilityId']) !== '') {
5252
$facilityId = implode(',', $_POST['facilityId']);
5353
$sWhere[] = " t.facility_id IN ($facilityId)";
5454
}
5555

56-
$whereSql = !empty($sWhere) ? (' WHERE ' . implode(' AND ', $sWhere)) : '';
56+
$whereSql = $sWhere === [] ? ('') : ' WHERE ' . implode(' AND ', $sWhere);
5757

5858
// Add facility join if needed for geographic filters
5959
$facilityJoin = '';
@@ -89,18 +89,18 @@
8989
$duplicatesWhere = [];
9090

9191
// Date range filter
92-
if (isset($_POST['dateRange']) && trim((string) $_POST['dateRange']) != '') {
92+
if (isset($_POST['dateRange']) && trim((string) $_POST['dateRange']) !== '') {
9393
[$start_date, $end_date] = DateUtility::convertDateRange($_POST['dateRange'] ?? '', includeTime: true);
9494
$duplicatesWhere[] = " t1.request_created_datetime BETWEEN '$start_date' AND '$end_date' ";
9595
}
9696

9797
// Lab filter
98-
if (isset($_POST['labName']) && trim((string) $_POST['labName']) != '') {
98+
if (isset($_POST['labName']) && trim((string) $_POST['labName']) !== '') {
9999
$duplicatesWhere[] = " t1.lab_id IN (" . $_POST['labName'] . ")";
100100
}
101101

102102
// Facility filter
103-
if (isset($_POST['facilityId']) && trim((string) $_POST['facilityId']) != '') {
103+
if (isset($_POST['facilityId']) && trim((string) $_POST['facilityId']) !== '') {
104104
$facilityId = implode(',', $_POST['facilityId']);
105105
$duplicatesWhere[] = " t1.facility_id IN ($facilityId)";
106106
}
@@ -110,12 +110,12 @@
110110
if (isset($_POST['state']) || isset($_POST['district'])) {
111111
$duplicatesFacilityJoin = ' LEFT JOIN facility_details as f1 ON t1.facility_id = f1.facility_id ';
112112

113-
if (isset($_POST['state']) && trim((string) $_POST['state']) != '') {
113+
if (isset($_POST['state']) && trim((string) $_POST['state']) !== '') {
114114
$provinceId = implode(',', $_POST['state']);
115115
$duplicatesWhere[] = " f1.facility_state_id IN ($provinceId)";
116116
}
117117

118-
if (isset($_POST['district']) && trim((string) $_POST['district']) != '') {
118+
if (isset($_POST['district']) && trim((string) $_POST['district']) !== '') {
119119
$districtId = implode(',', $_POST['district']);
120120
$duplicatesWhere[] = " f1.facility_district_id IN ($districtId)";
121121
}
@@ -130,7 +130,7 @@
130130
$duplicatesWhere[] = " (t1.$patientFirstNameColumn IS NOT NULL OR t1.$patientIdColumn IS NOT NULL) ";
131131
$duplicatesWhere[] = " t1.sample_collection_date IS NOT NULL ";
132132

133-
$duplicatesWhereSql = !empty($duplicatesWhere) ? (' WHERE ' . implode(' AND ', $duplicatesWhere)) : '';
133+
$duplicatesWhereSql = $duplicatesWhere === [] ? ('') : ' WHERE ' . implode(' AND ', $duplicatesWhere);
134134

135135
$duplicatesQuery = "
136136
SELECT COUNT(*) as duplicateSuspects

app/admin/api-dashboard/get-duplicate-suspects.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
// get-duplicate-suspects.php - Aggregated by facility
3-
3+
use Laminas\Diactoros\ServerRequest;
44
use App\Services\TestsService;
55
use App\Utilities\DateUtility;
66
use App\Utilities\JsonUtility;
@@ -9,7 +9,7 @@
99
use App\Services\DatabaseService;
1010
use App\Registries\ContainerRegistry;
1111

12-
/** @var Laminas\Diactoros\ServerRequest $request */
12+
/** @var ServerRequest $request */
1313
$request = AppRegistry::get('request');
1414
$_POST = _sanitizeInput($request->getParsedBody());
1515

@@ -24,30 +24,30 @@
2424
$sWhere = [];
2525

2626
// Date range filter
27-
if (isset($_POST['dateRange']) && trim((string) $_POST['dateRange']) != '') {
27+
if (isset($_POST['dateRange']) && trim((string) $_POST['dateRange']) !== '') {
2828
[$start_date, $end_date] = DateUtility::convertDateRange($_POST['dateRange'] ?? '', includeTime: true);
2929
$sWhere[] = " t1.request_created_datetime BETWEEN '$start_date' AND '$end_date' ";
3030
}
3131

3232
// Lab filter
33-
if (isset($_POST['labName']) && trim((string) $_POST['labName']) != '') {
33+
if (isset($_POST['labName']) && trim((string) $_POST['labName']) !== '') {
3434
$sWhere[] = " t1.lab_id IN (" . $_POST['labName'] . ")";
3535
}
3636

3737
// State filter
38-
if (isset($_POST['state']) && trim((string) $_POST['state']) != '') {
38+
if (isset($_POST['state']) && trim((string) $_POST['state']) !== '') {
3939
$provinceId = implode(',', $_POST['state']);
4040
$sWhere[] = " f.facility_state_id IN ($provinceId)";
4141
}
4242

4343
// District filter
44-
if (isset($_POST['district']) && trim((string) $_POST['district']) != '') {
44+
if (isset($_POST['district']) && trim((string) $_POST['district']) !== '') {
4545
$districtId = implode(',', $_POST['district']);
4646
$sWhere[] = " f.facility_district_id IN ($districtId)";
4747
}
4848

4949
// Facility filter
50-
if (isset($_POST['facilityId']) && trim((string) $_POST['facilityId']) != '') {
50+
if (isset($_POST['facilityId']) && trim((string) $_POST['facilityId']) !== '') {
5151
$facilityId = implode(',', $_POST['facilityId']);
5252
$sWhere[] = " t1.facility_id IN ($facilityId)";
5353
}
@@ -61,7 +61,7 @@
6161
$sWhere[] = " (t1.$patientFirstNameColumn IS NOT NULL OR t1.$patientIdColumn IS NOT NULL) ";
6262
$sWhere[] = " t1.sample_collection_date IS NOT NULL ";
6363

64-
$whereSql = !empty($sWhere) ? ('WHERE ' . implode(' AND ', $sWhere)) : '';
64+
$whereSql = $sWhere === [] ? ('') : 'WHERE ' . implode(' AND ', $sWhere);
6565

6666
// Facility join for geographic filters
6767
$facilityJoin = 'LEFT JOIN facility_details as f ON t1.facility_id = f.facility_id';

0 commit comments

Comments
 (0)