Refactor `OC\Server::getThemingDefaults`

Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
pull/40125/head
Andrew Summers 9 months ago
parent 9d1547f59d
commit ce74bdcda2
No known key found for this signature in database
GPG Key ID: 1E0B639A223E3E2D

@ -173,7 +173,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
});
$this->registerService('OC_Defaults', function (ContainerInterface $c) {
return $c->get(IServerContainer::class)->getThemingDefaults();
return $c->get(IServerContainer::class)->get('ThemingDefaults');
});
$this->registerService('Protocol', function (ContainerInterface $c) {

@ -64,7 +64,7 @@ class Application {
IRequest $request,
LoggerInterface $logger,
MemoryInfo $memoryInfo) {
$defaults = \OC::$server->getThemingDefaults();
$defaults = \OC::$server->get('ThemingDefaults');
$this->config = $config;
$this->application = new SymfonyApplication($defaults->getName(), \OC_Util::getVersionString());
$this->dispatcher = $dispatcher;

@ -1341,7 +1341,7 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerService(Defaults::class, function (Server $c) {
return new Defaults(
$c->getThemingDefaults()
$c->get('ThemingDefaults')
);
});
/** @deprecated 19.0.0 */

@ -217,7 +217,7 @@ class URLGenerator implements IURLGenerator {
$themingEnabled = $this->config->getSystemValueBool('installed', false) && $this->getAppManager()->isEnabledForUser('theming');
$themingImagePath = false;
if ($themingEnabled) {
$themingDefaults = \OC::$server->getThemingDefaults();
$themingDefaults = \OC::$server->get('ThemingDefaults');
if ($themingDefaults instanceof ThemingDefaults) {
$themingImagePath = $themingDefaults->replaceImagePath($appName, $file);
}
@ -290,7 +290,7 @@ class URLGenerator implements IURLGenerator {
* @return string url to the online documentation
*/
public function linkToDocs(string $key): string {
$theme = \OC::$server->getThemingDefaults();
$theme = \OC::$server->get('ThemingDefaults');
return $theme->buildDocLinkToKey($key);
}

@ -52,7 +52,7 @@ class Defaults {
*/
public function __construct(\OC_Defaults $defaults = null) {
if ($defaults === null) {
$defaults = \OC::$server->getThemingDefaults();
$defaults = \OC::$server->get('ThemingDefaults');
}
$this->defaults = $defaults;
}

Loading…
Cancel
Save