From ecaed2a8450ab8423b4e5ef60ac9a249be60901a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 2 Dec 2021 09:07:54 -0500 Subject: [PATCH] Update DateTimeFormat documentation - Remove an explicit default value parameter --- src/Module/Api/ApiResponse.php | 2 +- src/Security/OAuth.php | 2 +- src/Util/DateTimeFormat.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Module/Api/ApiResponse.php b/src/Module/Api/ApiResponse.php index 8f4931383..c4b9b1e94 100644 --- a/src/Module/Api/ApiResponse.php +++ b/src/Module/Api/ApiResponse.php @@ -103,7 +103,7 @@ class ApiResponse extends Response 'alternate' => $user_info['url'], 'self' => $this->baseUrl . '/' . $this->args->getQueryString(), 'base' => $this->baseUrl, - 'updated' => DateTimeFormat::utc(null, DateTimeFormat::API), + 'updated' => DateTimeFormat::utcNow(DateTimeFormat::API), 'atom_updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM), 'language' => $user_info['lang'], 'logo' => $this->baseUrl . '/images/friendica-32.png', diff --git a/src/Security/OAuth.php b/src/Security/OAuth.php index 2f5dd3964..b3573fd68 100644 --- a/src/Security/OAuth.php +++ b/src/Security/OAuth.php @@ -176,7 +176,7 @@ class OAuth 'write' => (stripos($scope, BaseApi::SCOPE_WRITE) !== false), 'follow' => (stripos($scope, BaseApi::SCOPE_FOLLOW) !== false), 'push' => (stripos($scope, BaseApi::SCOPE_PUSH) !== false), - 'created_at' => DateTimeFormat::utcNow(DateTimeFormat::MYSQL)]; + 'created_at' => DateTimeFormat::utcNow()]; foreach ([BaseApi::SCOPE_READ, BaseApi::SCOPE_WRITE, BaseApi::SCOPE_WRITE, BaseApi::SCOPE_PUSH] as $scope) { if ($fields[$scope] && !$application[$scope]) { diff --git a/src/Util/DateTimeFormat.php b/src/Util/DateTimeFormat.php index 141fa37f6..af1c0fc7a 100644 --- a/src/Util/DateTimeFormat.php +++ b/src/Util/DateTimeFormat.php @@ -52,7 +52,7 @@ class DateTimeFormat * @return string * @throws Exception */ - public static function utc($time, $format = self::MYSQL) + public static function utc(string $time, string $format = self::MYSQL): string { return self::convert($time, 'UTC', 'UTC', $format); } @@ -102,7 +102,7 @@ class DateTimeFormat * @return string * @throws Exception */ - public static function utcNow($format = self::MYSQL) + public static function utcNow(string $format = self::MYSQL): string { return self::utc('now', $format); }