-
Notifications
You must be signed in to change notification settings - Fork 9
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
How to support deserializer objects? #83
Comments
The easiest way is to mark serialized objects by some interface/attribute/namespace and use that in custom
I'm not sure what you mean, we see the types just like PHPStan do. So if you do this: $decoded = $this->decoder->deserializeObject(CoffeeMachinesResult::class, $json);
$decoded->machines[0]->someMethod(); then |
To be honest: that doesn't sound easy. It will pollute the code with markers to indicate this is not dead. It can be known from the place it's called (deserialize) that the class (and its related classes) are in use. |
Same as with #91, the dispatch call will mark something as not dead. In this issue, the deserialize call should mark it as non dead. |
I believe we need something like this to properly support those kind of magic calls. |
Since 0.7.0, this can be easily implemented (as shown in simple readme example). But, I'm not sure if we can do that in a generic way (within this repository), because deserialization may and may not use constructor based on its configuration. |
First of all, thanks for creating this great extension 💙
Since there is not a Discussion board to ask questions, I create this as issue.
I have the following code:
It's used in a test like this:
This extension detects these 3 classes as dead.
What's the best way to support this? I don't think I can use an EntrypointProvider for this, right?
Another thing that I'm curious of: does this extension detect the
@param list<CoffeeMachine> $machines
PHPDoc in CoffeeMachinesResult constructor? Because class-leak did not.The text was updated successfully, but these errors were encountered: