class AccessibilityProvider {
- /** @var string */
- protected $appName;
+ protected string $appName;
+ private IURLGenerator $urlGenerator;
+ private IL10N $l;
- /** @var IURLGenerator */
- private $urlGenerator;
-
- /** @var IL10N */
- private $l;
-
- /**
- * Account constructor.
- *
- * @param string $appName
- * @param IURLGenerator $urlGenerator
- * @param IL10N $l
- */
public function __construct(string $appName,
IURLGenerator $urlGenerator,
IL10N $l) {
$this->l = $l;
}
- public function getThemes() {
+ /**
+ * @psalm-return array<array-key, array{id: string, img: string, title: string, enableLabel: string, text: string}>
+ */
+ public function getThemes(): array {
return [
[
'id' => 'dark',
];
}
- public function getHighContrast() {
+ /**
+ * @psalm-return array{id: string, img: string, title: string, enableLabel: string, text: string}
+ */
+ public function getHighContrast(): array {
return [
'id' => 'highcontrast',
'img' => $this->urlGenerator->imagePath($this->appName, 'mode-highcontrast.jpg'),
];
}
- public function getFonts() {
+ /**
+ * @psalm-return array<array-key, array{id: string, img: string, title: string, enableLabel: string, text: string}>
+ */
+ public function getFonts(): array {
return [
[
'id' => 'fontdyslexic',
class AccessibilityController extends Controller {
- /** @var string */
- protected $appName;
-
- /** @var string */
- protected $serverRoot;
-
- /** @var IConfig */
- private $config;
-
- /** @var LoggerInterface */
- private $logger;
-
- /** @var ITimeFactory */
- protected $timeFactory;
-
- /** @var IUserSession */
- private $userSession;
-
- /** @var IconsCacher */
- protected $iconsCacher;
-
- /** @var \OC_Defaults */
- private $defaults;
-
- /** @var null|string */
- private $injectedVariables;
-
- /** @var string */
- private $appRoot;
+ protected string $serverRoot;
+ private IConfig $config;
+ private LoggerInterface $logger;
+ protected ITimeFactory $timeFactory;
+ private IUserSession $userSession;
+ protected IconsCacher $iconsCacher;
+ private \OC_Defaults $defaults;
+ private ?string $injectedVariables = null;
+ private string $appRoot;
+ /**
+ * @param string $appName
+ */
public function __construct(string $appName,
IRequest $request,
IConfig $config,
* @PublicPage
* @NoCSRFRequired
* @NoSameSiteCookieRequired
- *
- * @return DataDisplayResponse
*/
public function getCss(): DataDisplayResponse {
$css = '';
/**
* Return an array with the user theme & font settings
- *
- * @return array
*/
private function getUserValues(): array {
$userTheme = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false);
/**
* Add the correct uri prefix to make uri valid again
- *
- * @param string $css
- * @param string $webDir
- * @return string
*/
private function rebaseUrls(string $css, string $webDir): string {
$re = '/url\([\'"]([^\/][\.\w?=\/-]*)[\'"]\)/x';
* Remove all matches from the $rule regex
*
* @param string $css string to parse
- * @return string
*/
- private function invertSvgIconsColor(string $css) {
+ private function invertSvgIconsColor(string $css): string {
return str_replace(
['color=000&', 'color=fff&', 'color=***&'],
['color=***&', 'color=000&', 'color=fff&'],
class ConfigController extends OCSController {
- /** @var string */
- protected $appName;
-
- /** @var string */
- protected $userId;
-
- /** @var string */
- protected $serverRoot;
-
- /** @var IConfig */
- private $config;
-
- /** @var IUserSession */
- private $userSession;
-
- /** @var AccessibilityProvider */
- private $accessibilityProvider;
+ protected string $userId;
+ private IConfig $config;
+ private IUserSession $userSession;
+ private AccessibilityProvider $accessibilityProvider;
/**
* Config constructor.
- *
- * @param string $appName
- * @param IRequest $request
- * @param IConfig $config
- * @param IUserSession $userSession
- * @param AccessibilityProvider $accessibilityProvider
*/
public function __construct(string $appName,
IRequest $request,
IUserSession $userSession,
AccessibilityProvider $accessibilityProvider) {
parent::__construct($appName, $request);
- $this->appName = $appName;
$this->config = $config;
$this->userSession = $userSession;
$this->accessibilityProvider = $accessibilityProvider;
*
* Set theme or font config
*
- * @param string $key theme or font
+ * @param string $key the theme or font
+ * @param string|false $value the value
* @return DataResponse
* @throws OCSBadRequestException|PreConditionNotMetException
*/
class RepairUserConfig implements IRepairStep {
- /** @var IUserManager */
- protected $userManager;
-
- /** @var IConfig */
- protected $config;
+ protected IUserManager $userManager;
+ protected IConfig $config;
/**
* MigrateUserConfig constructor.
- *
- * @param IConfig $config
- * @param IUserManager $userManager
*/
public function __construct(IConfig $config,
IUserManager $userManager) {
use OCP\IUserSession;
class JSDataService extends InitialStateProvider {
- /** @var IUserSession */
- private $userSession;
- /** @var IConfig */
- private $config;
+ private IUserSession $userSession;
+ private IConfig $config;
public function __construct(
IUserSession $userSession,