Skip to content
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

Extending DateTimeImmutable throws error on __unserialize parameter type #10218

Closed
othercorey opened this issue Sep 19, 2023 · 2 comments
Closed

Comments

@othercorey
Copy link
Contributor

othercorey commented Sep 19, 2023

When extending DateTimeImmutable, psalm throws an error that the parameter types for __unserialize() to not match DateTimeInterface.

I could not find any stubs defining this so assume the internal reflection is getting the wrong type?

https://psalm.dev/r/7d3e818a02

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/7d3e818a02
<?php

class MyDateTime extends DateTimeImmutable
{
}
Psalm output (using commit 7428e49):

ERROR: MethodSignatureMismatch - 3:7 - Argument 1 of DateTimeImmutable::__unserialize has wrong type 'mixed', expecting 'array<array-key, mixed>' as defined by DateTimeInterface::__unserialize

@othercorey
Copy link
Contributor Author

dup of #8957

looks like the DateTimeInterface methods were added to callmap in 8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant