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

[FrameworkBundle] Fix default PHP attributes support in validation and serializer configuration when doctrine/annotations is not installed with PHP 8#44110

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

@fancyweb
Copy link
Contributor

QA
Branch?5.3
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

Afrer upgrading to PHP 8 and using real PHP attributes, I noticed there were no validation metadata for my classes anymore.

Before:

  • Full default FWB validator config
  • PHP 7.4
  • Constraints in my code are declared as PHPDoc annotation (the old way)
  • doctrine/annotations is required in composer.json

After:

  • Full default FWB validator config
  • PHP 8.0
  • Constraints in my code are declared as real PHP attributes
  • doctrine/annotations has been removed from composer.json because I don't need it anymore

I expect the migration to be transparent, ie not having to do any change in the config to switch from PHPDoc annotations to real PHP attributes. However,validation.enable_annotations does not default to true anymore after the migration so here is the fix. WDYT?

…d serializer configuration when doctrine/annotations is not installed with PHP 8
{
$doctrineCache =$willBeAvailable('doctrine/cache', Cache::class,'doctrine/annotation');
$psr6Cache =$willBeAvailable('symfony/cache', PsrCachedReader::class,'doctrine/annotation');
$doctrineCache =$willBeAvailable('doctrine/cache', Cache::class,'doctrine/annotations');
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This is totally unrelated but that's surely a mistake?

Copy link
Member

@stofstofNov 18, 2021
edited
Loading

Choose a reason for hiding this comment

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

that's part of fixing the code, asdoctrine/annotations is the right package name

@fabpot
Copy link
Member

Thank you@fancyweb.

@fabpotfabpot merged commita09c139 intosymfony:5.3Nov 18, 2021
@fancywebfancyweb deleted the fwb/fix-annot-default-support-php8 branchNovember 18, 2021 14:39
This was referencedNov 18, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@derrabusderrabusderrabus approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.3

Development

Successfully merging this pull request may close these issues.

6 participants

@fancyweb@fabpot@nicolas-grekas@stof@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp