X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDI.php;h=4645ea252db915cfe171c8cccad5771fa4f8c18d;hb=a19a7dc2a0c0a22fd306e162383ef7117c1baca2;hp=02620ea11eac21ce38e78c87dccf06ee02675694;hpb=fd73b0e1d2866701ed48d432ebcc0b32ee10a09f;p=friendica.git diff --git a/src/DI.php b/src/DI.php index 02620ea11e..4645ea252d 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 // @@ -387,11 +398,19 @@ abstract class DI } /** - * @return Model\Storage\IStorage + * @return Model\Storage\IWritableStorage */ public static function storage() { - return self::$dice->create(Model\Storage\IStorage::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 +418,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); } //