Removed implicit ::getApp() instance and added docblock

This commit is contained in:
Philipp Holzer 2019-02-05 21:54:55 +01:00
parent 0d096cf32e
commit 800dbc7f44
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
3 changed files with 18 additions and 24 deletions

View file

@ -6,9 +6,7 @@ namespace Friendica;
require_once 'boot.php';
use Friendica\Core\Config;
use Friendica\Factory;
use Friendica\Util\BasePath;
use Friendica\Network\HTTPException\InternalServerErrorException;
/**
* Basic object
@ -30,11 +28,7 @@ class BaseObject
public static function getApp()
{
if (empty(self::$app)) {
$basedir = BasePath::create(dirname(__DIR__));
$configLoader = new Config\ConfigCacheLoader($basedir);
$config = Factory\ConfigFactory::createCache($configLoader);
$logger = Factory\LoggerFactory::create('app', $config);
self::$app = new App($config, $logger);
throw new InternalServerErrorException('App isn\' initialized.');
}
return self::$app;