]> git.mxchange.org Git - friendica.git/commitdiff
Update DateTimeFormat documentation
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 2 Dec 2021 14:07:54 +0000 (09:07 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 4 Dec 2021 22:52:01 +0000 (17:52 -0500)
- Remove an explicit default value parameter

src/Module/Api/ApiResponse.php
src/Security/OAuth.php
src/Util/DateTimeFormat.php

index 8f493138390ec3299c308c8eba44f36511628d37..c4b9b1e943162f4bbbd8475c65ebf0c9ff5727cc 100644 (file)
@@ -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',
index 2f5dd396410bba4f1634b34ec5b7af415b71272d..b3573fd68ff86bec8f6314203f6a96729d8202e4 100644 (file)
@@ -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]) {
index 141fa37f6c3b70c7e87cc855cb5f189b3c55b8f4..af1c0fc7acc3574239c5f5e82c115e6e21e89f0c 100644 (file)
@@ -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);
        }