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

fix: json syntax error with empty string #150

Merged
merged 2 commits into from
Dec 1, 2022

Conversation

coppee
Copy link
Contributor

@coppee coppee commented Nov 30, 2022

Q A
Bug fix? Y
New feature? N
BC breaks? N
Deprecations? N
Fixed tickets N

rector add JSON_THROW_ON_ERROR on json_decode()

@coppee coppee requested a review from a team November 30, 2022 15:56
@@ -454,12 +454,12 @@ private function resolveElasticsearchSearchParameters(array $parameters): array
return $value;
})
->setNormalizer('body', function (Options $options, $value) {
if (null === $value || '' === $value) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (null === $value || '' === $value) {
if (\in_array($value, [null, ''])) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we want to be strict, we need to replace with: if (\in_array($value, [null, ''], true)) {

But is it really more readable ?

@Davidmattei Davidmattei merged commit 2fdb9ed into ems-project:4.3 Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants