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

Actual code breaks Composer-specified language level #10

Open
doenietzomoeilijk opened this issue Aug 5, 2021 · 0 comments
Open

Actual code breaks Composer-specified language level #10

doenietzomoeilijk opened this issue Aug 5, 2021 · 0 comments

Comments

@doenietzomoeilijk
Copy link
Contributor

The project language level is set to PHP 5.5 in composer. However, the json_encode() call in \DpdConnect\Sdk\Common\ResourceClient::createResource has a parameter JSON_PRESERVE_ZERO_FRACTION, which was introduced in PHP 5.6. The same goes for hash_equals and the use function calls which are used in \DpdConnect\Sdk\RequestValidator.

These should either be refactored to adhere to the PHP 5.5 level, or, preferably, the project should have its minimum PHP version lifted to a version that hasn't been EOL for 5 years. PHP 7.3 has moved to security fixes only, PHP 7.4 will reach the same state in 3 months time. Even if there's currently a decent installed base of ancient PHP versions, moving the project to a newer level shouldn't be too much of a break - those old code bases are not going to be calling composer update anytime soon, I'd wager.

Anyway, this is more of a conversation starter. :)

@doenietzomoeilijk doenietzomoeilijk changed the title \DpdConnect\Sdk\Common\ResourceClient::createResource breaks language level Actual code breaks Composer-specified language level Aug 5, 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

No branches or pull requests

1 participant