Skip to content

PHP 8.4 Deprecated errors #38

Closed

Description

@RickKukiela

Please release a patch for PHP 8.4 that addresses deprecated syntax:

Deprecated
: ShipStream\Ups\Api\Normalizer\ResponseAlertNormalizer::supportsDenormalization(): Implicitly marking parameter $format as nullable is deprecated, the explicit nullable type must be used instead in
/var/www/html/vendor/shipstream/ups-rest-php-sdk/src/Api/Normalizer/ResponseAlertNormalizer.php
on line
23

Deprecated
: ShipStream\Ups\Api\Normalizer\ResponseAlertNormalizer::supportsNormalization(): Implicitly marking parameter $format as nullable is deprecated, the explicit nullable type must be used instead in
/var/www/html/vendor/shipstream/ups-rest-php-sdk/src/Api/Normalizer/ResponseAlertNormalizer.php
on line
27

Deprecated
: ShipStream\Ups\Api\Normalizer\ResponseAlertNormalizer::denormalize(): Implicitly marking parameter $format as nullable is deprecated, the explicit nullable type must be used instead in
/var/www/html/vendor/shipstream/ups-rest-php-sdk/src/Api/Normalizer/ResponseAlertNormalizer.php
on line
31

Deprecated
: ShipStream\Ups\Api\Normalizer\ResponseAlertNormalizer::normalize(): Implicitly marking parameter $format as nullable is deprecated, the explicit nullable type must be used instead in
/var/www/html/vendor/shipstream/ups-rest-php-sdk/src/Api/Normalizer/ResponseAlertNormalizer.php
on line
58

Deprecated
: ShipStream\Ups\Api\Normalizer\ResponseAlertNormalizer::supportsDenormalization(): Implicitly marking parameter $format as nullable is deprecated, the explicit nullable type must be used instead in
/var/www/html/vendor/shipstream/ups-rest-php-sdk/src/Api/Normalizer/ResponseAlertNormalizer.php
on line
82

Deprecated
: ShipStream\Ups\Api\Normalizer\ResponseAlertNormalizer::supportsNormalization(): Implicitly marking parameter $format as nullable is deprecated, the explicit nullable type must be used instead in
/var/www/html/vendor/shipstream/ups-rest-php-sdk/src/Api/Normalizer/ResponseAlertNormalizer.php
on line
86

Activity

  1. RickKukiela commented on Nov 13, 2025

    @RickKukiela
    ContributorAuthor

    @elidrissidev
    I submitted a PR to resolve this: #39

    I saw your note in the README that the offending classes were all generated so I wanted to follow your instructions to regenerate the files. Unfortunately my development environment is AMD64/WSL2/Ubuntu (Windows11) and the packaged generate.sh script file would not work for me. To work around this, I added the openapi-merge:152 package as composer dev dependency (and had to also lock cebe/php-openapi to version 1.7.0 otherwise 1.8.0 would be installed and this has an incompatibility with the "jane" scripting).

    In any event, my new generate-amd64.sh script that I created (which skips the docker image and runs the scripting directly from the composer installed packages) appeared to work correctly. It even generated new classes which automatically fixed all of the PHP 8.4 issues.

    I do find it odd that the overall the newly generated files have way less lines than the original, like an alarming amount of less lines, so you might want to double check all that before accepting the merge. I can tell you that I installed my version on one of my sites and all the UpsRate API calls I use this for are working correctly and no longer spawning the deprecated warnings.

    The test suite still passes with the code changes:

    $ composer run test
    > vendor/bin/phpunit
    PHPUnit 9.6.29 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.3.6
    Configuration: /home/open-source/ups-rest-php-sdk/phpunit.xml.dist
    
    ........                                                            8 / 8 (100%)
    
    Time: 00:00.035, Memory: 8.00 MB
    
    OK (8 tests, 24 assertions)
    

    Thanks!

  2. elidrissidev commented on Nov 13, 2025

    @elidrissidev
    Collaborator

    Hey @RickKukiela, thank you for your contribution!

    It seems there were some changes with JanePHP since I last generated the classes. The new generated code doesn't seem to include some conditionals that were there to fix some incompatibilities with using different versions of symphony/serializer. I will give this a look soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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