X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDI.php;h=e34df7b669382deebb3804f8228da7ecc8b42af9;hb=036b565a7846916f763ce1dcbcaade0844ff1589;hp=8ee7004408aecb828941f9db927aba1715678ac4;hpb=184f6cc255ff40e4db428bc256127403b03bd087;p=friendica.git diff --git a/src/DI.php b/src/DI.php index 8ee7004408..e34df7b669 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 */ @@ -314,6 +326,14 @@ abstract class DI return self::$dice->create(Factory\Api\Mastodon\FollowRequest::class); } + /** + * @return Factory\Api\Mastodon\Poll + */ + public static function mstdnPoll() + { + return self::$dice->create(Factory\Api\Mastodon\Poll::class); + } + /** * @return Factory\Api\Mastodon\Relationship */ @@ -362,6 +382,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 +407,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 +438,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 +495,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 +540,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); } //