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

[Serializer] Remove last deprecated/obsolete paths#31771

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
nicolas-grekas merged 1 commit intosymfony:masterfromogizanagi:rm_deprec/serializer/last
Jun 8, 2019
Merged

[Serializer] Remove last deprecated/obsolete paths#31771

nicolas-grekas merged 1 commit intosymfony:masterfromogizanagi:rm_deprec/serializer/last
Jun 8, 2019

Conversation

@ogizanagi
Copy link
Contributor

@ogizanagiogizanagi commentedMay 31, 2019
edited
Loading

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#28316,#28709,#31030,#27020,#29896,16f8a13#r201060750
LicenseMIT
Doc PRN/A

This should fix the last deprecations & obsolete code paths for the Serializer component.

if (class_exists(MimeTypes::class)) {
$mimeTypeGuesser = MimeTypes::getDefault();
}else {
@trigger_error(sprintf('Passing null to "%s()" without symfony/mime installed is deprecated since Symfony 4.3, install symfony/mime.',__METHOD__),E_USER_DEPRECATED);

Choose a reason for hiding this comment

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

this should be an exception now?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

That's what I thought too (see second commit), but the data uri normalizer used to fallback toapplication/octet-stream if no default mime type guesser can be instantiated. So neither was the http-foundation nor the mime type component a strict dependency to use it.

Copy link
Member

Choose a reason for hiding this comment

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

this notice is wrong in the first place and should be removed from 4.3 then, right?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Indeed. See#31923

if (class_exists(MimeTypes::class)) {
$mimeTypeGuesser = MimeTypes::getDefault();
}else {
@trigger_error(sprintf('Passing null to "%s()" without symfony/mime installed is deprecated since Symfony 4.3, install symfony/mime.',__METHOD__),E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

this notice is wrong in the first place and should be removed from 4.3 then, right?

* @param object $object
* @param string|null $format
* @param array $context
* @param object $object

Choose a reason for hiding this comment

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

we can add the type and remove the annotation actually - PHP7.2 allows it

ogizanagi reacted with rocket emoji
* @param string|null $format
*/
protectedfunctioncreateChildContext(array$parentContext,$attribute/*, ?string $format */)
protectedfunctioncreateChildContext(array$parentContext,string$attribute, ?string$format):array

Choose a reason for hiding this comment

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

should have null as default, otherwise that's a hard BC break

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The method is internal. That should be fine, right?

Choose a reason for hiding this comment

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

@internal is not transitive
once all are correctly annotated on 4.4, sure :)

Choose a reason for hiding this comment

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

fixed in2b8e441

ogizanagi reacted with thumbs up emoji
nicolas-grekas added a commit that referenced this pull requestJun 7, 2019
…guesser is optional) (ogizanagi)This PR was merged into the 4.3 branch.Discussion----------[Serializer] Fix DataUriNormalizer deprecation (MIME type guesser is optional)| Q             | A| ------------- | ---| Branch?       | 4.3 <!-- see below -->| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | N/ARelates to#31771 (comment) :The deprecation isn't fundamentally wrong, but if none of the Mime nor HttpFoundation components are installed, the DataUriNormalizer can be used, and the MIME type used will always be `'application/octet-stream'`https://github.com/symfony/symfony/blob/9691519ca46511005bc701ca93c2973923952034/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php#L39-L46https://github.com/symfony/symfony/blob/9691519ca46511005bc701ca93c2973923952034/src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php#L135-L139So this completes the deprecation message, as well as allowing `null` again when no default MIME type guesser is available at all.Commits-------2740bd1 [Serializer] Fix DataUriNormalizer deprecation (MIME type guesser is optional)
@nicolas-grekas
Copy link
Member

Thank you@ogizanagi.

@nicolas-grekasnicolas-grekas merged commitc703b35 intosymfony:masterJun 8, 2019
nicolas-grekas added a commit that referenced this pull requestJun 8, 2019
…anagi)This PR was merged into the 5.0-dev branch.Discussion----------[Serializer] Remove last deprecated/obsolete paths| Q             | A| ------------- | ---| Branch?       | master <!-- see below -->| Bug fix?      | no| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets |#28316,#28709,#31030,#27020,#29896,16f8a13#r201060750   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | N/A <!-- required for new features -->This should fix the last deprecations & obsolete code paths for the Serializer component.Commits-------c703b35 [Serializer] Remove last deprecated/obsolete paths
@ogizanagiogizanagi deleted the rm_deprec/serializer/last branchJune 9, 2019 08:23
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@chalasrchalasrchalasr left review comments

@dunglasdunglasAwaiting requested review from dunglas

+1 more reviewer

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.0

Development

Successfully merging this pull request may close these issues.

5 participants

@ogizanagi@nicolas-grekas@Simperfit@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp