You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #29661 [Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile() (thewilkybarkid)
This PR was squashed before being merged into the 4.3-dev branch (closes #29661).
Discussion
----------
[Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Running PHPStan on my project picked up that passing a resource to `Filesystem::dumpFile()` didn't match the documented type.
I found this has been discussed in #20980 and #28019, without a clear result. But, my reading is that only strings should be supported. While I think that not supporting streams makes this a lot less useful (and I'm going to switch away from it), this does need to be resolved. So, I've deprecated using arrays and resources.
Commits
-------
0eaf9d2474 [Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile()
Copy file name to clipboardExpand all lines: Tests/FilesystemTest.php
+58Lines changed: 58 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1518,6 +1518,10 @@ public function testDumpFile()
1518
1518
}
1519
1519
}
1520
1520
1521
+
/**
1522
+
* @group legacy
1523
+
* @expectedDeprecation Calling "Symfony\Component\Filesystem\Filesystem::dumpFile()" with an array in the $content argument is deprecated since Symfony 4.3.
@@ -1600,6 +1604,60 @@ public function testAppendToFile()
1600
1604
}
1601
1605
}
1602
1606
1607
+
/**
1608
+
* @group legacy
1609
+
* @expectedDeprecation Calling "Symfony\Component\Filesystem\Filesystem::appendToFile()" with an array in the $content argument is deprecated since Symfony 4.3.
0 commit comments