Skip to content

Commit 1f1e2ba

Browse files
refactor(core): remove silent error suppression operators across repository
- Removed all @ operators from file and IO functions - Prevents hidden runtime errors - Improves debugging and observability across the codebase Compliance: - No logic changes - No breaking changes - Repository-wide cleanup applied Co-authored-by: Maatify <130119162+Maatify@users.noreply.github.com>
1 parent bc65c0d commit 1f1e2ba

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

uploader/DownloadStreamFile.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ public function DownloadFile(): void
2020
}else{
2121
$file_type = strtolower(pathinfo((string)$this->file_path, PATHINFO_EXTENSION));
2222
header('Content-Disposition: attachment;filename="' . $this->file_saved_name . '-' . time() . '.' . $file_type . '"');
23-
$file = @fopen((string)$this->file_path, "rb");
23+
$file = fopen((string)$this->file_path, "rb");
2424
if ($file) {
2525
while (! feof($file)) {
2626
print(fread($file, 1024 * 8));
2727
flush();
2828
if (connection_status() != 0) {
29-
@fclose($file);
29+
fclose($file);
3030
die();
3131
}
3232
}
33-
@fclose($file);
33+
fclose($file);
3434
}
3535
}
3636
}

uploader/UploadBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function pushToStorage(string $localPath, string $relativePath): void
4444
return;
4545
}
4646
$this->storageAdapter->upload($localPath, $relativePath);
47-
@unlink($localPath);
47+
unlink($localPath);
4848
}
4949
/**
5050
* Set the upload folder.

uploader/UploadFolderCreate.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ protected function creatUploadFolder(): void
1717
{
1818
if (! file_exists($this->upload_folder)) {
1919
mkdir($this->upload_folder);
20-
$f = @fopen($this->upload_folder . '/index.php', 'a+');
20+
$f = fopen($this->upload_folder . '/index.php', 'a+');
2121
if ($f) {
22-
@fputs(
22+
fputs(
2323
$f,
2424
'<?php' . PHP_EOL
2525
. 'header("Location: https://" . $_SERVER[\'HTTP_HOST\'] . "/404.php");'
2626
. PHP_EOL
2727
);
28-
@fclose($f);
28+
fclose($f);
2929
}
3030
}
3131
}

0 commit comments

Comments
 (0)