From bb71e0abdb61716792079d37e8d1b3e4aecfd38a Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 7 May 2025 20:21:27 +0100 Subject: [PATCH 1/3] Fix coding standards. --- localgov_core.module | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/localgov_core.module b/localgov_core.module index 8d9f709..7df9838 100644 --- a/localgov_core.module +++ b/localgov_core.module @@ -30,11 +30,11 @@ function localgov_core_theme($existing, $type, $theme, $path) { * Implements hook_library_info_alter(). */ function localgov_core_library_info_alter(&$libraries, $extension) { + if ($extension === 'core') { $remove_css = (bool) theme_get_setting('localgov_base_remove_css'); $remove_js = (bool) theme_get_setting('localgov_base_remove_js'); - - foreach($libraries as $name => $library) { + foreach ($libraries as $name => $library) { if (str_starts_with($name, 'components.localgov_base--')) { if ($remove_css) { $libraries[$name]['css'] = []; @@ -46,6 +46,8 @@ function localgov_core_library_info_alter(&$libraries, $extension) { } } +} + /** * Implements hook_theme_suggestions_HOOK(). */ From 4f4f30940fa3bc01362180eca61f2410fe154c71 Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 7 May 2025 20:56:23 +0100 Subject: [PATCH 2/3] Add return type to hook_template_preprocess_default_variables_alter(). --- localgov_core.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localgov_core.module b/localgov_core.module index 7df9838..fc0d690 100644 --- a/localgov_core.module +++ b/localgov_core.module @@ -70,7 +70,7 @@ function localgov_core_theme_suggestions_localgov_page_header_block(array $varia /** * Implements hook_template_preprocess_default_variables_alter(). */ -function localgov_core_template_preprocess_default_variables_alter(&$variables) { +function localgov_core_template_preprocess_default_variables_alter(&$variables): void { $remove_css = (bool) theme_get_setting('localgov_base_remove_css'); $remove_js = (bool) theme_get_setting('localgov_base_remove_js'); From 212bf5bd01c199094438be608df4af5eeba3e7b2 Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 7 May 2025 21:04:47 +0100 Subject: [PATCH 3/3] Add return type to hook_library_info_alter(). --- localgov_core.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localgov_core.module b/localgov_core.module index fc0d690..251e3f6 100644 --- a/localgov_core.module +++ b/localgov_core.module @@ -29,7 +29,7 @@ function localgov_core_theme($existing, $type, $theme, $path) { /** * Implements hook_library_info_alter(). */ -function localgov_core_library_info_alter(&$libraries, $extension) { +function localgov_core_library_info_alter(&$libraries, $extension): void { if ($extension === 'core') { $remove_css = (bool) theme_get_setting('localgov_base_remove_css');