]> git.mxchange.org Git - friendica.git/commitdiff
Replace static calls of DI::app() with DI::apphelper()
authorArt4 <art4@wlabs.de>
Wed, 6 Nov 2024 07:57:43 +0000 (07:57 +0000)
committerArt4 <art4@wlabs.de>
Wed, 6 Nov 2024 07:57:43 +0000 (07:57 +0000)
mod/item.php
src/Module/Api/Friendica/Events/Create.php
src/Module/Settings/Account.php
src/Protocol/Feed.php
src/Util/Temporal.php

index 445e2ebc22789a0653f2a43821b7e1fc54668f8b..c195ce09fcf0da3c12bd44b6a864727df229dfa4 100644 (file)
@@ -284,7 +284,7 @@ function item_process(array $post, array $request, bool $preview, string $return
        unset($post['api_source']);
 
        if (!empty($request['scheduled_at'])) {
-               $scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::app()->getTimeZone());
+               $scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::apphelper()->getTimeZone());
                if ($scheduled_at > DateTimeFormat::utcNow()) {
                        unset($post['created']);
                        unset($post['edited']);
index 4eaad3d1ed08fe5e492a55239028f0c7df354a34..fdde2e9c18409926c2dad5adba81582936865363 100644 (file)
@@ -59,11 +59,11 @@ class Create extends BaseApi
                        $finish   = DBA::NULL_DATETIME;
                        $nofinish = true;
                } else {
-                       $finish   = DateTimeFormat::convert($request['end_time'], 'UTC', DI::app()->getTimeZone());
+                       $finish   = DateTimeFormat::convert($request['end_time'], 'UTC', DI::apphelper()->getTimeZone());
                        $nofinish = false;
                }
 
-               $start = DateTimeFormat::convert($request['start_time'], 'UTC', DI::app()->getTimeZone());
+               $start = DateTimeFormat::convert($request['start_time'], 'UTC', DI::apphelper()->getTimeZone());
 
                // create event
                $event = [];
index 8e8bd5a9098403543f8824b1dc5f53813af8af4d..6c8a4734703f6bc7e101cb2afd52d5eaeb8694d2 100644 (file)
@@ -40,8 +40,6 @@ class Account extends BaseSettings
 
                self::checkFormSecurityTokenRedirectOnError($redirectUrl, 'settings');
 
-               $a = DI::app();
-
                $user = User::getById($this->session->getLocalUserId());
 
                if (!empty($request['password-submit'])) {
@@ -111,7 +109,7 @@ class Account extends BaseSettings
                        }
 
                        if (strlen($timezone) && $timezone != $user['timezone']) {
-                               $a->setTimeZone($timezone);
+                               DI::apphelper()->setTimeZone($timezone);
                        }
 
                        $fields = [
@@ -383,8 +381,6 @@ class Account extends BaseSettings
                        return '';
                }
 
-               $a = DI::app();
-
                $user = User::getById($this->session->getLocalUserId());
 
                $username         = $user['username'];
@@ -404,7 +400,7 @@ class Account extends BaseSettings
                $expire_network_only = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'network_only', false);
 
                if (!strlen($user['timezone'])) {
-                       $timezone = $a->getTimeZone();
+                       $timezone = DI::apphelper()->getTimeZone();
                }
 
                // Set the account type to "Community" when the page is a community page but the account type doesn't fit
index 999f88febca373ae24229af1fd7bc35afe989b6f..9800fd24338645475512759e4b63e6c8277ac127 100644 (file)
@@ -556,7 +556,7 @@ class Feed
                                Logger::info('Feed is too old', ['created' => $item['created'], 'uid' => $item['uid'], 'uri' => $item['uri']]);
                                continue;
                        }
-                       
+
                        if (!empty($item['plink'])) {
                                $fetch_further_information = $contact['fetch_further_information'] ?? LocalRelationship::FFI_NONE;
                        } else {
@@ -1014,7 +1014,7 @@ class Feed
 
                // Display events in the user's timezone
                if (strlen($owner['timezone'])) {
-                       DI::app()->setTimeZone($owner['timezone']);
+                       DI::apphelper()->setTimeZone($owner['timezone']);
                }
 
                $previous_created = $last_update;
index d3ed34690800f5b44c5d9e8ffef67ca6068c4c81..64ab47b98c248d16f9cea6ee284b86472bc23004 100644 (file)
@@ -264,7 +264,7 @@ class Temporal
                                $input_text,
                                DI::l10n()->t(
                                        'Time zone: <strong>%s</strong> <a href="%s">Change in Settings</a>',
-                                       str_replace('_', ' ', DI::app()->getTimeZone()) . ' (GMT ' . DateTimeFormat::localNow('P') . ')',
+                                       str_replace('_', ' ', DI::apphelper()->getTimeZone()) . ' (GMT ' . DateTimeFormat::localNow('P') . ')',
                                        DI::baseUrl() . '/settings'
                                ),
                                $required ? '*' : '',