X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseObject.php;h=4a6fa12d24b03ad18f4542114f1302d8a9e3573e;hb=a73235b6eee32f41895eb5d4098e40d6a363caaf;hp=5adfe096d7dac1df67b1c1b481e1cb90e8071533;hpb=04589ecd38d85df339a3fed320d2822520b686f2;p=friendica.git diff --git a/src/BaseObject.php b/src/BaseObject.php index 5adfe096d7..4a6fa12d24 100644 --- a/src/BaseObject.php +++ b/src/BaseObject.php @@ -6,6 +6,8 @@ namespace Friendica; require_once 'boot.php'; +use Friendica\Network\HTTPException\InternalServerErrorException; + /** * Basic object * @@ -21,26 +23,25 @@ class BaseObject * Same as get_app from boot.php * * @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; }