]> git.mxchange.org Git - friendica.git/blobdiff - src/DI.php
Merge remote-tracking branch 'upstream/develop' into conversation-moved
[friendica.git] / src / DI.php
index 5c56b45e132e250f8719a0d5bcd74a5c91a8614f..ed67efe0034ceadaf0ac9c63fb5275899746ae9d 100644 (file)
@@ -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
         */
@@ -409,7 +428,7 @@ abstract class DI
        /**
         * @return Network\IHTTPClient
         */
-       public static function httpRequest()
+       public static function httpClient()
        {
                return self::$dice->create(Network\IHTTPClient::class);
        }