X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDI.php;h=cc765fa529c1ec6c1a2f4c4974de013e957cdea6;hb=010d7fb723f703df28b2cdebeb870387ef30217c;hp=e5601f64d21aea2abb33b71eb8a14d907b1039c4;hpb=513ef03421f172221fe2457b79910ea944a35375;p=friendica.git diff --git a/src/DI.php b/src/DI.php index e5601f64d2..cc765fa529 100644 --- a/src/DI.php +++ b/src/DI.php @@ -37,6 +37,15 @@ abstract class DI /** @var Dice */ private static $dice; + /** + * Initialize the singleton DI container with the Dice instance + * + * @param Dice $dice The Dice instance + * @param bool $disableDepByHand If true, the database dependencies aren't set, thus any occurrence of logging or + * profiling in database methods would lead to an error. This flag is for testing only. + * + * @return void + */ public static function init(Dice $dice, bool $disableDepByHand = false) { self::$dice = $dice; @@ -48,8 +57,9 @@ abstract class DI /** * I HATE this method, but everything else needs refactoring at the database itself + * Set the database dependencies manually, because of current, circular dependencies between the database and the config table * - * @return void + * @todo Instead of this madness, split the database in a core driver-dependent (mysql, mariadb, postgresql, ..) part without any other dependency unlike credentials and in the full-featured, driver-independent database class with all dependencies */ public static function setCompositeRootDependencyByHand() { @@ -116,10 +126,7 @@ abstract class DI return self::$dice->create(App\Arguments::class); } - /** - * @return App\BaseURL - */ - public static function baseUrl() + public static function baseUrl(): App\BaseURL { return self::$dice->create(App\BaseURL::class); } @@ -372,14 +379,6 @@ abstract class DI return self::$dice->create(Factory\Api\Mastodon\Error::class); } - /** - * @return Factory\Api\Mastodon\FollowRequest - */ - public static function mstdnFollowRequest() - { - return self::$dice->create(Factory\Api\Mastodon\FollowRequest::class); - } - /** * @return Factory\Api\Mastodon\Poll */