X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDI.php;h=ed67efe0034ceadaf0ac9c63fb5275899746ae9d;hb=66fec8944f4af97260e4abdee4279e7cf18e5b48;hp=9e96ddc0158cd824e8d4cd97f6be4e357c4dbab3;hpb=29c7552df57c31d81e8ce2458e2873f4d2ece35e;p=friendica.git diff --git a/src/DI.php b/src/DI.php index 9e96ddc015..ed67efe003 100644 --- a/src/DI.php +++ b/src/DI.php @@ -39,6 +39,17 @@ abstract class DI self::$dice = $dice; } + /** + * Returns a clone of the current dice instance + * This usefull for overloading the current instance with mocked methods during tests + * + * @return Dice + */ + public static function getDice() + { + return clone self::$dice; + } + // // common instances // @@ -123,6 +134,14 @@ abstract class DI return self::$dice->create(Content\Item::class); } + /** + * @return Content\Conversation + */ + public static function conversation() + { + return self::$dice->create(Content\Conversation::class); + } + /** * @return Content\Text\BBCode\Video */ @@ -387,11 +406,19 @@ abstract class DI } /** - * @return Model\Storage\ISelectableStorage + * @return Model\Storage\IWritableStorage */ public static function storage() { - return self::$dice->create(Model\Storage\ISelectableStorage::class); + return self::$dice->create(Model\Storage\IWritableStorage::class); + } + + /** + * @return Model\Log\ParsedLogIterator + */ + public static function parsedLogIterator() + { + return self::$dice->create(Model\Log\ParsedLogIterator::class); } // @@ -399,11 +426,11 @@ abstract class DI // /** - * @return Network\IHTTPRequest + * @return Network\IHTTPClient */ - public static function httpRequest() + public static function httpClient() { - return self::$dice->create(Network\IHTTPRequest::class); + return self::$dice->create(Network\IHTTPClient::class); } //