From fa94897deb60e8fdf99b74b64d0b337577410a2a Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Mon, 15 May 2023 23:44:34 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Utility/HtaccessManager.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Utility/HtaccessManager.php b/src/Utility/HtaccessManager.php index 5c9c4f2..ccca248 100644 --- a/src/Utility/HtaccessManager.php +++ b/src/Utility/HtaccessManager.php @@ -21,7 +21,7 @@ public function __construct(Paths $paths) } /** - * Updates the .htaccess file with the new LSCache block content. If the LSCache block is already there, it replaces it. Otherwise, it appends it + * Updates the .htaccess file with the new LSCache block content. If the LSCache block is already there, it replaces it. Otherwise, it appends it. * @throws FileNotFoundException */ public function updateHtaccess(): void @@ -69,6 +69,7 @@ private function hasLsCacheBlock(string $htaccessContent): bool private function replaceLsCacheBlock(string $htaccessContent, string $newContent): string { $pattern = '/'.preg_quote(self::BEGIN_LSCACHE, '/').'.*'.preg_quote(self::END_LSCACHE, '/').'/s'; + return preg_replace($pattern, $newContent, $htaccessContent); } @@ -79,7 +80,7 @@ private function prependLsCacheBlock(string $htaccessContent, string $newContent } /** - * Removes the LSCache block from the .htaccess file. If the block is not present, it does nothing + * Removes the LSCache block from the .htaccess file. If the block is not present, it does nothing. * @throws FileNotFoundException */ public function removeLsCacheBlock(): void