lazyLoaded[$ident])) { $this->lazyLoaded[$ident] = $callback(); } return $this->lazyLoaded[$ident]; } public static function getGlobal(): self { self::$globalInstance = self::$globalInstance ?? new self(); return self::$globalInstance; } public function textprocessors(): TextprocessorRepository { return $this->lazy("textprocessors", [TextprocessorRepository::class, 'buildDefault']); } public function database(): Database { return $this->lazy("database", static function () { global $config; return Database::fromConfig($config); }); } }