X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDI.php;h=835f1ffed72619e8412a5a32be08c94527c56475;hb=8e2cc678dc38b3e3447baf587668f2c97b0f5478;hp=5ba7e88db1f00379891b1e97d33d7352a81cbd01;hpb=2ab0d06996410f68cf501e6e2014bf4829b121ae;p=friendica.git diff --git a/src/DI.php b/src/DI.php index 5ba7e88db1..835f1ffed7 100644 --- a/src/DI.php +++ b/src/DI.php @@ -1,6 +1,6 @@ create(App\Mode::class); } - /** - * @return App\Module - */ - public static function module() - { - return self::$dice->create(App\Module::class); - } - /** * @return App\Page */ @@ -195,11 +187,11 @@ abstract class DI } /** - * @return Core\Process + * @return Core\Worker\Repository\Process */ public static function process() { - return self::$dice->create(Core\Process::class); + return self::$dice->create(Core\Worker\Repository\Process::class); } /** @@ -218,10 +210,30 @@ abstract class DI return self::$dice->create(Core\Storage\Repository\StorageManager::class); } + /** + * @return \Friendica\Core\System + */ + public static function system() + { + return self::$dice->create(Core\System::class); + } + // // "LoggerInterface" instances // + /** + * Flushes the Logger instance, so the factory is called again + * (creates a new id and retrieves the current PID) + */ + public static function flushLogger() + { + $flushDice = self::$dice + ->addRule(LoggerInterface::class, self::$dice->getRule(LoggerInterface::class)) + ->addRule('$devLogger', self::$dice->getRule('$devLogger')); + static::init($flushDice); + } + /** * @return LoggerInterface */ @@ -243,7 +255,7 @@ abstract class DI */ public static function workerLogger() { - return self::$dice->create(Util\Logger\WorkerLogger::class); + return self::$dice->create(Core\Logger\Type\WorkerLogger::class); } // @@ -362,6 +374,14 @@ abstract class DI return self::$dice->create(Factory\Api\Mastodon\Notification::class); } + /** + * @return Factory\Api\Twitter\Status + */ + public static function twitterStatus() + { + return self::$dice->create(Factory\Api\Twitter\Status::class); + } + /** * @return Factory\Api\Twitter\User */ @@ -379,11 +399,11 @@ abstract class DI // "Model" namespace instances // /** - * @return Model\Process + * @return \Friendica\Core\Worker\Repository\Process */ public static function modelProcess() { - return self::$dice->create(Model\Process::class); + return self::$dice->create(Core\Worker\Repository\Process::class); } /** @@ -410,16 +430,25 @@ abstract class DI return self::$dice->create(Model\Log\ParsedLogIterator::class); } + // + // "Module" namespace + // + + public static function apiResponse(): Module\Api\ApiResponse + { + return self::$dice->create(Module\Api\ApiResponse::class); + } + // // "Network" namespace // /** - * @return Network\IHTTPClient + * @return Network\HTTPClient\Capability\ICanSendHttpRequests */ public static function httpClient() { - return self::$dice->create(Network\IHTTPClient::class); + return self::$dice->create(Network\HTTPClient\Capability\ICanSendHttpRequests::class); } // @@ -458,6 +487,11 @@ abstract class DI return self::$dice->create(Contact\Introduction\Factory\Introduction::class); } + public static function localRelationship(): Contact\LocalRelationship\Repository\LocalRelationship + { + return self::$dice->create(Contact\LocalRelationship\Repository\LocalRelationship::class); + } + public static function permissionSet(): Security\PermissionSet\Repository\PermissionSet { return self::$dice->create(Security\PermissionSet\Repository\PermissionSet::class); @@ -498,9 +532,14 @@ abstract class DI return self::$dice->create(Navigation\Notifications\Factory\Notify::class); } - public static function formattedNotificationFactory(): Navigation\Notifications\Factory\FormattedNotification + public static function formattedNotificationFactory(): Navigation\Notifications\Factory\FormattedNotify + { + return self::$dice->create(Navigation\Notifications\Factory\FormattedNotify::class); + } + + public static function formattedNavNotificationFactory(): Navigation\Notifications\Factory\FormattedNavNotification { - return self::$dice->create(Navigation\Notifications\Factory\FormattedNotification::class); + return self::$dice->create(Navigation\Notifications\Factory\FormattedNavNotification::class); } //