8000 [Filesystem] Fix str_contains deprecation · symfony/symfony@d7519b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit d7519b7

Browse files
committed
[Filesystem] Fix str_contains deprecation
1 parent 3fbca7b commit d7519b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ private static function doRemove(array $files, bool $isRecursive): void
199199

200200
throw new IOException(sprintf('Failed to remove directory "%s": ', $file).$lastError);
201201
}
202-
} elseif (!self::box('unlink', $file) && (str_contains(self::$lastError, 'Permission denied') || file_exists($file))) {
202+
} elseif (!self::box('unlink', $file) && ((self::$lastError && str_contains(self::$lastError, 'Permission denied')) || file_exists($file))) {
203203
throw new IOException(sprintf('Failed to remove file "%s": ', $file).self::$lastError);
204204
}
205205
}

0 commit comments

Comments
 (0)
0