X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseObject.php;h=7e90478a9d613a378bf28dace96144a9b38f94b5;hb=5ed48ba4257b3017af5833e65a5ce58a23a35df3;hp=01957164c10bd664fbd536b2f6c0680b5af8e9c9;hpb=2ee928b0816094f3166c65b851bc7f6c84e9f3c9;p=friendica.git diff --git a/src/BaseObject.php b/src/BaseObject.php index 01957164c1..7e90478a9d 100644 --- a/src/BaseObject.php +++ b/src/BaseObject.php @@ -4,7 +4,9 @@ */ namespace Friendica; -require_once 'boot.php'; +require_once __DIR__ . '/../boot.php'; + +use Friendica\Network\HTTPException\InternalServerErrorException; /** * Basic object @@ -20,27 +22,26 @@ class BaseObject * * Same as get_app from boot.php * - * @return object + * @return App + * @throws \Exception */ public static function getApp() { - if (self::$app) { - return self::$app; + if (empty(self::$app)) { + throw new InternalServerErrorException('App isn\'t initialized.'); } - self::$app = get_app(); - return self::$app; } /** * Set the app * - * @param object $app App + * @param App $app App * * @return void */ - public static function setApp($app) + public static function setApp(App $app) { self::$app = $app; }