-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
if (in_array($snakeCasePropertyName, $this->excludeWhenEmpty) && empty($propertyValue)) continue;
empty() treats 0, "0", false, and [] as empty. So if someone wants to return "count" => 0 or "enabled" => false, it could disappear depending on config. That’s not a bug, but it’s a “why did my API lie to me?” moment.
A nicer library-level option is: replace broad empty() with more explicit filters (null only, empty string only, empty array only), or clearly document “excludeWhenEmpty uses PHP empty semantics.”
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request