X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDI.php;h=4645ea252db915cfe171c8cccad5771fa4f8c18d;hb=72fa4e99702cf2a745b9f742e5fefe9527c44e7d;hp=cbc353161cef34017a4f10a796982104d6ba5e2e;hpb=ec4f53d56f9aa2f82b1cf327a7f0869251fb1dbb;p=friendica.git diff --git a/src/DI.php b/src/DI.php index cbc353161c..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 // @@ -407,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); } //