Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:masterfromthewilkybarkid:dump-file-type
Mar 3, 2019

Conversation

@thewilkybarkid
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

Running PHPStan on my project picked up that passing a resource toFilesystem::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.

@thewilkybarkidthewilkybarkid changed the titleDeprecate using arrays and resources in Filesystem's dumpFile() and appendToFile()[Filesystem] Deprecate using arrays and resources in dumpFile() and appendToFile()Dec 21, 2018
@nicolas-grekasnicolas-grekas added this to thenext milestoneDec 24, 2018
Copy link
Member

@chalasrchalasr left a 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
Copy link
ContributorAuthor

Would need a separate PR, but would you accept a new method that takes a resource?

@fabpot
Copy link
Member

What about reusing the same method?

@thewilkybarkid
Copy link
ContributorAuthor

That would be my preference, but this PR was following#20980 and#28019.

@fabpot
Copy link
Member

I would be in favor of supporting resources and strings in the existing method.

@thewilkybarkidthewilkybarkid changed the title[Filesystem] Deprecate using arrays and resources in dumpFile() and appendToFile()[Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile()Feb 22, 2019
@thewilkybarkid
Copy link
ContributorAuthor

@fabpot Updated to match.

@fabpot
Copy link
Member

Thank you@thewilkybarkid.

@fabpotfabpot merged commit0eaf9d2 intosymfony:masterMar 3, 2019
fabpot added a commit that referenced this pull requestMar 3, 2019
…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()
@thewilkybarkidthewilkybarkid deleted the dump-file-type branchMarch 4, 2019 06:05
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
@tvdijen
Copy link

tvdijen commentedMar 1, 2022
edited
Loading

The current type-hints that were added in 5.x for these methods prevent us from passing resources because the file is type-hinted asstring.
I'm trying to useappendToFile with filephp://stderr which breaks on themkdir() in the method and passingfopen('php://stderr', 'w') as a file break because of the typehint.. Is this a bug, or shouldn't I be doing this at all@fabpot ?

Update: this only breaks on Windows for some reason...this is my workaround to deal withphp:// files on windows right now.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr requested changes

@fabpotfabpotfabpot approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

7 participants

@thewilkybarkid@fabpot@tvdijen@javiereguiluz@nicolas-grekas@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp