From 9dac90dfd5fc809dd84fdac0532ecd51c6ae66bf Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Mon, 8 Jan 2024 10:22:08 +0100 Subject: [PATCH] Try to prevent error with PHP-Parser 5 when running PHPUnit tests --- src/Internal/DirectoryCreator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Internal/DirectoryCreator.php b/src/Internal/DirectoryCreator.php index b350cf88d9..3ed7c2ff11 100644 --- a/src/Internal/DirectoryCreator.php +++ b/src/Internal/DirectoryCreator.php @@ -18,6 +18,10 @@ public static function ensureDirectoryExists( bool $recursive = true, ): void { + if (is_dir($directory)) { + return; + } + if (@mkdir($directory, $mode, $recursive)) { return; }