diff options
author | Pytal <24800714+Pytal@users.noreply.github.com> | 2021-06-23 09:56:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 09:56:28 -0700 |
commit | 9ed379da22e4dd0b54fed4241798aec47d6e3f2c (patch) | |
tree | 279fb154fc813240ba34fa4cbbe525e9627e76b5 /lib/private | |
parent | 19a84512d688ae899f0f8efc37b89d2a9676cc48 (diff) | |
parent | 6d5cfe0c66f7010d552f0aa234a13c2e91a933bd (diff) | |
download | nextcloud-server-9ed379da22e4dd0b54fed4241798aec47d6e3f2c.tar.gz nextcloud-server-9ed379da22e4dd0b54fed4241798aec47d6e3f2c.zip |
Merge pull request #27635 from nextcloud/fix/datetime-constants
Fix usage of DateTime constants
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/AppFramework/Middleware/NotModifiedMiddleware.php | 2 | ||||
-rw-r--r-- | lib/private/Console/TimestampFormatter.php | 2 | ||||
-rw-r--r-- | lib/private/Files/ObjectStore/S3Signature.php | 2 | ||||
-rw-r--r-- | lib/private/Log/LogDetails.php | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php b/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php index dd3f202b6c1..4ebdf10f403 100644 --- a/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php +++ b/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php @@ -46,7 +46,7 @@ class NotModifiedMiddleware extends Middleware { } $modifiedSinceHeader = $this->request->getHeader('IF_MODIFIED_SINCE'); - if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format(\DateTime::RFC2822)) { + if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format(\DateTimeInterface::RFC2822)) { $response->setStatus(Http::STATUS_NOT_MODIFIED); return $response; } diff --git a/lib/private/Console/TimestampFormatter.php b/lib/private/Console/TimestampFormatter.php index fcaa6ebfbf1..59e480b39e8 100644 --- a/lib/private/Console/TimestampFormatter.php +++ b/lib/private/Console/TimestampFormatter.php @@ -103,7 +103,7 @@ class TimestampFormatter implements OutputFormatterInterface { $timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null; $time = new \DateTime('now', $timeZone); - $timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTime::ATOM)); + $timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTimeInterface::ATOM)); return $timestampInfo . ' ' . $this->formatter->format($message); } diff --git a/lib/private/Files/ObjectStore/S3Signature.php b/lib/private/Files/ObjectStore/S3Signature.php index ec2e6bbe3ac..1e5ef697835 100644 --- a/lib/private/Files/ObjectStore/S3Signature.php +++ b/lib/private/Files/ObjectStore/S3Signature.php @@ -129,7 +129,7 @@ class S3Signature implements SignatureInterface { ) { $modify = [ 'remove_headers' => ['X-Amz-Date'], - 'set_headers' => ['Date' => gmdate(\DateTime::RFC2822)] + 'set_headers' => ['Date' => gmdate(\DateTimeInterface::RFC2822)] ]; // Add the security token header if one is being used by the credentials diff --git a/lib/private/Log/LogDetails.php b/lib/private/Log/LogDetails.php index 5ca8231eecb..87ce0396594 100644 --- a/lib/private/Log/LogDetails.php +++ b/lib/private/Log/LogDetails.php @@ -37,7 +37,7 @@ abstract class LogDetails { public function logDetails(string $app, $message, int $level): array { // default to ISO8601 - $format = $this->config->getValue('logdateformat', \DateTime::ATOM); + $format = $this->config->getValue('logdateformat', \DateTimeInterface::ATOM); $logTimeZone = $this->config->getValue('logtimezone', 'UTC'); try { $timezone = new \DateTimeZone($logTimeZone); |