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] Add test to prevent regression when using array|resource with dumpFile#28019
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
ro0NL commentedJul 20, 2018
See#20980 (comment) :) |
thePanz commentedJul 20, 2018 • 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.
Damn, didn't find that PR before opening this one@ro0NL! Sorry for the duplicated MR! |
nicolas-grekas commentedJul 23, 2018
Should we reconsider since this works? If we really want a string, we should maybe throw a deprecation? That will force us to consider which alternative we should provide to ppl hit by the notice (and maybe make use realize it's simpler to just accept what already works?) |
nicolas-grekas commentedJul 26, 2018
(could you rebase on latest 2.8 please to get rid of the CS fixes?) |
thePanz commentedJul 26, 2018
@nicolas-grekas Rebased, cleaned-up and pushed |
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment• 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.
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.
yes, I changed my mind: there are two ways here: either "officialize" what already works (this PR), or deprecate what shouldn't work. The least effort is this PR, and the downside (making an implementation that doesn't rely on file_put_contents more complex) hypothetical.
ro0NL commentedJul 26, 2018
Note in 3.4 there's also |
fabpot commentedAug 2, 2018
I'm 👎 on this change for the reasons expressed in the linked PR. |
nicolas-grekas commentedAug 7, 2018
I reverted the docblock change but kept the test case so that we don't accidentally break BC. 👍 |
nicolas-grekas commentedAug 10, 2018
Thank you@thePanz. |
…rray|resource with dumpFile (thePanz)This PR was merged into the 2.8 branch.Discussion----------[Filesystem] Add test to prevent regression when using array|resource with dumpFile| Q | A| ------------- | ---| Branch? | 2.8| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | none| License | MITCommits-------db1c21c [Filesystem] Add test to prevent regression when using array|resource with dumpFile
…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()
Uh oh!
There was an error while loading.Please reload this page.