-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] Call to undefined function is_mixed() in AbstractObjectNormalizer.php line 780 #57314
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
Labels
Comments
I can't seem to reproduce this error. I tried the following: class Test
{
public function __construct(
public mixed $test,
) {
}
} and class Test
{
public function __construct(
private mixed $test,
) {
}
public function getTest(): mixed
{
return $this->test;
}
} Could you create a reproducer? |
I wasn't able to come up with a test case, but reading the existing code #57320 should fix the reported issue. |
I have the same error since I've upgraded to 7.1.1. $userAvatarDto = $serializer->deserialize(
$content,
UserAvatarDto::class,
'json'
); ... where:
class UserAvatarDto
{
#[Assert\Sequentially([
new Assert\NotBlank(
allowNull: true,
message: HttpErrorMessage::USER_EDITION_AVATAR_MISSING->value,
normalizer: 'trim'
),
new Assert\Type('string', message: HttpErrorMessage::USER_EDITION_AVATAR_WRONG_FORMAT->value),
])]
private mixed $avatar = null;
/**
* Get the value of avatar.
*/
public function getAvatar(): mixed
{
return $this->avatar;
}
/**
* Set the value of avatar.
*/
public function setAvatar(mixed $avatar): self
{
$this->avatar = $avatar;
return $this;
}
} |
xabbuh
added a commit
that referenced
this issue
Jun 6, 2024
…ions (xabbuh) This PR was merged into the 7.1 branch. Discussion ---------- [Serializer] avoid calling undefined built-in is_*() functions | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #57314 | License | MIT Commits ------- e0a6587 avoid calling undefined built-in is_*() functions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
7.1.1
Description
#53160 introduced a bug in serializing objects with
mixed
type.How to reproduce
Serialize any object with at least one property with
mixed
type.Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: