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

Appearance settings

[Serializer] Add support for auto generated custom normalizers #52905

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 13 commits into
base: 7.4
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added some more tests
  • Loading branch information
Nyholm committed Jan 15, 2024
commit 0d224035752b43113fb168816bfdb726474a9e02
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,12 @@ private function addRequiredMethods(ClassDefinition $definition, Namespace_ $nam
private function addDenormailizeMethod(ClassDefinition $definition, Namespace_ $namespace, Class_ $class): void
{
$needsChildDenormalizer = false;
$body = [];
$body = [
new Node\Stmt\Expression(new Node\Expr\Assign(
new Node\Expr\Variable('data'),
new Node\Expr\Cast\Array_(new Node\Expr\Variable('data'))
)),
];

if (ClassDefinition::CONSTRUCTOR_NONE === $definition->getConstructorType()) {
$body[] = new Node\Stmt\Expression(new Node\Expr\Assign(
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.