Skip to content

Commit 84c9280

Browse files
committed
fix: remove error suppression from uploader
1 parent 932e12e commit 84c9280

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Flow/File.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function validateFile()
146146
*/
147147
public function save($destination)
148148
{
149-
$fh = fopen($destination, 'wb'); // TODO: find better way for handling warnings
149+
$fh = fopen($destination, 'wb');
150150
if (!$fh) {
151151
throw new FileOpenException('failed to open destination file: '.$destination);
152152
}
@@ -171,7 +171,7 @@ public function save($destination)
171171

172172
for ($i = 1; $i <= $totalChunks; $i++) {
173173
$file = $this->getChunkPath($i);
174-
$chunk = fopen($file, "rb"); // TODO: find better way for handling warnings
174+
$chunk = fopen($file, "rb");
175175

176176
if (!$chunk) {
177177
throw new FileOpenException('failed to open chunk: '.$file);

src/Flow/Uploader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Uploader
1414
*/
1515
public static function pruneChunks($chunksFolder, $expirationTime = 172800)
1616
{
17-
$handle = @opendir($chunksFolder); // TODO: find better way for handling warnings
17+
$handle = opendir($chunksFolder);
1818

1919
if (!$handle) {
2020
throw new FileOpenException('failed to open folder: '.$chunksFolder);

test/Unit/UploaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testUploader_pruneChunks()
6868
public function testUploader_exception()
6969
{
7070
try {
71-
Uploader::pruneChunks('not/existing/dir', 30);
71+
@Uploader::pruneChunks('not/existing/dir', 30);
7272
$this->fail();
7373
} catch (FileOpenException $e) {
7474
$this->assertSame('failed to open folder: not/existing/dir', $e->getMessage());

0 commit comments

Comments
 (0)