]> git.mxchange.org Git - friendica.git/commitdiff
Nodeinfo::getOrganization() doesn't need configuration object being inserted
authorRoland Häder <roland@mxchange.org>
Sat, 18 Jun 2022 15:56:01 +0000 (17:56 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 18 Jun 2022 15:56:33 +0000 (17:56 +0200)
when you have DI::config() around.

src/Model/Nodeinfo.php
src/Module/NodeInfo210.php

index 2fd05af64a4347ed624ecd9086ca527bf8dd288c..398666185df1055afb57d194418cdc0e076163fe 100644 (file)
@@ -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)) {
index 7e9291b4928947c077e4b6f64d6a01f2d04b23c8..99b2fd05a857ed61174941ee5d329e2ff03e333a 100644 (file)
@@ -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,