Skip to content

Actual code breaks Composer-specified language level #10

@doenietzomoeilijk

Description

@doenietzomoeilijk

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. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions