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

[HttpFoundation] Rename Request::getContentType to getContentTypeFormat#45034

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

Conversation

MarkPedron
Copy link
Contributor

@MarkPedronMarkPedron commentedJan 15, 2022
edited by GromNaN
Loading

QA
Branch?6.2
Bug fix?no
New feature?yes
Deprecations?yes
TicketsFix#39750
LicenseMIT
Doc PRTODO

@carsonbot

This comment was marked as resolved.

@MarkPedronMarkPedronforce-pushed theissue_39750_request_get_content_type branch fromefea1a1 tof4409c8CompareJanuary 15, 2022 18:55
Copy link
Member

@wouterjwouterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good from my point of view 👍

@MarkPedronMarkPedronforce-pushed theissue_39750_request_get_content_type branch 4 times, most recently from59db8a5 toc2c3b20CompareJanuary 15, 2022 19:30
@MarkPedron
Copy link
ContributorAuthor

@wouterj Thank you for your kind feedback.

Sorry for all the updates, I completely forgot to add tests and the necessary deprecation infos.

Should be ready now. The CI failure is very mysterious to me.

@wouterj
Copy link
Member

No problem! For a first contribution, this is in perfect shape (especially considering changes like this need BC and deprecations and stuff).

@MarkPedron
Copy link
ContributorAuthor

MarkPedron commentedJan 15, 2022
edited
Loading

I made an attempt to make appveyor happy (I think i understood the subsequent deprecation emitted in security/http).
The errors in the php8.0/php8.1 job also seem understandable (the return type patch does not apply, because the code changed). However, they seem unrelated to this PR/issue.

@MarkPedronMarkPedronforce-pushed theissue_39750_request_get_content_type branch fromf949c8c to75daa15CompareJanuary 15, 2022 20:00
$request = new Request();
$contentType = $request->getContentTypeFormat();

$this->assertNull($contentType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Would be great to add more tests covering cases where that method returns a non-null value. Otherwise, we don't really have tests for the feature.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for the suggestion. I added tests to cover the mime typesapplication/json andtext/html

@carsonbotcarsonbot changed the titleRename Request::getContentType to getContentTypeFormat[HttpFoundation] Rename Request::getContentType to getContentTypeFormatApr 19, 2022
@nicolas-grekas
Copy link
Member

Friendly ping@MarkPedron, up to finish this PR? See pending comments + rebase needed.

@MarkPedronMarkPedronforce-pushed theissue_39750_request_get_content_type branch 2 times, most recently from6b0c8e2 toc092b30CompareApril 26, 2022 19:45
@MarkPedron
Copy link
ContributorAuthor

@nicolas-grekas Thanks for the reminder. I added non-null tests as suggested, accepted the suggestion expanding the comment, and rebased. If there is anything else to be done, please let me know. I am hesitating to expand the comments further, as to me the meaning of getContentTypeFormat seems quite clear, and confusion arises from the methods setRequestFormat/getRequestFormat, which (to my understanding) refer to the negotiated format of theResponse.

@fabpotfabpotforce-pushed theissue_39750_request_get_content_type branch fromc092b30 toccc77fcCompareJuly 22, 2022 12:34
Resolves issuesymfony#39750.The method getContentType was confusing.This method does not return a mime type, but a mapped type name derivedfrom the mime type in the CONTENT_TYPE header.
@fabpotfabpotforce-pushed theissue_39750_request_get_content_type branch fromccc77fc tof545ed4CompareJuly 22, 2022 12:37
@fabpot
Copy link
Member

Thank you@MarkPedron.

@fabpotfabpot merged commit57b24fe intosymfony:6.2Jul 22, 2022
@fabpotfabpot mentioned this pull requestOct 24, 2022
nicolas-grekas added a commit that referenced this pull requestJun 30, 2023
…mNaN)This PR was merged into the 6.4 branch.Discussion----------[Security] Remove BC layer for HttpFoundation < 6.2| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | n/aIn#45034, a condition was added to support `symfony/http-foundation < 6.2` or use the new `Request::getContentTypeFormat()` method when it exists.I propose to update the minimum version of `symfony/http-foundation` required by `symfony/security-http: 6.4`.`symfony/security-http: 6.4` already requires `symfony/http-kernel: ^6.3|^7.0` [which require](https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/HttpKernel/composer.json) `symfony/http-foundation: ^6.2.7`The legacy method `Request::getContentType()` will be removed in 7.0 by#50826Commits-------746c3fd Remove BC layer for HttpFoundation < 6.1
nicolas-grekas added a commit that referenced this pull requestJun 30, 2023
… behaviors (GromNaN)This PR was squashed before being merged into the 7.0 branch.Discussion----------[HttpFoundation] Remove deprecated classes, method and behaviors| Q             | A| ------------- | ---| Branch?       | 7.0| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | n/aClean `symfony/http-foundation` from all its legacy.- Remove `RequestMatcher` and `ExpressionRequestMatcher`,  deprecated since#47595- Remove `Request::getContentType()`,  deprecated since#45034- Throw a `UnexpectedValueException` or `BadRequestException` when `ParameterBag::filter()` or `InputBag::filter()` reads an invalid value and the flag `FILTER_NULL_ON_FAILURE` is not set.  new behavior announced since#48525- Throw a `InvalidArgumentException` when calling `Request::create()` with a malformed URI,  deprecated since#49376Commits-------665a775 [HttpFoundation] Remove deprecated classes, method and behaviors
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stofstofstof left review comments

@wouterjwouterjwouterj left review comments

@ogizanagiogizanagiogizanagi left review comments

@chalasrchalasrchalasr left review comments

@ihmelsihmelsihmels left review comments

@fabpotfabpotfabpot approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
6.2
Development

Successfully merging this pull request may close these issues.

Request::getContentType() method name is confusing
9 participants
@MarkPedron@carsonbot@wouterj@nicolas-grekas@fabpot@stof@ogizanagi@chalasr@ihmels

[8]ページ先頭

©2009-2025 Movatter.jp