Skip to content

Commit b1953fd

Browse files
authored
Merge pull request #795 from dschreck/master
importing DateTime and DateTimeZone from the global namespace
2 parents 0365883 + f77eb9f commit b1953fd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Jenssegers/Mongodb/Auth/DatabaseTokenRepository.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
use Illuminate\Auth\Passwords\DatabaseTokenRepository as BaseDatabaseTokenRepository;
44
use MongoDB\BSON\UTCDateTime;
5+
use DateTime;
6+
use DateTimeZone;
57

68
class DatabaseTokenRepository extends BaseDatabaseTokenRepository
79
{
@@ -28,7 +30,7 @@ protected function tokenExpired($token)
2830
// Convert UTCDateTime to a date string.
2931
if ($token['created_at'] instanceof UTCDateTime) {
3032
$date = $token['created_at']->toDateTime();
31-
$date->setTimezone(new \DateTimeZone(date_default_timezone_get()));
33+
$date->setTimezone(new DateTimeZone(date_default_timezone_get()));
3234
$token['created_at'] = $date->format('Y-m-d H:i:s');
3335
} elseif (is_array($token['created_at']) and isset($token['created_at']['date'])) {
3436
$date = new \DateTime($token['created_at']['date'], new \DateTimeZone(isset($token['created_at']['timezone']) ? $token['created_at']['timezone'] : 'UTC'));

0 commit comments

Comments
 (0)