Skip to content

Conversation

@MrHDOLEK
Copy link
Contributor

@MrHDOLEK MrHDOLEK commented Nov 5, 2025

Resolves: #1955

Change Log


Added

Fixed

Changed

Removed

Deprecated

Security

#[DocumentationDSL(module: Module::CORE, type: DSLType::ENTRY)]
function json_entry(string $name, array|string|null $data, ?Metadata $metadata = null) : Entry
{
if (\is_array($data)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't make much sense, array can still be a regular array but not json object.

{
   "id" : 1,
   "name": "test"
}

In PHP is ['id' => 1, "name" => "test"]

But [{"id": 1, "name": "test"}] in php would be [["id":1, "name": "test"]] however both satisfies php is_array.

If anything I would probably do a json_encode on value when is_array

}

return $this->is($entry->name()) && $entry instanceof self && type_equals($this->type, $entry->type) && (new ArrayComparison())->equals($thisValue, \is_array($entryValue) ? $entryValue : null);
return $this->is($entry->name()) && $entry instanceof self && type_equals($this->type, $entry->type) && $thisValue === $entryValue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something tells me this will break a lot of tests 🫢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Unify JsonEntry

2 participants