From 4618a4ac55128c8de95b8e9cb12b5f24eae89797 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 11 May 2023 12:11:36 -0700 Subject: [PATCH] ImportMap - More type-hints. Newer setting lookup. --- Civi/Core/ImportMap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Civi/Core/ImportMap.php b/Civi/Core/ImportMap.php index bbebe1296c..bd699d5ee2 100644 --- a/Civi/Core/ImportMap.php +++ b/Civi/Core/ImportMap.php @@ -26,7 +26,7 @@ use Civi\Core\Event\GenericHookEvent; * * If you are writing Javascript code for an extension, then you may want to define new mappings, e.g. * - * function myext_civicrm_esmImportMap(array &$importMap, array $context) { + * function myext_civicrm_esmImportMap(array &$importMap, array $context): void { * $importMap['imports']['foo/'] = E::url('js/foo/'); * $importMap['imports']['bar/'] = E::url('packages/bar/dist/'); * } @@ -94,7 +94,7 @@ class ImportMap extends \Civi\Core\Service\AutoService implements HookInterface * * @param \Civi\Core\Event\GenericHookEvent $e */ - public function on_civi_region_render(GenericHookEvent $e) { + public function on_civi_region_render(GenericHookEvent $e): void { if ($e->region->_name !== 'html-header' || !$this->isAutoInject() || !$this->isRequired()) { return; } @@ -188,7 +188,7 @@ class ImportMap extends \Civi\Core\Service\AutoService implements HookInterface } else { $flags = JSON_UNESCAPED_SLASHES; - if (\CRM_Core_Config::singleton()->debug) { + if (\Civi::settings()->get('debug_enabled')) { $flags |= JSON_PRETTY_PRINT; } return sprintf("", json_encode($importMap, $flags)); -- 2.25.1