php-ups-api
php-ups-api copied to clipboard
Deprecation functions - PHP 8.1
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`
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
Add this one to the list: src/Entity/Translate.php
$node->appendChild($document->createElement('LanguageCode', $this->getLanguageCode() ?? ''));
Is there a plan to upgrade this to work with php 8.1?
we have the php-ups-api running under PHP 8.2 without any problems.