From 90e182613400ed7281a3f5692433c23cefe29c8d Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 11 Jan 2021 17:17:37 +0000 Subject: [PATCH] ci: lint code to MediaWiki standards Check commit and GitHub actions for more details --- includes/CitizenHooks.php | 4 ++-- includes/SkinCitizen.php | 10 +++++----- resources/skins.citizen.styles/ThemeToggle.less | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/includes/CitizenHooks.php b/includes/CitizenHooks.php index f1c77c5e..5b775f1a 100644 --- a/includes/CitizenHooks.php +++ b/includes/CitizenHooks.php @@ -208,9 +208,9 @@ class CitizenHooks { * @return bool|void True or no return value to continue or false to abort */ public static function onPreferencesFormPreSave( $formData, $form, $user, &$result, $oldUserOptions ) { - if (isset($formData['CitizenThemeUser']) && $formData['CitizenThemeUser'] !== 'auto') { + if ( isset( $formData['CitizenThemeUser'] ) && $formData['CitizenThemeUser'] !== 'auto' ) { // Reset override cookie from theme toggle - $form->getOutput()->getRequest()->response()->setCookie('skin-citizen-theme-override', null); + $form->getOutput()->getRequest()->response()->setCookie( 'skin-citizen-theme-override', null ); } } } diff --git a/includes/SkinCitizen.php b/includes/SkinCitizen.php index d1584cde..0ff4d2cf 100644 --- a/includes/SkinCitizen.php +++ b/includes/SkinCitizen.php @@ -775,15 +775,15 @@ class SkinCitizen extends SkinMustache { // Add HTML class based on theme set $out->addHtmlClasses( 'skin-citizen-' . $theme ); - if ($this->getRequest()->getCookie('skin-citizen-theme-override') === null) { + if ( $this->getRequest()->getCookie( 'skin-citizen-theme-override' ) === null ) { // Only set the theme cookie if the theme wasn't overridden by the user through the button - $this->getRequest()->response()->setCookie('skin-citizen-theme', $theme, 0, [ + $this->getRequest()->response()->setCookie( 'skin-citizen-theme', $theme, 0, [ 'httpOnly' => false, - ]); + ] ); } // Script content at 'skins.citizen.scripts.theme-switcher/inline.js - $this->getOutput()->addHeadItem('theme-switcher', ''); - $this->getOutput()->addModules('skins.citizen.scripts.theme-switcher'); + $this->getOutput()->addHeadItem( 'theme-switcher', '' ); + $this->getOutput()->addModules( 'skins.citizen.scripts.theme-switcher' ); } } diff --git a/resources/skins.citizen.styles/ThemeToggle.less b/resources/skins.citizen.styles/ThemeToggle.less index 615ad3ea..40d45da9 100644 --- a/resources/skins.citizen.styles/ThemeToggle.less +++ b/resources/skins.citizen.styles/ThemeToggle.less @@ -1,16 +1,16 @@ .mw-theme-toggle { - background-color: transparent; - border: 0; - background-repeat: no-repeat; - background-position: center; - font-size: 0; - opacity: 0.4; width: 39px; height: 56px; + border: 0; + background-color: transparent; + background-position: center; + background-repeat: no-repeat; + font-size: 0; + opacity: 0.4; } .skin-citizen-dark { .mw-theme-toggle { - filter: invert(1); + filter: invert( 1 ); } }