diff --git a/composer/Plugin/VendorHardening/FileSecurity.php b/composer/Plugin/VendorHardening/FileSecurity.php
index 3424c5617e2b6bd280d490d2864b39c3a36157d9..5186fa6447fdd4b92428f720abd52eacb1aa5bf8 100644
--- a/composer/Plugin/VendorHardening/FileSecurity.php
+++ b/composer/Plugin/VendorHardening/FileSecurity.php
@@ -43,7 +43,7 @@ public static function writeHtaccess($directory, $deny_public_access = TRUE, $fo
    * @return string
    *   The desired contents of the .htaccess file.
    *
-   * @see file_save_htaccess()
+   * @see \Drupal\Component\FileSecurity\FileSecurity::writeHtaccess()
    */
   public static function htaccessLines($deny_public_access = TRUE) {
     $lines = static::htaccessPreventExecution();
diff --git a/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php b/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php
index d901a7701cbd234c707902c2c98a5214225c6b8e..e2770b15a1dbfd1a732571006cb7316a1ec29faf 100644
--- a/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php
+++ b/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php
@@ -8,7 +8,7 @@
 use Drupal\Tests\BrowserTestBase;
 
 /**
- * Tests the log message added by file_save_htaccess().
+ * Tests the log message added by the HtaccessWriter service.
  *
  * @group File
  */
@@ -25,15 +25,15 @@ class FileSaveHtaccessLoggingTest extends BrowserTestBase {
   protected $defaultTheme = 'stark';
 
   /**
-   * Tests file_save_htaccess().
+   * Tests the HtaccessWriter service write functionality.
    */
   public function testHtaccessSave(): void {
     // Prepare test directories.
     $private = $this->publicFilesDirectory . '/test/private';
 
-    // Verify that file_save_htaccess() returns FALSE if .htaccess cannot be
-    // written and writes a correctly formatted message to the error log. Set
-    // $private to TRUE so all possible .htaccess lines are written.
+    // Verify that HtaccessWriter service returns FALSE if .htaccess cannot be
+    // written and writes a correctly formatted message to the error log.
+    // Set $private to TRUE so all possible .htaccess lines are written.
     /** @var \Drupal\Core\File\HtaccessWriterInterface $htaccess */
     $htaccess = \Drupal::service('file.htaccess_writer');
     $this->assertFalse($htaccess->write($private, TRUE));