Permalink
Browse files

[Filesystem] added a missing CHANGELOG item and fixed some CS

  • Loading branch information...
1 parent b3c58e7 commit 7464833ecef7d93008ffa8869e67faca3d4fed5c @fabpot fabpot committed Dec 11, 2012
View
5 src/Symfony/Component/Filesystem/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========
+2.2.0
+-----
+
+ * added a delete option for the mirror() method
+
2.1.0
-----
View
2 src/Symfony/Component/Filesystem/Filesystem.php
@@ -336,7 +336,7 @@ public function makePathRelative($endPath, $startPath)
* Valid options are:
* - $options['override'] Whether to override an existing file on copy or not (see copy())
* - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink())
- * - $options['delete'] Default false Whether to delete files that are not in the source directory
+ * - $options['delete'] Whether to delete files that are not in the source directory (defaults to false)
*
* @throws IOException When file type is unknown
*/
View
9 src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
@@ -801,22 +801,21 @@ public function testMirrorCopiesFilesAndDirectoriesRecursively()
$this->filesystem->remove($file1);
- $this->filesystem->mirror($sourcePath, $targetPath, null, array("delete" => FALSE));
+ $this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => false));
$this->assertTrue($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1'));
- $this->filesystem->mirror($sourcePath, $targetPath, null, array("delete" => TRUE));
+ $this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => true));
$this->assertFalse($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1'));
file_put_contents($file1, 'FILE1');
- $this->filesystem->mirror($sourcePath, $targetPath, null, array("delete" => TRUE));
+ $this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => true));
$this->assertTrue($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1'));
$this->filesystem->remove($directory);
- $this->filesystem->mirror($sourcePath, $targetPath, null, array("delete" => TRUE));
+ $this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => true));
$this->assertFalse($this->filesystem->exists($targetPath.'directory'));
$this->assertFalse($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1'));
-
}
public function testMirrorCopiesLinks()

0 comments on commit 7464833

Please sign in to comment.