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

Deprecation functions - PHP 8.1 #364

Open
lamp5 opened this issue Dec 5, 2022 · 4 comments
Open

Deprecation functions - PHP 8.1 #364

lamp5 opened this issue Dec 5, 2022 · 4 comments

Comments

@lamp5
Copy link

lamp5 commented Dec 5, 2022

I can see a lot of deprecations when try to use id on PHP 8.1
`Deprecated: DOMDocument::createElement(): Passing null to parameter #2 ($value) of type string is deprecated in /var/www/vendor/gabrielbull/ups-api/src/Entity/PickupType.php on line 46

Deprecated: DOMDocument::createElement(): Passing null to parameter #2 ($value) of type string is deprecated in /var/www/vendor/gabrielbull/ups-api/src/Entity/Service.php on line 160

Deprecated: DOMDocument::createElement(): Passing null to parameter #2 ($value) of type string is deprecated in /var/www/vendor/gabrielbull/ups-api/src/Entity/ShipTo.php on line 145

Deprecated: DOMDocument::createElement(): Passing null to parameter #2 ($value) of type string is deprecated in /var/www/vendor/gabrielbull/ups-api/src/Entity/ShipTo.php on line 146

Deprecated: DOMDocument::createElement(): Passing null to parameter #2 ($value) of type string is deprecated in /var/www/vendor/gabrielbull/ups-api/src/Entity/PackagingType.php on line 96

Deprecated: DOMDocument::createElement(): Passing null to parameter #2 ($value) of type string is deprecated in /var/www/vendor/gabrielbull/ups-api/src/Entity/UnitOfMeasurement.php on line 105

Deprecated: DOMDocument::createElement(): Passing null to parameter #2 ($value) of type string is deprecated in /var/www/vendor/gabrielbull/ups-api/src/Entity/UnitOfMeasurement.php on line 105`

@Wilburunion
Copy link

Wilburunion commented Dec 8, 2022

Worked in php 7.4 upgraded to 8.1 and lots of things broke

It appears " $this->getDescription())); " has to be changed to " $this->getDescription()?: "")); " on the listed lines above to escape passing the NULL

@WouterSteen
Copy link

WouterSteen commented Dec 15, 2022

Add this one to the list: src/Entity/Translate.php

        $node->appendChild($document->createElement('LanguageCode', $this->getLanguageCode() ?? ''));

@szczesuil
Copy link

Is there a plan to upgrade this to work with php 8.1?

@jav666
Copy link

jav666 commented May 24, 2024

we have the php-ups-api running under PHP 8.2 without any problems.

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

5 participants