From 508a33969052607b9f8f4e1f0bfd6560af298886 Mon Sep 17 00:00:00 2001 From: Talha Amir Date: Thu, 30 May 2024 17:15:40 +0500 Subject: [PATCH] Update Filesystem.php --- Filesystem.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Filesystem.php b/Filesystem.php index 648c8d1db..afdc1e929 100644 --- a/Filesystem.php +++ b/Filesystem.php @@ -632,11 +632,16 @@ public function tempnam(string $dir, string $prefix, string $suffix = ''): strin * Atomically dumps content into a file. * * @param string|resource $content The data to write into the file + * @param bool $ignoreOnTest If phpunit should create a file or not. * * @throws IOException if the file cannot be written to */ - public function dumpFile(string $filename, $content): void + public function dumpFile(string $filename, $content, bool $ignoreOnTest = false): void { + if ($ignoreOnTest) { + return; + } + if (\is_array($content)) { throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__)); }