Skip to content

Commit fc32d0a

Browse files
committed
Fix method order
1 parent 6da793c commit fc32d0a

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/GridFS/CollectionWrapper.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,8 @@ public function deleteChunksByFilesId($id): void
8181
}
8282

8383
/**
84-
* Deletes a GridFS file and related chunks by ID.
85-
*
86-
* @param mixed $id
84+
* Delete all GridFS files and chunks for a given filename.
8785
*/
88-
public function deleteFileAndChunksById($id): void
89-
{
90-
$this->filesCollection->deleteOne(['_id' => $id]);
91-
$this->chunksCollection->deleteMany(['files_id' => $id]);
92-
}
93-
9486
public function deleteFileAndChunksByFilename(string $filename): int
9587
{
9688
/** @var iterable<array{_id: mixed}> $files */
@@ -112,6 +104,17 @@ public function deleteFileAndChunksByFilename(string $filename): int
112104
return $count ?? 0;
113105
}
114106

107+
/**
108+
* Deletes a GridFS file and related chunks by ID.
109+
*
110+
* @param mixed $id
111+
*/
112+
public function deleteFileAndChunksById($id): void
113+
{
114+
$this->filesCollection->deleteOne(['_id' => $id]);
115+
$this->chunksCollection->deleteMany(['files_id' => $id]);
116+
}
117+
115118
/**
116119
* Drops the GridFS files and chunks collections.
117120
*/

0 commit comments

Comments
 (0)