From f48c4fcbe4c7f8ec6e184c79ce670452b83cb0f1 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 9 Jan 2020 09:55:33 +0000 Subject: [PATCH] Issue 8081: The usage has to be an object, not an array --- src/Module/NodeInfo.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Module/NodeInfo.php b/src/Module/NodeInfo.php index a62687de1b..2f83a78b47 100644 --- a/src/Module/NodeInfo.php +++ b/src/Module/NodeInfo.php @@ -5,6 +5,7 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Core\Addon; use Friendica\DI; +use stdClass; /** * Standardized way of exposing metadata about a server running one of the distributed social networks. @@ -26,22 +27,22 @@ class NodeInfo extends BaseModule /** * Return the supported services * - * @return array with supported services + * @return Object with supported services */ private static function getUsage() { $config = DI::config(); - $usage = []; + $usage = new stdClass(); if (!empty($config->get('system', 'nodeinfo'))) { - $usage['users'] = [ + $usage->users = [ 'total' => intval($config->get('nodeinfo', 'total_users')), 'activeHalfyear' => intval($config->get('nodeinfo', 'active_users_halfyear')), 'activeMonth' => intval($config->get('nodeinfo', 'active_users_monthly')) ]; - $usage['localPosts'] = intval($config->get('nodeinfo', 'local_posts')); - $usage['localComments'] = intval($config->get('nodeinfo', 'local_comments')); + $usage->localPosts = intval($config->get('nodeinfo', 'local_posts')); + $usage->localComments = intval($config->get('nodeinfo', 'local_comments')); } return $usage;