Update DateTimeFormat documentation
- Remove an explicit default value parameter
This commit is contained in:
parent
d62f21cfa1
commit
ecaed2a845
3 changed files with 4 additions and 4 deletions
|
@ -103,7 +103,7 @@ class ApiResponse extends Response
|
||||||
'alternate' => $user_info['url'],
|
'alternate' => $user_info['url'],
|
||||||
'self' => $this->baseUrl . '/' . $this->args->getQueryString(),
|
'self' => $this->baseUrl . '/' . $this->args->getQueryString(),
|
||||||
'base' => $this->baseUrl,
|
'base' => $this->baseUrl,
|
||||||
'updated' => DateTimeFormat::utc(null, DateTimeFormat::API),
|
'updated' => DateTimeFormat::utcNow(DateTimeFormat::API),
|
||||||
'atom_updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
'atom_updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||||
'language' => $user_info['lang'],
|
'language' => $user_info['lang'],
|
||||||
'logo' => $this->baseUrl . '/images/friendica-32.png',
|
'logo' => $this->baseUrl . '/images/friendica-32.png',
|
||||||
|
|
|
@ -176,7 +176,7 @@ class OAuth
|
||||||
'write' => (stripos($scope, BaseApi::SCOPE_WRITE) !== false),
|
'write' => (stripos($scope, BaseApi::SCOPE_WRITE) !== false),
|
||||||
'follow' => (stripos($scope, BaseApi::SCOPE_FOLLOW) !== false),
|
'follow' => (stripos($scope, BaseApi::SCOPE_FOLLOW) !== false),
|
||||||
'push' => (stripos($scope, BaseApi::SCOPE_PUSH) !== 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) {
|
foreach ([BaseApi::SCOPE_READ, BaseApi::SCOPE_WRITE, BaseApi::SCOPE_WRITE, BaseApi::SCOPE_PUSH] as $scope) {
|
||||||
if ($fields[$scope] && !$application[$scope]) {
|
if ($fields[$scope] && !$application[$scope]) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ class DateTimeFormat
|
||||||
* @return string
|
* @return string
|
||||||
* @throws Exception
|
* @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);
|
return self::convert($time, 'UTC', 'UTC', $format);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ class DateTimeFormat
|
||||||
* @return string
|
* @return string
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function utcNow($format = self::MYSQL)
|
public static function utcNow(string $format = self::MYSQL): string
|
||||||
{
|
{
|
||||||
return self::utc('now', $format);
|
return self::utc('now', $format);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue