Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile()#29661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
chalasr left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
UPGADE-4.3.md needs to be updated
thewilkybarkid commentedDec 27, 2018
Would need a separate PR, but would you accept a new method that takes a resource? |
fabpot commentedDec 28, 2018
What about reusing the same method? |
thewilkybarkid commentedDec 28, 2018
fabpot commentedFeb 21, 2019
I would be in favor of supporting resources and strings in the existing method. |
thewilkybarkid commentedFeb 22, 2019
@fabpot Updated to match. |
…() and appendToFile()
fabpot commentedMar 3, 2019
Thank you@thewilkybarkid. |
…ays 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-------0eaf9d2 [Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile()
tvdijen commentedMar 1, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The current type-hints that were added in 5.x for these methods prevent us from passing resources because the file is type-hinted as Update: this only breaks on Windows for some reason...this is my workaround to deal with |
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.