From 7066e5514c8df1dbc0b409184e23e086cb9e4445 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Mon, 25 Nov 2024 14:08:33 +0000 Subject: [PATCH] Apply fixes from StyleCI --- extend.php | 16 +++++++--------- src/ConditionalCheck.php | 19 +++++++++++++++---- src/Listener/RepublishAssets.php | 12 +++++++++++- src/Listener/SettingsChanged.php | 12 +++++++++++- src/Repository/S3Repository.php | 5 ++--- src/S3Lifecycle.php | 11 ++++++++++- 6 files changed, 56 insertions(+), 19 deletions(-) diff --git a/extend.php b/extend.php index 2c9311b..62c433a 100644 --- a/extend.php +++ b/extend.php @@ -17,11 +17,11 @@ return [ (new Extend\Frontend('admin')) - ->js(__DIR__ . '/js/dist/admin.js') - ->css(__DIR__ . '/less/admin.less') + ->js(__DIR__.'/js/dist/admin.js') + ->css(__DIR__.'/less/admin.less') ->content(Content\AdminPayload::class), - new Extend\Locales(__DIR__ . '/locale'), + new Extend\Locales(__DIR__.'/locale'), (new Extend\Settings()) ->default('fof-s3-assets.share_s3_config_with_fof_upload', false), @@ -30,12 +30,10 @@ ->register(Provider\S3DiskProvider::class), (new Extend\Event()) - ->listen(SettingsSaving::class, Listener\SettingsChanged::class) - - (new S3Lifecycle()), + ->listen(SettingsSaving::class, Listener\SettingsChanged::class)(new S3Lifecycle()), (new Extend\Conditional()) - ->when((resolve(ConditionalCheck::class))->validConfig(), fn() => [ + ->when(resolve(ConditionalCheck::class)->validConfig(), fn () => [ (new Extend\Console()) ->command(Console\CopyAssetsCommand::class), @@ -44,6 +42,6 @@ ->driver('local', Driver\S3Driver::class), (new Extend\Event()) - ->listen(ClearingCache::class, Listener\RepublishAssets::class) - ]) + ->listen(ClearingCache::class, Listener\RepublishAssets::class), + ]), ]; diff --git a/src/ConditionalCheck.php b/src/ConditionalCheck.php index 6250101..5dc68e9 100644 --- a/src/ConditionalCheck.php +++ b/src/ConditionalCheck.php @@ -1,5 +1,14 @@ cache->get(self::CACHE_KEY)) && $cacheValue !== null) { return $cacheValue; } - + // If we don't have a cached value, check the config $config = $this->config->config(); @@ -39,6 +49,7 @@ public function validConfig(): bool $this->cache->forever(self::CACHE_KEY, true); } catch (Exception $e) { $this->cache->forever(self::CACHE_KEY, false); + return false; } diff --git a/src/Listener/RepublishAssets.php b/src/Listener/RepublishAssets.php index 8944049..591c4ef 100644 --- a/src/Listener/RepublishAssets.php +++ b/src/Listener/RepublishAssets.php @@ -1,5 +1,14 @@