From b3ffc51ebbe6ceef105f09cf422e79e61d08e402 Mon Sep 17 00:00:00 2001
From: Alex Pott <1732-alexpott@users.noreply.drupalcode.org>
Date: Thu, 29 Feb 2024 05:51:24 +0000
Subject: [PATCH] Applied suggestion to use file_exists()

---
 composer/Plugin/VendorHardening/VendorHardeningPlugin.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/composer/Plugin/VendorHardening/VendorHardeningPlugin.php b/composer/Plugin/VendorHardening/VendorHardeningPlugin.php
index a5747168c3e1..285e92d2713f 100644
--- a/composer/Plugin/VendorHardening/VendorHardeningPlugin.php
+++ b/composer/Plugin/VendorHardening/VendorHardeningPlugin.php
@@ -347,7 +347,7 @@ protected function cleanPathsForPackage(PackageInterface $package, $paths_for_pa
     $fs = new Filesystem();
     foreach ($paths_for_package as $cleanup_item) {
       $cleanup_path = $package_dir . '/' . $cleanup_item;
-      if (!is_dir($cleanup_path) && !is_file($cleanup_path)) {
+      if (!file_exists($cleanup_path)) {
         // If the package has changed or the --prefer-dist version does not
         // include the directory. This is not an error.
         $this->io->writeError(sprintf("%s<comment>Path '%s' does not exist.</comment>", str_repeat(' ', 6), $cleanup_path), TRUE, IOInterface::VERY_VERBOSE);
-- 
GitLab