From f3cc72547a0922d03d8c7d383e96ac88158d10b1 Mon Sep 17 00:00:00 2001 From: Diego Saint Esteben Date: Tue, 31 Mar 2015 19:10:55 -0300 Subject: [PATCH 1/3] Removed deprecations in Filesystem component --- src/Symfony/Component/Filesystem/Filesystem.php | 7 +------ .../Filesystem/Tests/FilesystemTest.php | 17 +---------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index 03f44e6c37eca..e6d4d656eba25 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -457,12 +457,10 @@ public function isAbsolutePath($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. * * @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..0ee335b57526f 100644 --- a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php +++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php @@ -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)); From 00c9c85f1f2e7d93387032123be93515855342ff Mon Sep 17 00:00:00 2001 From: Diego Saint Esteben Date: Thu, 2 Apr 2015 10:11:05 -0300 Subject: [PATCH 2/3] Updated CHANGELOG.md --- src/Symfony/Component/Filesystem/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) 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 ----- From 1aaece2aad1a6413634d33f6065b8734850c7d69 Mon Sep 17 00:00:00 2001 From: Diego Saint Esteben Date: Sun, 3 May 2015 16:11:37 -0300 Subject: [PATCH 3/3] CS fixes --- src/Symfony/Component/Filesystem/Filesystem.php | 4 ++-- src/Symfony/Component/Filesystem/Tests/FilesystemTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index e6d4d656eba25..ce04a00f1211f 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -455,8 +455,8 @@ 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 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. */ diff --git a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php index 0ee335b57526f..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;