Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use ThemeService and Theme interfaces internally
  • Loading branch information
phisch authored and Vincent Petry committed Aug 10, 2017
commit 8f55210cd6e7c20071eed09ac84d56f8e793f285
10 changes: 5 additions & 5 deletions lib/private/Template/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace OC\Template;

use OC\Theme\Theme;
use OCP\Theme\ITheme;

class Base {
/**
Expand All @@ -49,7 +49,7 @@ class Base {
private $l10n;

/**
* @var Theme
* @var ITheme
*/
protected $theme;

Expand All @@ -62,7 +62,7 @@ class Base {
* @param string $template
* @param string $requestToken
* @param \OCP\IL10N $l10n
* @param Theme $theme
* @param ITheme $theme
* @param \OC_Defaults $themeDefaults
*/
public function __construct($template, $requestToken, $l10n, $theme, $themeDefaults) {
Expand All @@ -77,7 +77,7 @@ public function __construct($template, $requestToken, $l10n, $theme, $themeDefau
/**
* @param string $serverRoot
* @param string|false $app_dir
* @param Theme $theme
* @param ITheme $theme
* @param string $app
* @return string[]
*/
Expand All @@ -97,7 +97,7 @@ protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) {

/**
* @param string $serverRoot
* @param Theme $theme
* @param ITheme $theme
* @return string[]
*/
protected function getCoreTemplateDirs($theme, $serverRoot) {
Expand Down
6 changes: 3 additions & 3 deletions lib/private/Template/ResourceLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

namespace OC\Template;

use OC\Theme\Theme;
use OCP\Theme\ITheme;

abstract class ResourceLocator {
/**
* @var Theme
* @var ITheme
*/
protected $theme;

Expand All @@ -48,7 +48,7 @@ abstract class ResourceLocator {

/**
* @param \OCP\ILogger $logger
* @param Theme $theme
* @param ITheme $theme
* @param array $core_map
* @param array $party_map
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/private/URLGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

namespace OC;
use OC\Theme\Theme;
use OCP\Theme\ITheme;
use OC_Defaults;
use OCP\ICacheFactory;
use OCP\IConfig;
Expand All @@ -48,7 +48,7 @@ class URLGenerator implements IURLGenerator {
private $cacheFactory;
/** @var IRouter */
private $router;
/** @var Theme */
/** @var ITheme */
private $theme;

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/private/legacy/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ public static function loadApp($app, $checkUpgrade = true) {
*/
private static function enableThemeIfApplicable($app) {
if (self::isType($app, 'theme')) {
/** @var \OC\Theme\ThemeService $themeManager */
$themeManager = \OC::$server->query('ThemeService');
$themeManager->setAppTheme($app);
/** @var \OCP\Theme\IThemeService $themeService */
$themeService = \OC::$server->query('ThemeService');
$themeService->setAppTheme($app);
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/private/legacy/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/

use OC\TemplateLayout;
use OC\Theme\Theme;
use OCP\Theme\ITheme;

require_once __DIR__.'/template/functions.php';

Expand Down Expand Up @@ -183,7 +183,7 @@ public static function initTemplateEngine($renderAs) {
*
* Will select the template file for the selected theme.
* Checking all the possible locations.
* @param Theme $theme
* @param ITheme $theme
* @param string $app
* @return string
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -1271,10 +1271,10 @@ public static function runningOnHhvm() {
* Handles the case that there may not be a theme, then check if a "default"
* theme exists and take that one
*
* @return \OC\Theme\Theme the theme
* @return \OCP\Theme\ITheme the theme
*/
public static function getTheme() {
/** @var \OC\Theme\ThemeService $themeService */
/** @var \OCP\Theme\IThemeService $themeService */
$themeService = \OC::$server->query('ThemeService');
return $themeService->getTheme();
}
Expand Down