8000 Officially support resources · symfony/symfony@33d5f67 · GitHub
[go: up one dir, main page]

Skip to content

Commit 33d5f67

Browse files
Officially support resources
1 parent 9ddd8b9 commit 33d5f67

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

UPGRADE-5.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ EventDispatcher
6868
Filesystem
6969
----------
7070

71-
* The `Filesystem::dumpFile()` method no longer supports arrays and resources in the `$content` argument.
72-
* The `Filesystem::appendToFile()` method no longer supports arrays and resources in the `$content` argument.
71+
* The `Filesystem::dumpFile()` method no longer supports arrays in the `$content` argument.
72+
* The `Filesystem::appendToFile()` method no longer supports arrays in the `$content` argument.
7373

7474
Finder
7575
------

src/Symfony/Component/Filesystem/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ CHANGELOG
44
4.3.0
55
-----
66

7-
* support for passing non-strings to `Filesystem::dumpFile()` is deprecated and will be removed in 5.0
8-
* support for passing non-strings to `Filesystem::appendToFile()` is deprecated and will be removed in 5.0
7+
* support for passing arrays to `Filesystem::dumpFile()` is deprecated a 8000 nd will be removed in 5.0
8+
* support for passing arrays to `Filesystem::appendToFile()` is deprecated and will be removed in 5.0
99

1010
4.0.0
1111
-----

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -670,17 +670,15 @@ public function tempnam($dir, $prefix)
670670
/**
671671
* Atomically dumps content into a file.
672672
*
673-
* @param string $filename The file to be written to
674-
* @param string $content The data to write into the file
673+
* @param string $filename The file to be written to
674+
* @param string|resource $content The data to write into the file
675675
*
676676
* @throws IOException if the file cannot be written to
677677
*/
678678
public function dumpFile($filename, $content)
679679
{
680680
if (\is_array($content)) {
681681
@trigger_error(sprintf('Calling "%s()" with an array in the $content argument is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
682-
} elseif (\is_resource($content)) {
683-
@trigger_error(sprintf('Calling "%s()" with a resource in the $content argument is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
684682
}
685683

686684
$dir = \dirname($filename);
@@ -709,17 +707,15 @@ public function dumpFile($filename, $content)
709707
/**
710708
* Appends content to an existing file.
711709
*
712-
* @param string $filename The file to which to append content
713-
* @param string $content The content to append
710+
* @param string $filename The file to which to append content
711+
* @param string|resource $content The content to append
714712
*
715713
* @throws IOException If the file is not writable
716714
*/
717715
public function appendToFile($filename, $content)
718716
{
719717
if (\is_array($content)) {
720718
@trigger_error(sprintf('Calling "%s()" with an array in the $content argument is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
721-
} elseif (\is_resource($content)) {
722-
@trigger_error(sprintf('Calling "%s()" with a resource in the $content argument is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
723719
}
724720

725721
$dir = \dirname($filename);

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,10 +1532,6 @@ public function testDumpFileWithArray()
15321532
$this->assertStringEqualsFile($filename, 'bar');
15331533
}
15341534

1535-
/**
1536-
* @group legacy
1537-
* @expectedDeprecation Calling "Symfony\Component\Filesystem\Filesystem::dumpFile()" with a resource in the $content argument is deprecated since Symfony 4.3.
1538-
*/
15391535
public function testDumpFileWithResource()
15401536
{
15411537
$filename = $this->workspace.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'baz.txt';
@@ -1635,10 +1631,6 @@ public function testAppendToFileWithArray()
16351631
}
16361632
}
16371633

1638-
/**
1639-
* @group legacy
1640-
* @expectedDeprecation Calling "Symfony\Component\Filesystem\Filesystem::appendToFile()" with a resource in the $content argument is deprecated since Symfony 4.3.
1641-
*/
16421634
public function testAppendToFileWithResource()
16431635
{
16441636
$filename = $this->workspace.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'bar.txt';

0 commit comments

Comments
 (0)
0