X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FBaseObject.php;h=4a6fa12d24b03ad18f4542114f1302d8a9e3573e;hb=3cd654e76f32dbcf505aef6a60a3e42d318f8b61;hp=01957164c10bd664fbd536b2f6c0680b5af8e9c9;hpb=1a60401d69e7d340e135c258eb058e88419151e9;p=friendica.git diff --git a/src/BaseObject.php b/src/BaseObject.php index 01957164c1..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 * @@ -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; }