diff --git a/src/Components/Health/Checker/PerformanceChecker/AbstractCompressionChecker.php b/src/Components/Health/Checker/PerformanceChecker/AbstractCompressionChecker.php deleted file mode 100644 index 355346e..0000000 --- a/src/Components/Health/Checker/PerformanceChecker/AbstractCompressionChecker.php +++ /dev/null @@ -1,68 +0,0 @@ -shopwareVersion, '>')) { - return; - } - - if (!$this->enabled) { - $collection->add( - SettingsResult::warning( - strtolower($this->functionality) . '-compress', - $this->functionality . ' compression', - 'disabled', - 'enabled', - self::DOCUMENTATION_URL, - ), - ); - - return; - } - - if ($this->method === 'gzip') { - $collection->add( - SettingsResult::warning( - strtolower($this->functionality) . '-compression-method', - $this->functionality . ' compression method', - 'gzip', - 'zstd', - self::DOCUMENTATION_URL, - ), - ); - - return; - } - - if ($this->method === 'zstd' && !extension_loaded('zstd')) { - $collection->add( - SettingsResult::error( - $this->functionality . '-compression-method-extension-zstd', - 'PHP extension zstd for ' . $this->functionality . ' compression method', - 'disabled', - 'enabled', - self::DOCUMENTATION_URL, - ), - ); - } - } -} diff --git a/src/Components/Health/Checker/PerformanceChecker/CacheCompressionChecker.php b/src/Components/Health/Checker/PerformanceChecker/CacheCompressionChecker.php deleted file mode 100644 index 7f8cc05..0000000 --- a/src/Components/Health/Checker/PerformanceChecker/CacheCompressionChecker.php +++ /dev/null @@ -1,23 +0,0 @@ -shopwareVersion, '>')) { + return; + } + + $this->checkCompression($collection, 'Cache', $this->cacheCompressionEnabled, $this->cacheCompressionMethod); + $this->checkCompression($collection, 'Cart', $this->cartCompressionEnabled, $this->cartCompressionMethod); + } + + private function checkCompression(HealthCollection $collection, string $functionality, bool $enabled, string $method): void + { + if (!$enabled) { + $collection->add( + SettingsResult::warning( + strtolower($functionality) . '-compress', + $functionality . ' compression', + 'disabled', + 'enabled', + self::DOCUMENTATION_URL, + ), + ); + + return; + } + + if ($method === 'gzip') { + $collection->add( + SettingsResult::warning( + strtolower($functionality) . '-compression-method', + $functionality . ' compression method', + 'gzip', + 'zstd', + self::DOCUMENTATION_URL, + ), + ); + + return; + } + + if ($method === 'zstd' && !extension_loaded('zstd')) { + $collection->add( + SettingsResult::error( + strtolower($functionality) . '-compression-method-extension-zstd', + 'PHP extension zstd for ' . $functionality . ' compression method', + 'disabled', + 'enabled', + self::DOCUMENTATION_URL, + ), + ); + } + } +}