From 94eb4261519be92b0dbccc90ac3a0f502aa0cecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Sat, 18 Jun 2022 17:56:01 +0200 Subject: [PATCH] Nodeinfo::getOrganization() doesn't need configuration object being inserted when you have DI::config() around. --- src/Model/Nodeinfo.php | 14 +++++++++----- src/Module/NodeInfo210.php | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Model/Nodeinfo.php b/src/Model/Nodeinfo.php index 2fd05af64..398666185 100644 --- a/src/Model/Nodeinfo.php +++ b/src/Model/Nodeinfo.php @@ -101,7 +101,7 @@ class Nodeinfo * * @return array with supported services */ - public static function getServices() + public static function getServices(): array { $services = [ 'inbound' => [], @@ -156,12 +156,16 @@ class Nodeinfo return $services; } - public static function getOrganization($config) + public static function getOrganization() { - $organization = ['name' => null, 'contact' => null, 'account' => null]; + $organization = [ + 'name' => null, + 'contact' => null, + 'account' => null + ]; - if (!empty($config->get('config', 'admin_email'))) { - $adminList = explode(',', str_replace(' ', '', $config->get('config', 'admin_email'))); + if (!empty(DI::config()->get('config', 'admin_email'))) { + $adminList = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email'))); $organization['contact'] = $adminList[0]; $administrator = User::getByEmail($adminList[0], ['username', 'nickname']); if (!empty($administrator)) { diff --git a/src/Module/NodeInfo210.php b/src/Module/NodeInfo210.php index 7e9291b49..99b2fd05a 100644 --- a/src/Module/NodeInfo210.php +++ b/src/Module/NodeInfo210.php @@ -57,7 +57,7 @@ class NodeInfo210 extends BaseModule 'software' => 'friendica', 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, ], - 'organization' => Nodeinfo::getOrganization($this->config), + 'organization' => Nodeinfo::getOrganization(), 'protocols' => ['dfrn', 'activitypub'], 'services' => [], 'openRegistrations' => intval($this->config->get('config', 'register_policy')) !== Register::CLOSED,