From d7519b74904146516a215c0a60d2b5e2ae757635 Mon Sep 17 00:00:00 2001 From: Neil Peyssard Date: Fri, 15 Mar 2024 10:21:56 +0100 Subject: [PATCH] [Filesystem] Fix str_contains deprecation --- src/Symfony/Component/Filesystem/Filesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index 037629f18919..4df06aed115d 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -199,7 +199,7 @@ private static function doRemove(array $files, bool $isRecursive): void throw new IOException(sprintf('Failed to remove directory "%s": ', $file).$lastError); } - } elseif (!self::box('unlink', $file) && (str_contains(self::$lastError, 'Permission denied') || file_exists($file))) { + } elseif (!self::box('unlink', $file) && ((self::$lastError && str_contains(self::$lastError, 'Permission denied')) || file_exists($file))) { throw new IOException(sprintf('Failed to remove file "%s": ', $file).self::$lastError); } }