6 use Friendica\Core\Cache\ICache;
7 use Friendica\Core\Config\Configuration;
8 use Friendica\Core\Config\PConfiguration;
9 use Friendica\Core\L10n\L10n;
10 use Friendica\Core\Lock\ILock;
11 use Friendica\Core\Session\ISession;
12 use Friendica\Database\Database;
13 use Friendica\Model\Notify;
14 use Friendica\Protocol\Activity;
15 use Friendica\Util\ACLFormatter;
16 use Friendica\Content;
17 use Friendica\Util\DateTimeFormat;
18 use Friendica\Util\FileSystem;
19 use Friendica\Util\Logger\WorkerLogger;
20 use Psr\Log\LoggerInterface;
23 * This class is capable of getting all dynamic created classes
25 * There has to be a "method" phpDoc for each new class, containing result class for a proper matching
27 * @method static App app()
28 * @method static ACLFormatter aclFormatter()
29 * @method static Notify notify()
30 * @method static Activity activity()
31 * @method static Content\Item contentItem()
32 * @method static Content\Text\BBCode\Video bbCodeVideo()
33 * @method static DateTimeFormat dtFormat()
34 * @method static ICache cache()
35 * @method static Configuration config()
36 * @method static PConfiguration pConfig()
37 * @method static ILock lock()
38 * @method static L10n l10n()
39 * @method static LoggerInterface logger()
40 * @method static LoggerInterface devLogger()
41 * @method static LoggerInterface workerLogger()
42 * @method static ISession session()
43 * @method static App\Authentication auth()
44 * @method static App\Arguments args()
45 * @method static App\BaseURL baseUrl()
46 * @method static App\Mode mode()
47 * @method static App\Module module()
48 * @method static App\Page page()
49 * @method static App\Router router()
50 * @method static Database dba()
51 * @method static FileSystem fs()
56 const CLASS_MAPPING = [
58 'aclFormatter' => ACLFormatter::class,
59 'auth' => App\Authentication::class,
60 'args' => App\Arguments::class,
61 'baseUrl' => App\BaseURL::class,
62 'mode' => App\Mode::class,
63 'module' => App\Module::class,
64 'page' => App\Page::class,
65 'router' => App\Router::class,
66 'notify' => Notify::class,
67 'activity' => Activity::class,
68 'contentItem' => Content\Item::class,
69 'bbCodeVideo' => Content\Text\BBCode\Video::class,
70 'dtFormat' => DateTimeFormat::class,
71 'cache' => ICache::class,
72 'config' => Configuration::class,
73 'pConfig' => PConfiguration::class,
74 'l10n' => L10n::class,
75 'lock' => ILock::class,
76 'logger' => LoggerInterface::class,
77 'workerLogger' => WorkerLogger::class,
78 'devLogger' => '$devLogger',
79 'session' => ISession::class,
80 'dba' => Database::class,
81 'fs' => FileSystem::class,
87 public static function init(Dice $dice)
92 public static function __callStatic($name, $arguments)
94 return self::$dice->create(self::CLASS_MAPPING[$name], $arguments);