mirror of
https://github.com/friendica/friendica
synced 2025-04-26 16:30:12 +00:00
Fix tests
This commit is contained in:
parent
2a87464c97
commit
07aaf292ec
12 changed files with 134 additions and 144 deletions
|
@ -42,7 +42,7 @@ class BaseObject
|
|||
*/
|
||||
public static function getApp()
|
||||
{
|
||||
return self::$dice->create(App::class);
|
||||
return self::getClass(App::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,8 +54,12 @@ class BaseObject
|
|||
*
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public static function getClass(string $name)
|
||||
protected static function getClass(string $name)
|
||||
{
|
||||
if (empty(self::$dice)) {
|
||||
throw new InternalServerErrorException('DICE isn\'t initialized.');
|
||||
}
|
||||
|
||||
if (class_exists($name) || interface_exists($name )) {
|
||||
return self::$dice->create($name);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue