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

Prepare the road to \JsonException usage #1949

Merged
merged 3 commits into from
May 31, 2021

Conversation

deguif
Copy link
Collaborator

@deguif deguif commented Mar 23, 2021

No description provided.

@deguif deguif self-assigned this Mar 23, 2021
@deguif deguif added this to the 7.2.0 milestone Mar 24, 2021
@@ -20,7 +20,8 @@
"elasticsearch/elasticsearch": "^7.1.1",
"nyholm/dsn": "^2.0.0",
"psr/log": "^1.0",
"symfony/deprecation-contracts": "^2.2"
"symfony/deprecation-contracts": "^2.2",
"symfony/polyfill-php73": "^1.19"
Copy link
Owner

Choose a reason for hiding this comment

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

It seems a bit overkill to have an additional dependency for a single exception change? What is the benefit of having JsonException?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For preparing smooth upgrade to native json_encode and json_decode functions with JSON_THROW_ON_ERROR option (introduced in PHP 7.3) and fully get rid of Elastica\JSON util class and JSONParseException exception class.

Copy link
Collaborator Author

@deguif deguif Mar 24, 2021

Choose a reason for hiding this comment

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

This extra polyfill package can be ignored on project side by using replace composer feature.

For example that's what I use in many projects when they are running on modern PHP versions, this way these packages are not installed as they are useless:

    "replace": {
        "paragonie/random_compat": "*",
        "ralouphie/getallheaders": "*",
        "symfony/polyfill-apcu": "*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-intl-grapheme": "*",
        "symfony/polyfill-intl-icu": "*",
        "symfony/polyfill-intl-idn": "*",
        "symfony/polyfill-intl-normalizer": "*",
        "symfony/polyfill-mbstring": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-uuid": "*"
    },

Copy link
Owner

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

SGTM. You have a conflict on the changelog.

@deguif deguif merged commit c22a1e5 into ruflin:master May 31, 2021
@deguif deguif deleted the php-json-exception branch May 31, 2021 12:27
@deguif deguif modified the milestones: 7.2.0, 7.1.2 Oct 21, 2021
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

Successfully merging this pull request may close these issues.

2 participants