diff --git a/src/Symfony/Component/Filesystem/CHANGELOG.md b/src/Symfony/Component/Filesystem/CHANGELOG.md index a4c0479f7d9a7..e870a48a2cf4f 100644 --- a/src/Symfony/Component/Filesystem/CHANGELOG.md +++ b/src/Symfony/Component/Filesystem/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +3.0.0 +----- + + * removed `$mode` argument from `Filesystem::dumpFile()` + 2.6.0 ----- diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index 03f44e6c37eca..ce04a00f1211f 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -455,14 +455,12 @@ public function isAbsolutePath($file) /** * Atomically dumps content into a file. * - * @param string $filename The file to be written to. - * @param string $content The data to write into the file. - * @param null|int $mode The file mode (octal). If null, file permissions are not modified - * Deprecated since version 2.3.12, to be removed in 3.0. + * @param string $filename The file to be written to. + * @param string $content The data to write into the file. * * @throws IOException If the file cannot be written to. */ - public function dumpFile($filename, $content, $mode = 0666) + public function dumpFile($filename, $content) { $dir = dirname($filename); @@ -479,9 +477,6 @@ public function dumpFile($filename, $content, $mode = 0666) } $this->rename($tmpFile, $filename, true); - if (null !== $mode) { - $this->chmod($filename, $mode); - } } /** diff --git a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php index 538994a1f52d0..a101cad0b8256 100644 --- a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php +++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php @@ -19,7 +19,7 @@ class FilesystemTest extends FilesystemTestCase { /** - * @var \Symfony\Component\Filesystem\Filesystem $filesystem + * @var \Symfony\Component\Filesystem\Filesystem */ private $filesystem = null; @@ -959,22 +959,7 @@ public function testDumpFile() { $filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; - $this->filesystem->dumpFile($filename, 'bar', 0753); - - $this->assertFileExists($filename); - $this->assertSame('bar', file_get_contents($filename)); - - // skip mode check on Windows - if ('\\' !== DIRECTORY_SEPARATOR) { - $this->assertFilePermissions(753, $filename); - } - } - - public function testDumpFileWithNullMode() - { - $filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; - - $this->filesystem->dumpFile($filename, 'bar', null); + $this->filesystem->dumpFile($filename, 'bar'); $this->assertFileExists($filename); $this->assertSame('bar', file_get_contents($filename));