Skip to content

Navigation Menu

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

Appearance settings

[Serializer] [Normalizer] Add to context current class / attribute name for a denormalized object #47182

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 7.3
Choose a base branch
Loading
from

Conversation

chadyred
Copy link
Contributor

@chadyred chadyred commented Aug 4, 2022

Q A
Branch? 6.2
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Hello,

A simple PR which is simple but useful for solving everything related to the current class and the attribute such as the information in the DocBlock, and in particular, on the generic types powered by PhpStan for an attribute which required more advanced information on its typing (and according to the data received).

For instance :

A ClassFoo is triggered for denormalization --> The type of the attribute to denormalize is mixed BUT with a DocBlock node like @var GenericTypeA<GenericTypeB<Union|Type|null>>. Thus, to resolve the type used at the end of the chain, having the current attribute and the current class helps a lot, especially with another extractor or a piece of homemade code, it is really useful to retrieve information about the class by reflexivity for example through the combination currentClassName:currentAttributeName

…me for a denormalized object

Useful for solving everything related to the current class and the attribute such as the information in the DocBlock, and in particular, on the generic types powered by PhpStan for an attribute which required more advanced information on its typing (and according to the data received).

For instance :

A ClassFoo is triggered for denormalization --> The type of the attribute to denormalize is `mixed` BUT with a `DocBlock` node like `@var GenericTypeA<GenericTypeB<Union|Type|null>>`. Thus, to resolve the type used at the end of the chain, having the current attribute and the current class helps a lot, especially with another extractor or a piece of homemade code, it is really useful to retrieve information about the class by reflexivity for example through the combination `currentClassName:currentAttributeName`
@chadyred chadyred changed the title Add to context current class / attribute name for a denormalized object [Serializer] [Normalizer] Add to context current class / attribute name for a denormalized object Aug 4, 2022
@carsonbot
Copy link

Hey!

I think @ThomasNunninger has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@nicolas-grekas nicolas-grekas modified the milestones: 6.2, 6.3 Nov 5, 2022
@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.