You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. :)
The text was updated successfully, but these errors were encountered:
doenietzomoeilijk
changed the title
\DpdConnect\Sdk\Common\ResourceClient::createResource breaks language level
Actual code breaks Composer-specified language level
Aug 5, 2021
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 parameterJSON_PRESERVE_ZERO_FRACTION
, which was introduced in PHP 5.6. The same goes forhash_equals
and theuse 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. :)
The text was updated successfully, but these errors were encountered: