Skip to content

Commit 049a77c

Browse files
committed
Resolve todo items for UTCDateTime construction
1 parent fa1523a commit 049a77c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/GridFS/WritableStream.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ public function __construct(CollectionWrapper $collectionWrapper, $filename, arr
8787
'_id' => $options['_id'],
8888
'chunkSize' => $this->chunkSize,
8989
'filename' => (string) $filename,
90-
// TODO: This is necessary until PHPC-536 is implemented
91-
'uploadDate' => new UTCDateTime((int) floor(microtime(true) * 1000)),
90+
'uploadDate' => new UTCDateTime,
9291
] + array_intersect_key($options, ['aliases' => 1, 'contentType' => 1, 'metadata' => 1]);
9392
}
9493

tests/GridFS/SpecFunctionalTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ private function convertTypes(array $data, $createBinary = true)
150150
}
151151

152152
if (isset($value['$date'])) {
153-
// TODO: This is necessary until PHPC-536 is implemented
154-
$milliseconds = floor((new DateTime($value['$date']))->format('U.u') * 1000);
155-
$value = new UTCDateTime((int) $milliseconds);
153+
$value = new UTCDateTime(new DateTime($value['$date']));
156154
return;
157155
}
158156

0 commit comments

Comments
 (0)