From b8c7224dd86e074424982cec0dcb09b133a0cc46 Mon Sep 17 00:00:00 2001 From: saschanowak <1643495+saschanowak@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:32:01 +0000 Subject: [PATCH] [automated] Apply Coding Standard --- Classes/EventListener/AddCdnToResource.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Classes/EventListener/AddCdnToResource.php b/Classes/EventListener/AddCdnToResource.php index 3968b1b..1878d29 100644 --- a/Classes/EventListener/AddCdnToResource.php +++ b/Classes/EventListener/AddCdnToResource.php @@ -21,16 +21,17 @@ class AddCdnToResource { protected $configuration = []; - public function __construct( - ExtensionConfiguration $extensionConfiguration = null - ) { - $this->configuration = $extensionConfiguration ? $extensionConfiguration->get('nxsimplecdn') : + public function __construct(ExtensionConfiguration $extensionConfiguration = null) + { + $this->configuration = $extensionConfiguration instanceof ExtensionConfiguration ? $extensionConfiguration->get( + 'nxsimplecdn' + ) : GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('nxsimplecdn'); } public function __invoke(GeneratePublicUrlForResourceEvent $event): void { - if ((bool)$this->configuration['enabled'] === false) { + if (!(bool) $this->configuration['enabled']) { return; }