Changeset 3816018
- Timestamp:
- 11/22/2026 01:50:23 AM (less than one hour ago)
- Location:
- wc-shipstation-shipping
- Files:
-
- 8 added
- 200 edited
- 1 copied
-
tags/1.4.22 (copied) (copied from wc-shipstation-shipping/trunk )
-
tags/1.4.22/includes/Cache/Cache.php (modified) (2 diffs)
-
tags/1.4.22/includes/Cache/KeyGenerator.php (modified) (1 diff)
-
tags/1.4.22/includes/Cache/Storage/InMemory.php (added)
-
tags/1.4.22/includes/Cache/Storage/TmpFile.php (modified) (1 diff)
-
tags/1.4.22/includes/Cache/V2 (added)
-
tags/1.4.22/includes/Cache/V2/Cache.php (added)
-
tags/1.4.22/includes/Cache/V2/CacheInterface.php (added)
-
tags/1.4.22/includes/ClassNameFinder/ClassNameFinder.php (modified) (1 diff)
-
tags/1.4.22/includes/Logger/EchoLogger.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/AbstractEndPoint.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/EndPointFactory.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/AbstractExecutor.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorFactory.php (modified) (9 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorPerCarrier.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/MessagesHandlerFactory.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/TypeValuesLoader.php (modified) (2 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FileDownloader.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FilesDownloaderPromise.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ManifestFilesDownloader.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ShipmentFilesDownloader.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Form/AbstractForm.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/GenericAdapter.php (modified) (3 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/Client.php (modified) (4 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractRequest.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractResponseHandler.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/JsonResponseHandler.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutor.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutorFactory.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestFactory.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponseHandlerFactory.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponsesMerger.php (modified) (2 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/Request.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/Parts.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/ShipmentId.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringBuilder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringParser.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Collection.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/OrderPayload.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload.php (modified) (3 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Address.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Dimensions.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsArrayBuilder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsFactory.php (modified) (2 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Item.php (modified) (4 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ItemFactory.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Parcel.php (modified) (3 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelFactory.php (modified) (3 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelsFactory.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Weight.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightArrayBuilder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightFactory.php (modified) (2 diffs)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/PayloadFactory.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Types.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/BuyShipment.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/CreateOrder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetOrder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetRates.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetShipment.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetShipments.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/RateFilter/RateFilter.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/RefundShipment.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/ApiKey.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/Builder/AddressBuilder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedOrderOptionsBuilder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedShipmentOptionsBuilder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/OrderPayload.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/ShipmentPayload.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/BuyShipment.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/CreateManifest.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/Executor/GetShipmentsExecutor.php (modified) (2 diffs)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetManifest.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetRates.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipment.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipmentByShipmentId.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipments.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetTracking.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/RefundShipment.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/BuyShipmentResponseToShipmentTransformer.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/ManifestResponseToManifestTransformer.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/ApiKey.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/Builder/AddressBuilder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/Builder/AdvancedShipmentOptionsBuilder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/Builder/ShipmentDataBuilder.php (modified) (1 diff)
-
tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/ShipmentPayload.php (modified) (3 diffs)
-
tags/1.4.22/includes/UnitConverter/DimensionConverter.php (modified) (1 diff)
-
tags/1.4.22/includes/UnitConverter/UnitConverter.php (modified) (4 diffs)
-
tags/1.4.22/includes/UnitConverter/UnitConverterInterface.php (modified) (1 diff)
-
tags/1.4.22/includes/UnitConverter/WeightConverter.php (modified) (2 diffs)
-
tags/1.4.22/includes/WP/Admin/Notices/Notices.php (modified) (9 diffs)
-
tags/1.4.22/packages/guzzle/src/Handler/CurlFactory.php (modified) (3 diffs)
-
tags/1.4.22/packages/guzzle/src/Handler/CurlVersion.php (modified) (2 diffs)
-
tags/1.4.22/packages/guzzle/src/Utils.php (modified) (2 diffs)
-
tags/1.4.22/packages/promises/src/Create.php (modified) (1 diff)
-
tags/1.4.22/packages/promises/src/FulfilledPromise.php (modified) (1 diff)
-
tags/1.4.22/packages/promises/src/Promise.php (modified) (4 diffs)
-
tags/1.4.22/packages/promises/src/RejectedPromise.php (modified) (1 diff)
-
tags/1.4.22/packages/promises/src/Utils.php (modified) (1 diff)
-
tags/1.4.22/packages/psr7/src/AppendStream.php (modified) (1 diff)
-
tags/1.4.22/packages/psr7/src/InflateStream.php (modified) (2 diffs)
-
tags/1.4.22/packages/psr7/src/Message.php (modified) (1 diff)
-
tags/1.4.22/readme.txt (modified) (2 diffs)
-
tags/1.4.22/vendor/composer/installed.json (modified) (24 diffs)
-
tags/1.4.22/vendor/composer/installed.php (modified) (14 diffs)
-
tags/1.4.22/wc-shipstation-shipping.php (modified) (3 diffs)
-
trunk/includes/Cache/Cache.php (modified) (2 diffs)
-
trunk/includes/Cache/KeyGenerator.php (modified) (1 diff)
-
trunk/includes/Cache/Storage/InMemory.php (added)
-
trunk/includes/Cache/Storage/TmpFile.php (modified) (1 diff)
-
trunk/includes/Cache/V2 (added)
-
trunk/includes/Cache/V2/Cache.php (added)
-
trunk/includes/Cache/V2/CacheInterface.php (added)
-
trunk/includes/ClassNameFinder/ClassNameFinder.php (modified) (1 diff)
-
trunk/includes/Logger/EchoLogger.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/AbstractEndPoint.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/EndPointFactory.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/AbstractExecutor.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorFactory.php (modified) (9 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorPerCarrier.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/MessagesHandlerFactory.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/TypeValuesLoader.php (modified) (2 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FileDownloader.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FilesDownloaderPromise.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ManifestFilesDownloader.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ShipmentFilesDownloader.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Form/AbstractForm.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/GenericAdapter.php (modified) (3 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/Client.php (modified) (4 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractRequest.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractResponseHandler.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/JsonResponseHandler.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutor.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutorFactory.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestFactory.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponseHandlerFactory.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponsesMerger.php (modified) (2 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Http/Request.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/Parts.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/ShipmentId.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringBuilder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringParser.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Collection.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/OrderPayload.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload.php (modified) (3 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Address.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Dimensions.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsArrayBuilder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsFactory.php (modified) (2 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Item.php (modified) (4 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ItemFactory.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Parcel.php (modified) (3 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelFactory.php (modified) (3 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelsFactory.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Weight.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightArrayBuilder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightFactory.php (modified) (2 diffs)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/PayloadFactory.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/AbstractAdapter/Type/Types.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/EndPoint/BuyShipment.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/EndPoint/CreateOrder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetOrder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetRates.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetShipment.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetShipments.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/EndPoint/RateFilter/RateFilter.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/EndPoint/RefundShipment.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/Type/ApiKey.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/Type/Builder/AddressBuilder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedOrderOptionsBuilder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedShipmentOptionsBuilder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/Type/OrderPayload.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStation/Type/ShipmentPayload.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/BuyShipment.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/CreateManifest.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/Executor/GetShipmentsExecutor.php (modified) (2 diffs)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetManifest.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetRates.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipment.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipmentByShipmentId.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipments.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetTracking.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/RefundShipment.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/BuyShipmentResponseToShipmentTransformer.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/ManifestResponseToManifestTransformer.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/Type/ApiKey.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/Type/Builder/AddressBuilder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/Type/Builder/AdvancedShipmentOptionsBuilder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/Type/Builder/ShipmentDataBuilder.php (modified) (1 diff)
-
trunk/includes/ShippingCarrier/ShipStationV2/Type/ShipmentPayload.php (modified) (3 diffs)
-
trunk/includes/UnitConverter/DimensionConverter.php (modified) (1 diff)
-
trunk/includes/UnitConverter/UnitConverter.php (modified) (4 diffs)
-
trunk/includes/UnitConverter/UnitConverterInterface.php (modified) (1 diff)
-
trunk/includes/UnitConverter/WeightConverter.php (modified) (2 diffs)
-
trunk/includes/WP/Admin/Notices/Notices.php (modified) (9 diffs)
-
trunk/packages/guzzle/src/Handler/CurlFactory.php (modified) (3 diffs)
-
trunk/packages/guzzle/src/Handler/CurlVersion.php (modified) (2 diffs)
-
trunk/packages/guzzle/src/Utils.php (modified) (2 diffs)
-
trunk/packages/promises/src/Create.php (modified) (1 diff)
-
trunk/packages/promises/src/FulfilledPromise.php (modified) (1 diff)
-
trunk/packages/promises/src/Promise.php (modified) (4 diffs)
-
trunk/packages/promises/src/RejectedPromise.php (modified) (1 diff)
-
trunk/packages/promises/src/Utils.php (modified) (1 diff)
-
trunk/packages/psr7/src/AppendStream.php (modified) (1 diff)
-
trunk/packages/psr7/src/InflateStream.php (modified) (2 diffs)
-
trunk/packages/psr7/src/Message.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/composer/installed.json (modified) (24 diffs)
-
trunk/vendor/composer/installed.php (modified) (14 diffs)
-
trunk/wc-shipstation-shipping.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-shipstation-shipping/tags/1.4.22/includes/Cache/Cache.php
r3812630 r3816018 22 22 * @var Storage\StorageInterface 23 23 */ 24 private $storage;24 private Storage\StorageInterface $storage; 25 25 26 26 /** 27 27 * @var bool 28 28 */ 29 private $useCache;29 private bool $useCache; 30 30 31 31 /** 32 32 * @var int 33 33 */ 34 private $defaultExpiresAfter;34 private int $defaultExpiresAfter; 35 35 36 36 /** … … 84 84 * 85 85 * @param string $key 86 * @return true86 * @return bool 87 87 */ 88 88 public function has(string $key): bool -
wc-shipstation-shipping/tags/1.4.22/includes/Cache/KeyGenerator.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $suffix;24 protected string $suffix; 25 25 26 26 /** -
wc-shipstation-shipping/tags/1.4.22/includes/Cache/Storage/TmpFile.php
r3812630 r3816018 19 19 class TmpFile implements StorageInterface 20 20 { 21 /** 22 * @var string 23 */ 24 private $basePath; 21 private string $basePath; 25 22 26 23 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ClassNameFinder/ClassNameFinder.php
r3812630 r3816018 20 20 { 21 21 /** 22 * @var array 22 * @var array<mixed> 23 23 */ 24 private $baseClassPaths;24 private array $baseClassPaths = []; 25 25 26 26 /** -
wc-shipstation-shipping/tags/1.4.22/includes/Logger/EchoLogger.php
r3812630 r3816018 31 31 public function log(string $level, string $file, int $line, string $message, ...$args): void 32 32 { 33 echo sprintf("[%s:%s] %s\n", basename($file), $line, sprintf($message, ...$args)); 33 $output = sprintf("[%s:%s] %s\n", basename($file), $line, sprintf($message, ...$args)); 34 35 // Escaped, not raw: the log line renders in a browser view of the 36 // stream, and an injected message must not become markup there. 37 echo esc_html($output); 34 38 } 35 39 } -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/AbstractEndPoint.php
r3812630 r3816018 28 28 * @var CacheInterface 29 29 */ 30 protected $cache;30 protected CacheInterface $cache; 31 31 32 32 /** 33 33 * @var Payload 34 34 */ 35 protected $payload;35 protected Payload $payload; 36 36 37 37 /** 38 38 * @var KeyGeneratorInterface 39 39 */ 40 protected $keyGenerator;40 protected KeyGeneratorInterface $keyGenerator; 41 41 42 42 /** 43 43 * @var LoggerInterface 44 44 */ 45 protected $logger;45 protected LoggerInterface $logger; 46 46 47 47 /** 48 48 * @var string 49 49 */ 50 protected $textDomain;50 protected string $textDomain; 51 51 52 52 /** 53 53 * @var TypesInterface 54 54 */ 55 protected $types;55 protected TypesInterface $types; 56 56 57 57 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/EndPointFactory.php
r3812630 r3816018 29 29 * @var string 30 30 */ 31 private $textDomain;31 private string $textDomain; 32 32 33 33 /** 34 34 * @var LoggerInterface 35 35 */ 36 private $logger;36 private LoggerInterface $logger; 37 37 38 38 /** 39 39 * @var TypesInterface 40 40 */ 41 private $types;41 private TypesInterface $types; 42 42 43 43 /** 44 44 * @var KeyGeneratorInterface 45 45 */ 46 private $keyGenerator;46 private KeyGeneratorInterface $keyGenerator; 47 47 48 48 /** 49 49 * @var CacheInterface 50 50 */ 51 private $cache;51 private CacheInterface $cache; 52 52 53 53 /** 54 54 * @var ClassNameFinder 55 55 */ 56 private $classNameFinder;56 private ClassNameFinder $classNameFinder; 57 57 58 58 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/AbstractExecutor.php
r3812630 r3816018 29 29 * @var LoggerInterface 30 30 */ 31 protected $logger;31 protected LoggerInterface $logger; 32 32 33 33 /** 34 34 * @var RequestExecutorInterface 35 35 */ 36 protected $requestExecutor;36 protected RequestExecutorInterface $requestExecutor; 37 37 38 38 /** 39 39 * @var EndPointFactoryInterface 40 40 */ 41 protected $endPointFactory;41 protected EndPointFactoryInterface $endPointFactory; 42 42 43 43 /** 44 44 * @var PayloadFactoryInterface 45 45 */ 46 protected $payloadFactory;46 protected PayloadFactoryInterface $payloadFactory; 47 47 48 48 /** 49 49 * @var FeaturesInterface 50 50 */ 51 protected $features;51 protected FeaturesInterface $features; 52 52 53 53 /** 54 54 * @var TypesInterface 55 55 */ 56 protected $types;56 protected TypesInterface $types; 57 57 58 58 /** 59 59 * @var string 60 60 */ 61 protected $endPointName;61 protected string $endPointName; 62 62 63 63 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorFactory.php
r3812630 r3816018 17 17 namespace OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\Executor; 18 18 19 use OneTeamSoftware\Cache\CacheInterface; 19 20 use OneTeamSoftware\ClassNameFinder\ClassNameFinder; 20 21 use OneTeamSoftware\Logger\LoggerInterface; … … 24 25 use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\PayloadFactoryInterface; 25 26 use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\TypesInterface; 27 use ReflectionException; 28 use ReflectionMethod; 29 use ReflectionNamedType; 26 30 27 31 class ExecutorFactory implements ExecutorFactoryInterface … … 30 34 * @var LoggerInterface 31 35 */ 32 protected $logger;36 protected LoggerInterface $logger; 33 37 34 38 /** 35 39 * @var RequestExecutorInterface 36 40 */ 37 protected $requestExecutor;41 protected RequestExecutorInterface $requestExecutor; 38 42 39 43 /** 40 44 * @var EndPointFactoryInterface 41 45 */ 42 protected $endPointFactory;46 protected EndPointFactoryInterface $endPointFactory; 43 47 44 48 /** 45 49 * @var PayloadFactoryInterface 46 50 */ 47 protected $payloadFactory;51 protected PayloadFactoryInterface $payloadFactory; 48 52 49 53 /** 50 54 * @var FeaturesInterface 51 55 */ 52 protected $features;56 protected FeaturesInterface $features; 53 57 54 58 /** 55 59 * @var TypesInterface 56 60 */ 57 protected $types;61 protected TypesInterface $types; 58 62 59 63 /** 60 64 * @var ClassNameFinder 61 65 */ 62 protected $classNameFinder;66 protected ClassNameFinder $classNameFinder; 63 67 64 68 /** 65 69 * @var array<string,ExecutorInterface> 66 70 */ 67 protected $instances; 71 protected array $instances; 72 73 /** 74 * Optional cache injected into executors that need it (e.g. FedEx OAuth 75 * token caching). Null means no caching (backwards-compatible default). 76 * 77 * @var CacheInterface|null 78 */ 79 private ?CacheInterface $cache = null; 68 80 69 81 /** … … 77 89 * @param PayloadFactoryInterface $payloadFactory 78 90 * @param ClassNameFinder $classNameFinder 91 * @param CacheInterface|null $cache Optional cache for executors that cache tokens/responses 79 92 */ 80 93 public function __construct( … … 85 98 EndPointFactoryInterface $endPointFactory, 86 99 PayloadFactoryInterface $payloadFactory, 87 ClassNameFinder $classNameFinder 100 ClassNameFinder $classNameFinder, 101 ?CacheInterface $cache = null 88 102 ) { 89 103 $this->features = $features; … … 94 108 $this->payloadFactory = $payloadFactory; 95 109 $this->classNameFinder = $classNameFinder; 110 $this->cache = $cache; 96 111 $this->instances = []; 97 112 } … … 115 130 } 116 131 117 $executor = new $executorClassName( 132 // Build the base constructor arguments shared by all executors 133 // (AbstractExecutor signature). 134 $constructorArguments = [ 118 135 $this->features, 119 136 $this->types, … … 122 139 $this->endPointFactory, 123 140 $this->payloadFactory, 124 $endPointName 125 ); 141 $endPointName, 142 ]; 143 144 // Only append the optional cache argument when the concrete executor's 145 // constructor declares an additional (optional) cache parameter. This 146 // keeps backwards compatibility with executors that only accept the 147 // base 7-parameter AbstractExecutor signature. 148 if ($this->cache !== null && $this->constructorAcceptsCache($executorClassName)) { 149 $constructorArguments[] = $this->cache; 150 } 151 152 $executor = new $executorClassName(...$constructorArguments); 126 153 127 154 $this->instances[$endPointName] = $executor; … … 129 156 return $executor; 130 157 } 158 159 /** 160 * Returns true when the given executor class declares an 8th constructor 161 * parameter typed as CacheInterface (used to inject the OAuth token cache 162 * into carriers like FedEx without breaking executors that do not accept it). 163 * 164 * @param string $executorClassName Fully-qualified executor class name 165 * @return bool 166 */ 167 private function constructorAcceptsCache(string $executorClassName): bool 168 { 169 try { 170 $reflectionMethod = new ReflectionMethod($executorClassName, '__construct'); 171 } catch (ReflectionException $reflectionException) { 172 return false; 173 } 174 175 $parameters = $reflectionMethod->getParameters(); 176 if (count($parameters) <= 7) { 177 return false; 178 } 179 180 $cacheParameter = $parameters[7]; 181 $parameterType = $cacheParameter->getType(); 182 if ($parameterType === null) { 183 return false; 184 } 185 186 $typeName = $parameterType instanceof ReflectionNamedType 187 ? $parameterType->getName() 188 : (string) $parameterType; 189 190 return $typeName === CacheInterface::class 191 || is_a($typeName, CacheInterface::class, true); 192 } 131 193 } -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorPerCarrier.php
r3812630 r3816018 57 57 if (false === empty($data['carriers']) && is_array($data['carriers'])) { 58 58 $carriers = $data['carriers']; 59 } else if (false === empty($this->types->getCarriers())){59 } else { 60 60 $carriers = array_keys($this->types->getCarriers()->toArray()); 61 61 } -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/MessagesHandlerFactory.php
r3812630 r3816018 24 24 * @var ClassNameFinder 25 25 */ 26 private $classNameFinder;26 private ClassNameFinder $classNameFinder; 27 27 28 28 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/TypeValuesLoader.php
r3812630 r3816018 26 26 * @var LoggerInterface 27 27 */ 28 protected $logger;28 protected LoggerInterface $logger; 29 29 30 30 /** 31 31 * @var ExecutorFactoryInterface 32 32 */ 33 protected $executorFactory;33 protected ExecutorFactoryInterface $executorFactory; 34 34 35 35 /** 36 * @var array 36 * @var array<mixed> 37 37 */ 38 protected $messages;38 protected array $messages; 39 39 40 40 /** … … 145 145 146 146 foreach ($response as $key => $keyValues) { 147 if (!is_array($keyValues)) { 148 $this->logger->debug(__FILE__, __LINE__, 'Skip non-array response key %s: %s', (string)$key, print_r($keyValues, true)); 149 continue; 150 } 151 147 152 if (empty($values[$key])) { 148 153 $values[$key] = []; -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FileDownloader.php
r3812630 r3816018 29 29 * @var LoggerInterface 30 30 */ 31 protected $logger;31 protected LoggerInterface $logger; 32 32 33 33 /** 34 34 * @var ClientInterface 35 35 */ 36 protected $client;36 protected ClientInterface $client; 37 37 38 38 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FilesDownloaderPromise.php
r3812630 r3816018 24 24 * @var FilesDownloaderInterface 25 25 */ 26 protected $filesDownloader;26 protected FilesDownloaderInterface $filesDownloader; 27 27 28 28 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ManifestFilesDownloader.php
r3812630 r3816018 26 26 * @var FileDownloaderInterface 27 27 */ 28 protected $fileDownloader;28 protected FileDownloaderInterface $fileDownloader; 29 29 30 30 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ShipmentFilesDownloader.php
r3812630 r3816018 26 26 * @var FileDownloaderInterface 27 27 */ 28 protected $fileDownloader;28 protected FileDownloaderInterface $fileDownloader; 29 29 30 30 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Form/AbstractForm.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $textDomain;24 protected string $textDomain; 25 25 26 26 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/GenericAdapter.php
r3812630 r3816018 66 66 * @var string 67 67 */ 68 protected $adapterName;68 protected string $adapterName; 69 69 70 70 /** 71 71 * @var string 72 72 */ 73 protected $textDomain;73 protected string $textDomain; 74 74 75 75 /** 76 76 * @var string 77 77 */ 78 protected $name;78 protected string $name; 79 79 80 80 /** 81 81 * @var ClientInterface 82 82 */ 83 protected $client;83 protected ClientInterface $client; 84 84 85 85 /** 86 86 * @var LoggerInterface 87 87 */ 88 protected $logger;88 protected LoggerInterface $logger; 89 89 90 90 /** 91 91 * @var KeyGeneratorInterface 92 92 */ 93 protected $keyGenerator;93 protected KeyGeneratorInterface $keyGenerator; 94 94 95 95 /** 96 96 * @var CacheInterface 97 97 */ 98 protected $cache;98 protected CacheInterface $cache; 99 99 100 100 /** 101 101 * @var TypesInterface 102 102 */ 103 protected $types;103 protected TypesInterface $types; 104 104 105 105 /** 106 106 * @var FeaturesInterface 107 107 */ 108 protected $features;108 protected FeaturesInterface $features; 109 109 110 110 /** 111 111 * @var FormInterface 112 112 */ 113 protected $form;113 protected FormInterface $form; 114 114 115 115 /** 116 116 * @var ClassNameFinder 117 117 */ 118 protected $classNameFinder;118 protected ClassNameFinder $classNameFinder; 119 119 120 120 /** 121 121 * @var PayloadFactory 122 122 */ 123 protected $payloadFactory;123 protected PayloadFactory $payloadFactory; 124 124 125 125 /** 126 126 * @var ExecutorFactory 127 127 */ 128 protected $executorFactory;128 protected ExecutorFactory $executorFactory; 129 129 130 130 /** … … 667 667 array_merge( 668 668 $this->form->getFieldValues($data), 669 ['init_types_cache_key' => 'types'] 669 [ 670 'init_types_cache_key' => 'types', 671 'sandbox' => !empty($data['sandbox']), 672 ] 670 673 ) 671 674 ); … … 950 953 $endPointFactory, 951 954 $this->payloadFactory, 952 $this->classNameFinder 955 $this->classNameFinder, 956 $this->cache 953 957 ); 954 958 } -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/Client.php
r3812630 r3816018 27 27 { 28 28 /** 29 * What replaces a credential in the debug log. 30 * 31 * @var string 32 */ 33 private const REDACTED = '[REDACTED]'; 34 35 /** 36 * Bodies above this size (base64 labels, PDFs) are logged as their size only: 37 * scanning them costs more than they are worth in a debug log. 38 * 39 * @var int 40 */ 41 private const MAXIMUM_REDACTED_BODY_BYTES = 65536; 42 43 /** 44 * Name fragments that mark a header or field as a credential, compared 45 * against the name lowercased with '-' and '_' removed (API-Key, api_key and 46 * apiKey all become "apikey"). The debug log is shipped in support bundles, 47 * so carrier credentials must never reach it (#732). 48 * 49 * @var array<string> 50 */ 51 private const CREDENTIAL_NAME_FRAGMENTS = [ 52 'authorization', 53 'password', 54 'passwd', 55 'secret', 56 'token', 57 'apikey', 58 'accesskey', 59 'privatekey', 60 'licensekey', 61 'cookie', 62 ]; 63 64 /** 29 65 * @var GuzzleClientInterface 30 66 */ 31 protected $httpClient;67 protected GuzzleClientInterface $httpClient; 32 68 33 69 /** 34 70 * @var LoggerInterface 35 71 */ 36 protected $logger;72 protected LoggerInterface $logger; 37 73 38 74 /** … … 63 99 64 100 // @codingStandardsIgnoreLine 65 $this->logger->debug(__FILE__, __LINE__, 'sendAsync, method: %s, uri: %s, headers: %s, body: %s', $method, $ uri, print_r($headers, true), $body);101 $this->logger->debug(__FILE__, __LINE__, 'sendAsync, method: %s, uri: %s, headers: %s, body: %s', $method, $this->redactQueryParameters($uri), print_r($this->redactHeaders($headers), true), $this->redactBody($body)); 66 102 67 103 $httpRequest = new HttpRequest( … … 98 134 99 135 // @codingStandardsIgnoreLine 100 $this->logger->debug(__FILE__, __LINE__, 'Response code: %d, contents: %s', $statusCode, (ctype_print($contents) ? $ contents: 'binary contents'));136 $this->logger->debug(__FILE__, __LINE__, 'Response code: %d, contents: %s', $statusCode, (ctype_print($contents) ? $this->redactBody($contents) : 'binary contents')); 101 137 102 138 return $responseHandler->getResponse($contents, $statusCode); 139 } 140 141 /** 142 * returns headers with credential values replaced 143 * 144 * @param array<mixed> $headers 145 * @return array<mixed> 146 */ 147 private function redactHeaders(array $headers): array 148 { 149 foreach ($headers as $name => $value) { 150 if ($this->isCredentialName((string) $name)) { 151 $headers[$name] = self::REDACTED; 152 } 153 } 154 155 return $headers; 156 } 157 158 /** 159 * returns a request or response body with credential values replaced, for 160 * the JSON, form-encoded and XML bodies the carrier adapters exchange 161 * 162 * @param string $body 163 * @return string 164 */ 165 private function redactBody(string $body): string 166 { 167 if (strlen($body) > self::MAXIMUM_REDACTED_BODY_BYTES) { 168 return '[' . strlen($body) . ' bytes, not logged]'; 169 } 170 171 $decoded = json_decode($body, true); 172 if (is_array($decoded)) { 173 return (string) json_encode($this->redactArray($decoded), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); 174 } 175 176 if (preg_match('/^[^\s<{]+=[^\s]*$/', $body) === 1) { 177 parse_str($body, $fields); 178 179 return http_build_query($this->redactArray($fields)); 180 } 181 182 $redacted = preg_replace_callback( 183 '/<([A-Za-z0-9_:.-]+)(\s[^>]*)?>(<!\[CDATA\[.*?\]\]>|[^<]*)<\/\1>/s', 184 function (array $matches): string { 185 if (!$this->isCredentialName($matches[1])) { 186 return $matches[0]; 187 } 188 189 return '<' . $matches[1] . $matches[2] . '>' . self::REDACTED . '</' . $matches[1] . '>'; 190 }, 191 $body 192 ); 193 if ($redacted !== null) { 194 $redacted = preg_replace_callback( 195 '/([A-Za-z0-9_:.-]+)(\s*=\s*)(["\'])([^"\'\r\n]*)\3/', 196 function (array $matches): string { 197 if (!$this->isCredentialName($matches[1])) { 198 return $matches[0]; 199 } 200 201 return $matches[1] . $matches[2] . $matches[3] . self::REDACTED . $matches[3]; 202 }, 203 $redacted 204 ); 205 } 206 207 if ($redacted !== null) { 208 // JSON that did not decode (Guzzle truncates the body in exception 209 // messages): redact "name":"value" pairs textually. 210 $redacted = preg_replace_callback( 211 '/"([^"\\\\]+)"(\s*:\s*)"((?:[^"\\\\]|\\\\.)*)("?)/', 212 function (array $matches): string { 213 if (!$this->isCredentialName($matches[1])) { 214 return $matches[0]; 215 } 216 217 return '"' . $matches[1] . '"' . $matches[2] . '"' . self::REDACTED . $matches[4]; 218 }, 219 $redacted 220 ); 221 } 222 223 return $redacted ?? '[body not logged: redaction failed, preg error ' . preg_last_error() . ']'; 224 } 225 226 /** 227 * returns text with credential query parameters (?api_key=... / &token=...) replaced 228 * 229 * @param string $text 230 * @return string 231 */ 232 private function redactQueryParameters(string $text): string 233 { 234 $redacted = preg_replace_callback( 235 '/([?&])([^=&\s#]+)=([^&\s#]*)/', 236 function (array $matches): string { 237 return $this->isCredentialName(urldecode($matches[2])) ? $matches[1] . $matches[2] . '=' . self::REDACTED : $matches[0]; 238 }, 239 $text 240 ); 241 242 return $redacted ?? '[not logged: redaction failed, preg error ' . preg_last_error() . ']'; 243 } 244 245 /** 246 * returns a decoded body with credential values replaced, at any depth 247 * 248 * @param array<mixed> $fields 249 * @return array<mixed> 250 */ 251 private function redactArray(array $fields): array 252 { 253 foreach ($fields as $name => $value) { 254 if (is_string($name) && $this->isCredentialName($name)) { 255 $fields[$name] = self::REDACTED; 256 } elseif (is_array($value)) { 257 $fields[$name] = $this->redactArray($value); 258 } 259 } 260 261 return $fields; 262 } 263 264 /** 265 * returns true when a header or field name carries a credential 266 * 267 * @param string $name 268 * @return bool 269 */ 270 private function isCredentialName(string $name): bool 271 { 272 $normalizedName = str_replace(['-', '_'], '', strtolower($name)); 273 if ($normalizedName === 'key') { 274 return true; 275 } 276 277 foreach (self::CREDENTIAL_NAME_FRAGMENTS as $fragment) { 278 if (strpos($normalizedName, $fragment) !== false) { 279 return true; 280 } 281 } 282 283 return false; 103 284 } 104 285 … … 111 292 private function getErrorResponse(GuzzleException $httpException): array 112 293 { 113 $this->logger->debug(__FILE__, __LINE__, 'Exception: %s', print_r($httpException, true));294 $this->logger->debug(__FILE__, __LINE__, 'Exception: %s', $this->redactQueryParameters($this->redactBody($httpException->getMessage()))); 114 295 115 296 $newResponse = []; -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractRequest.php
r3812630 r3816018 22 22 { 23 23 /** 24 * @var array 24 * @var array<mixed> 25 25 */ 26 protected $extras;26 protected array $extras; 27 27 28 28 /** 29 29 * @var EndPointInterface 30 30 */ 31 protected $endPoint;31 protected EndPointInterface $endPoint; 32 32 33 33 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractResponseHandler.php
r3812630 r3816018 26 26 * @var LoggerInterface 27 27 */ 28 protected $logger;28 protected LoggerInterface $logger; 29 29 30 30 /** 31 31 * @var EndPointInterface 32 32 */ 33 protected $endPoint;33 protected EndPointInterface $endPoint; 34 34 35 35 /** 36 36 * @var MessagesHandlerInterface 37 37 */ 38 protected $messagesHandler;38 protected MessagesHandlerInterface $messagesHandler; 39 39 40 40 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/JsonResponseHandler.php
r3812630 r3816018 30 30 $this->logger->debug(__FILE__, __LINE__, 'Response: %s', (string)$contents); 31 31 32 $newResponse = []; 32 $newResponse = [ 33 'code' => $statusCode, 34 ]; 33 35 34 36 $response = json_decode($contents, true) ?? []; -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutor.php
r3812630 r3816018 28 28 * @var ClientInterface 29 29 */ 30 protected $client;30 protected ClientInterface $client; 31 31 32 32 /** 33 33 * @var LoggerInterface 34 34 */ 35 protected $logger;35 protected LoggerInterface $logger; 36 36 37 37 /** 38 38 * @var RequestFactoryInterface 39 39 */ 40 protected $requestFactory;40 protected RequestFactoryInterface $requestFactory; 41 41 42 42 /** 43 43 * @var ResponseHandlerFactoryInterface 44 44 */ 45 protected $responseHandlerFactory;45 protected ResponseHandlerFactoryInterface $responseHandlerFactory; 46 46 47 47 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutorFactory.php
r3812630 r3816018 26 26 * @var ClientInterface 27 27 */ 28 protected $client;28 protected ClientInterface $client; 29 29 30 30 /** 31 31 * @var LoggerInterface 32 32 */ 33 protected $logger;33 protected LoggerInterface $logger; 34 34 35 35 /** 36 36 * @var RequestFactoryInterface 37 37 */ 38 protected $requestFactory;38 protected RequestFactoryInterface $requestFactory; 39 39 40 40 /** 41 41 * @var ResponseHandlerFactoryInterface 42 42 */ 43 protected $responseHandlerFactory;43 protected ResponseHandlerFactoryInterface $responseHandlerFactory; 44 44 45 45 /** 46 46 * @var ClassNameFinder 47 47 */ 48 protected $classNameFinder;48 protected ClassNameFinder $classNameFinder; 49 49 50 50 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestFactory.php
r3812630 r3816018 25 25 * @var ClassNameFinder 26 26 */ 27 private $classNameFinder;27 private ClassNameFinder $classNameFinder; 28 28 29 29 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponseHandlerFactory.php
r3812630 r3816018 28 28 * @var LoggerInterface 29 29 */ 30 private $logger;30 private LoggerInterface $logger; 31 31 32 32 /** 33 33 * @var MessagesHandlerInterface 34 34 */ 35 private $messagesHandler;35 private MessagesHandlerInterface $messagesHandler; 36 36 37 37 /** 38 38 * @var ClassNameFinder 39 39 */ 40 private $classNameFinder;40 private ClassNameFinder $classNameFinder; 41 41 42 42 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponsesMerger.php
r3812630 r3816018 21 21 use OneTeamSoftware\Packages\GuzzleHttp\Promise\PromiseInterface; 22 22 use OneTeamSoftware\Packages\GuzzleHttp\Promise\Utils; 23 use Throwable; 23 24 24 25 class ResponsesMerger 25 26 { 26 /** 27 * @var LoggerInterface 28 */ 29 protected $logger; 27 protected LoggerInterface $logger; 30 28 31 /** 32 * @var ArrayRecursiveDistinctMerger 33 */ 34 protected $arrayMerger; 29 protected ArrayRecursiveDistinctMerger $arrayMerger; 35 30 36 31 /** … … 46 41 47 42 /** 48 * creates a single promise for the multiple promises43 * Merges multiple response promises into a single response promise. 49 44 * 50 * @param array $promises 45 * Uses Utils::settle so every promise is awaited regardless of outcome: one 46 * rejected promise (a carrier or package request that failed) cannot void the 47 * whole merge. Fulfilled responses are recursively merged; rejected ones are 48 * dropped and their failures surfaced in the merged response's `messages` 49 * (plain strings, the framework convention), so working carriers' data still 50 * comes through and the caller can see what failed. 51 * 52 * @param array<PromiseInterface> $promises 51 53 * @return PromiseInterface 52 54 */ 53 55 public function merge(array $promises): PromiseInterface 54 56 { 55 $promise = Utils::all($promises); 56 $promise = $promise->then( 57 function (array $responses) { 58 $newResponse = []; 59 foreach ($responses as $response) { 60 $this->logger->debug(__FILE__, __LINE__, 'Merge Response: %s', print_r($response, true)); 61 62 $newResponse = $this->arrayMerger->merge($newResponse, $response); 63 } 64 65 $this->logger->debug(__FILE__, __LINE__, 'New Response: %s', print_r($newResponse, true)); 66 67 return $newResponse; 57 return Utils::settle($promises)->then( 58 function (array $settled): array { 59 return $this->mergeSettledResults($settled); 68 60 } 69 61 ); 62 } 70 63 71 return $promise; 64 /** 65 * Reduces the settled promise results into a single merged response. 66 * 67 * Fulfilled results are merged in order; rejected results are collected as 68 * human-readable failure messages and appended to the merged response. 69 * 70 * @param array $settled results as returned by Utils::settle, each with a `state` key 71 * @return array<string, mixed> 72 */ 73 private function mergeSettledResults(array $settled): array 74 { 75 $mergedResponse = []; 76 $failureMessages = []; 77 78 foreach ($settled as $key => $result) { 79 if ($this->isFulfilled($result)) { 80 $mergedResponse = $this->mergeResponse($mergedResponse, $this->extractValue($result)); 81 continue; 82 } 83 84 $failureMessages[] = $this->buildFailureMessage($key, $result); 85 } 86 87 return $this->withFailureMessages($mergedResponse, $failureMessages); 88 } 89 90 /** 91 * Returns true when a settled result represents a fulfilled promise. 92 * 93 * @param mixed $result one settled result entry 94 * @return bool 95 */ 96 private function isFulfilled($result): bool 97 { 98 return is_array($result) && ($result['state'] ?? '') === PromiseInterface::FULFILLED; 99 } 100 101 /** 102 * Extracts the fulfilled promise's value as an array, defaulting to empty. 103 * 104 * @param array $result a fulfilled settled result entry 105 * @return array<string, mixed> 106 */ 107 private function extractValue(array $result): array 108 { 109 $value = $result['value'] ?? []; 110 111 return is_array($value) ? $value : []; 112 } 113 114 /** 115 * Merges a single fulfilled response into the accumulator, logging it for debugging. 116 * 117 * @param array<string, mixed> $mergedResponse the running merged response 118 * @param array<string, mixed> $response the fulfilled response to fold in 119 * @return array<string, mixed> 120 */ 121 private function mergeResponse(array $mergedResponse, array $response): array 122 { 123 $this->logger->debug(__FILE__, __LINE__, 'Merge Response: %s', print_r($response, true)); 124 125 return $this->arrayMerger->merge($mergedResponse, $response); 126 } 127 128 /** 129 * Builds a human-readable failure message for a rejected promise, logging a warning. 130 * 131 * @param int|string $key the promise key (e.g. carrier prefix or package index) 132 * @param mixed $result the rejected settled result entry 133 * @return string 134 */ 135 private function buildFailureMessage($key, $result): string 136 { 137 $reason = is_array($result) ? ($result['reason'] ?? null) : null; 138 $message = $reason instanceof Throwable ? $reason->getMessage() : (string) $reason; 139 140 $this->logger->warning( 141 __FILE__, 142 __LINE__, 143 'Merge dropping rejected promise for "%s": %s', 144 (string) $key, 145 $message 146 ); 147 148 return sprintf('Carrier "%s" request failed: %s', (string) $key, $message); 149 } 150 151 /** 152 * Appends rejected-carrier failure messages to the merged response, preserving any 153 * messages already present in fulfilled responses. 154 * 155 * @param array<string, mixed> $mergedResponse 156 * @param array<int, string> $failureMessages 157 * @return array<string, mixed> 158 */ 159 private function withFailureMessages(array $mergedResponse, array $failureMessages): array 160 { 161 if (empty($failureMessages)) { 162 return $mergedResponse; 163 } 164 165 $existingMessages = isset($mergedResponse['messages']) && is_array($mergedResponse['messages']) 166 ? $mergedResponse['messages'] 167 : []; 168 $mergedResponse['messages'] = array_merge($existingMessages, $failureMessages); 169 170 return $mergedResponse; 72 171 } 73 172 } -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/Request.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $method;24 protected string $method; 25 25 26 26 /** 27 27 * @var string 28 28 */ 29 protected $uri;29 protected string $uri; 30 30 31 31 /** 32 * @var array 32 * @var array<mixed> 33 33 */ 34 protected $headers;34 protected array $headers; 35 35 36 36 /** 37 37 * @var string 38 38 */ 39 protected $body;39 protected string $body; 40 40 41 41 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/Parts.php
r3812630 r3816018 24 24 * @var integer 25 25 */ 26 protected $index;26 protected int $index; 27 27 28 28 /** 29 * @var array 29 * @var array<mixed> 30 30 */ 31 protected $parts;31 protected array $parts; 32 32 33 33 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/ShipmentId.php
r3812630 r3816018 22 22 * @var StringBuilder 23 23 */ 24 protected $stringBuilder;24 protected StringBuilder $stringBuilder; 25 25 26 26 /** 27 * @var array 27 * @var array<mixed> 28 28 */ 29 protected $values;29 protected array $values; 30 30 31 31 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringBuilder.php
r3812630 r3816018 22 22 * @var Parts $parts 23 23 */ 24 protected $parts;24 protected Parts $parts; 25 25 26 26 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringParser.php
r3812630 r3816018 22 22 * @var Parts $parts 23 23 */ 24 protected $parts;24 protected Parts $parts; 25 25 26 26 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Collection.php
r3812630 r3816018 20 20 { 21 21 /** 22 * @var array 22 * @var array<mixed> 23 23 */ 24 protected $values;24 protected array $values; 25 25 26 26 /** 27 * @var array 27 * @var array<mixed> 28 28 */ 29 protected $lowercaseKeyMap;29 protected array $lowercaseKeyMap; 30 30 31 31 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/OrderPayload.php
r3812630 r3816018 26 26 * @var Payload 27 27 */ 28 protected $payload;28 protected Payload $payload; 29 29 30 30 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload.php
r3812630 r3816018 33 33 * @var DictionaryInterface 34 34 */ 35 protected $dictionary;35 protected DictionaryInterface $dictionary; 36 36 37 37 /** 38 38 * @var TypesInterface 39 39 */ 40 protected $types;40 protected TypesInterface $types; 41 41 42 42 /** 43 43 * @var ParcelsFactory 44 44 */ 45 protected $parcelsFactory;45 protected ParcelsFactory $parcelsFactory; 46 46 47 47 /** 48 48 * @var AddressFactory 49 49 */ 50 protected $addressFactory;50 protected AddressFactory $addressFactory; 51 51 52 52 /** 53 53 * @var ItemFactory 54 54 */ 55 protected $itemFactory;55 protected ItemFactory $itemFactory; 56 56 57 57 /** 58 58 * @var DimensionsFactory 59 59 */ 60 protected $dimensionsFactory;60 protected DimensionsFactory $dimensionsFactory; 61 61 62 62 /** 63 63 * @var WeightFactory 64 64 */ 65 protected $weightFactory;65 protected WeightFactory $weightFactory; 66 66 67 67 /** 68 68 * @var array<Parcel> 69 69 */ 70 protected $parcels;71 72 /** 73 * @var array<string, Item>74 */ 75 protected $itemsPerKey;70 protected ?array $parcels = null; 71 72 /** 73 * @var array<string,array<\OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\Payload\Item>> 74 */ 75 protected array $itemsPerKey; 76 76 77 77 /** 78 78 * @var array<string,Dimensions> 79 79 */ 80 protected $dimensionsPerKey;80 protected array $dimensionsPerKey; 81 81 82 82 /** 83 83 * @var array<string,Weight> 84 84 */ 85 protected $weightPerKey;86 87 /** 88 * @var array 89 */ 90 protected $addressesPerKey;85 protected array $weightPerKey; 86 87 /** 88 * @var array<mixed> 89 */ 90 protected array $addressesPerKey; 91 91 92 92 /** … … 291 291 * 292 292 * @param string $key 293 * @return array< Item>293 * @return array<\OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\Payload\Item> 294 294 */ 295 295 public function getItems(string $key): array … … 842 842 * returns COD amount 843 843 * 844 * @return string844 * @return float 845 845 */ 846 846 public function getCodAmount(): float -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Address.php
r3812630 r3816018 24 24 * @var DictionaryInterface 25 25 */ 26 private $dictionary;26 private DictionaryInterface $dictionary; 27 27 28 28 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Dimensions.php
r3812630 r3816018 22 22 { 23 23 /** 24 * @var Dictionary 24 * @var DictionaryInterface 25 25 */ 26 private $dictionary;26 private DictionaryInterface $dictionary; 27 27 28 28 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsArrayBuilder.php
r3812630 r3816018 26 26 * @var CollectionInterface 27 27 */ 28 private $dimensionUnits;28 private CollectionInterface $dimensionUnits; 29 29 30 30 /** 31 31 * @var DimensionConverter 32 32 */ 33 private $dimensionConverter;33 private DimensionConverter $dimensionConverter; 34 34 35 35 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsFactory.php
r3812630 r3816018 24 24 * @var DimensionsArrayBuilder 25 25 */ 26 private $dimensionsArrayBuilder;26 private DimensionsArrayBuilder $dimensionsArrayBuilder; 27 27 28 28 /** … … 40 40 * 41 41 * @param DictionaryInterface $dictionary 42 * @return Item42 * @return Dimensions 43 43 */ 44 44 public function create(DictionaryInterface $dictionary): Dimensions -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Item.php
r3812630 r3816018 23 23 { 24 24 /** 25 * @var Dictionary 26 */ 27 private $dictionary;25 * @var DictionaryInterface 26 */ 27 private DictionaryInterface $dictionary; 28 28 29 29 /** 30 30 * @var Dimensions 31 31 */ 32 private $dimensions;32 private ?Dimensions $dimensions = null; 33 33 34 34 /** 35 35 * @var Weight 36 36 */ 37 private $weight;37 private ?Weight $weight = null; 38 38 39 39 /** … … 100 100 101 101 /** 102 * returns manufacturer name 103 * 104 * @return string 105 */ 106 public function getManufacturerName(): string 107 { 108 return $this->dictionary->getString('manufacturer_name'); 109 } 110 111 /** 112 * returns manufacturer address line 1 113 * 114 * @return string 115 */ 116 public function getManufacturerAddress1(): string 117 { 118 return $this->dictionary->getString('manufacturer_address1'); 119 } 120 121 /** 122 * returns manufacturer city 123 * 124 * @return string 125 */ 126 public function getManufacturerCity(): string 127 { 128 return $this->dictionary->getString('manufacturer_city'); 129 } 130 131 /** 132 * returns manufacturer province/state code 133 * 134 * @return string 135 */ 136 public function getManufacturerProvinceCode(): string 137 { 138 return $this->dictionary->getString('manufacturer_province_code'); 139 } 140 141 /** 142 * returns manufacturer postal code 143 * 144 * @return string 145 */ 146 public function getManufacturerPostalCode(): string 147 { 148 return $this->dictionary->getString('manufacturer_postal_code'); 149 } 150 151 /** 152 * returns manufacturer country code 153 * 154 * @return string 155 */ 156 public function getManufacturerCountryCode(): string 157 { 158 return $this->dictionary->getString('manufacturer_country_code'); 159 } 160 161 /** 102 162 * returns country of origin 103 163 * … … 150 210 } 151 211 152 $this->dimensions = $this->dictionary->get('dimensions'); 153 if (false === ($this->dimensions instanceof Dimensions)) { 154 $this->dimensions = new Dimensions(new Dictionary([])); 155 } 212 $dimensions = $this->dictionary->get('dimensions'); 213 if (false === ($dimensions instanceof Dimensions)) { 214 $dimensions = new Dimensions(new Dictionary([])); 215 } 216 $this->dimensions = $dimensions; 156 217 157 218 return $this->dimensions; … … 169 230 } 170 231 171 $this->weight = $this->dictionary->get('weight'); 172 if (false === ($this->weight instanceof Weight)) { 173 $this->weight = new Weight(new Dictionary([])); 174 } 232 $weight = $this->dictionary->get('weight'); 233 if (false === ($weight instanceof Weight)) { 234 $weight = new Weight(new Dictionary([])); 235 } 236 $this->weight = $weight; 175 237 176 238 return $this->weight; -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ItemFactory.php
r3812630 r3816018 24 24 * @var DimensionsFactory 25 25 */ 26 private $dimensionsFactory;26 private DimensionsFactory $dimensionsFactory; 27 27 28 28 /** 29 29 * @var WeightFactory 30 30 */ 31 private $weightFactory;31 private WeightFactory $weightFactory; 32 32 33 33 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Parcel.php
r3812630 r3816018 25 25 * @var DictionaryInterface 26 26 */ 27 private $dictionary;27 private DictionaryInterface $dictionary; 28 28 29 29 /** 30 30 * @var array<Item> 31 31 */ 32 private $items;32 private ?array $items = null; 33 33 34 34 /** 35 35 * @var string 36 36 */ 37 private $freightClass;37 private ?string $freightClass = null; 38 38 39 39 /** 40 40 * @var Dimensions 41 41 */ 42 private $dimensions;42 private ?Dimensions $dimensions = null; 43 43 44 44 /** 45 45 * @var Weight 46 46 */ 47 private $weight;47 private ?Weight $weight = null; 48 48 49 49 /** … … 109 109 } 110 110 111 $this->dimensions = $this->dictionary->get('dimensions'); 112 if (false === ($this->dimensions instanceof Dimensions)) { 113 $this->dimensions = new Dimensions(new Dictionary([])); 114 } 111 $dimensions = $this->dictionary->get('dimensions'); 112 if (false === ($dimensions instanceof Dimensions)) { 113 $dimensions = new Dimensions(new Dictionary([])); 114 } 115 $this->dimensions = $dimensions; 115 116 116 117 return $this->dimensions; … … 128 129 } 129 130 130 $this->weight = $this->dictionary->get('weight'); 131 if (false === ($this->weight instanceof Weight)) { 132 $this->weight = new Weight(new Dictionary([])); 133 } 131 $weight = $this->dictionary->get('weight'); 132 if (false === ($weight instanceof Weight)) { 133 $weight = new Weight(new Dictionary([])); 134 } 135 $this->weight = $weight; 134 136 135 137 return $this->weight; -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelFactory.php
r3812630 r3816018 25 25 * @var TypesInterface 26 26 */ 27 private $types;27 private TypesInterface $types; 28 28 29 29 /** 30 30 * @var DimensionsFactory 31 31 */ 32 private $dimensionsFactory;32 private DimensionsFactory $dimensionsFactory; 33 33 34 34 /** 35 35 * @var WeightFactory 36 36 */ 37 private $weightFactory;37 private WeightFactory $weightFactory; 38 38 39 39 /** 40 40 * @var ItemFactory 41 41 */ 42 private $ItemFactory;42 private ItemFactory $ItemFactory; 43 43 44 44 /** … … 104 104 foreach ($items as $item) { 105 105 if ($this->isValidItemArray($item)) { 106 $newItems[] = $this->ItemFactory->create($dictionary->withArray($item) , $dictionary);106 $newItems[] = $this->ItemFactory->create($dictionary->withArray($item)); 107 107 } 108 108 } … … 119 119 private function isValidItemArray(array $item): bool 120 120 { 121 if (false === is_array($item)) {122 return false;123 }124 125 121 if (empty($item['name'])) { 126 122 return false; -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelsFactory.php
r3812630 r3816018 24 24 * @var ParcelFactory 25 25 */ 26 private $parcelFactory;26 private ParcelFactory $parcelFactory; 27 27 28 28 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Weight.php
r3812630 r3816018 22 22 { 23 23 /** 24 * @var Dictionary 24 * @var DictionaryInterface 25 25 */ 26 private $dictionary;26 private DictionaryInterface $dictionary; 27 27 28 28 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightArrayBuilder.php
r3812630 r3816018 26 26 * @var CollectionInterface 27 27 */ 28 private $weightUnits;28 private CollectionInterface $weightUnits; 29 29 30 30 /** 31 31 * @var WeightConverter 32 32 */ 33 private $weightConverter;33 private WeightConverter $weightConverter; 34 34 35 35 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightFactory.php
r3812630 r3816018 24 24 * @var WeightArrayBuilder 25 25 */ 26 private $weightArrayBuilder;26 private WeightArrayBuilder $weightArrayBuilder; 27 27 28 28 /** … … 40 40 * 41 41 * @param DictionaryInterface $dictionary 42 * @return Item42 * @return Weight 43 43 */ 44 44 public function create(DictionaryInterface $dictionary): Weight -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/PayloadFactory.php
r3812630 r3816018 26 26 { 27 27 /** 28 * @var Types 28 * @var TypesInterface 29 29 */ 30 protected $types;30 protected TypesInterface $types; 31 31 32 32 /** 33 33 * @var DictionaryFactory 34 34 */ 35 protected $dictionaryFactory;35 protected DictionaryFactory $dictionaryFactory; 36 36 37 37 /** 38 38 * @var ParcelsFactory 39 39 */ 40 protected $parcelsFactory;40 protected ParcelsFactory $parcelsFactory; 41 41 42 42 /** 43 43 * @var AddressFactory 44 44 */ 45 protected $addressFactory;45 protected AddressFactory $addressFactory; 46 46 47 47 /** 48 48 * @var ItemFactory 49 49 */ 50 protected $itemFactory;50 protected ItemFactory $itemFactory; 51 51 52 52 /** 53 53 * @var DimensionsFactory 54 54 */ 55 protected $dimensionsFactory;55 protected DimensionsFactory $dimensionsFactory; 56 56 57 57 /** 58 58 * @var WeightFactory 59 59 */ 60 protected $weightFactory;60 protected WeightFactory $weightFactory; 61 61 62 62 /** 63 63 * @var string 64 64 */ 65 protected $hash;65 protected string $hash; 66 66 67 67 /** 68 68 * @var Payload 69 69 */ 70 protected $instance;70 protected Payload $instance; 71 71 72 72 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Types.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $textDomain;25 26 /** 27 * @var Collection 28 */ 29 protected $carriers;30 31 /** 32 * @var Collection 33 */ 34 protected $contentTypes;35 36 /** 37 * @var Collection 38 */ 39 protected $currencies;40 41 /** 42 * @var Collection 43 */ 44 protected $services;45 46 /** 47 * @var Collection 48 */ 49 protected $packageTypes;50 51 /** 52 * @var Collection 53 */ 54 protected $orderStatuses;55 56 /** 57 * @var Collection 58 */ 59 protected $statuses;60 61 /** 62 * @var Collection 63 */ 64 protected $stores;65 66 /** 67 * @var Collection 68 */ 69 protected $warehouses;70 71 /** 72 * @var Collection 73 */ 74 protected $completedStatuses;75 76 /** 77 * @var Collection 78 */ 79 protected $dimensionUnits;80 81 /** 82 * @var Collection 83 */ 84 protected $weightUnits;85 86 /** 87 * @var Collection 88 */ 89 protected $labelFormats;90 91 /** 92 * @var Collection 93 */ 94 protected $signatureTypes;95 96 /** 97 * @var Collection 98 */ 99 protected $codMethods;24 protected string $textDomain; 25 26 /** 27 * @var CollectionInterface 28 */ 29 protected CollectionInterface $carriers; 30 31 /** 32 * @var CollectionInterface 33 */ 34 protected CollectionInterface $contentTypes; 35 36 /** 37 * @var CollectionInterface 38 */ 39 protected CollectionInterface $currencies; 40 41 /** 42 * @var CollectionInterface 43 */ 44 protected CollectionInterface $services; 45 46 /** 47 * @var CollectionInterface 48 */ 49 protected CollectionInterface $packageTypes; 50 51 /** 52 * @var CollectionInterface 53 */ 54 protected CollectionInterface $orderStatuses; 55 56 /** 57 * @var CollectionInterface 58 */ 59 protected CollectionInterface $statuses; 60 61 /** 62 * @var CollectionInterface 63 */ 64 protected CollectionInterface $stores; 65 66 /** 67 * @var CollectionInterface 68 */ 69 protected CollectionInterface $warehouses; 70 71 /** 72 * @var CollectionInterface 73 */ 74 protected CollectionInterface $completedStatuses; 75 76 /** 77 * @var CollectionInterface 78 */ 79 protected CollectionInterface $dimensionUnits; 80 81 /** 82 * @var CollectionInterface 83 */ 84 protected CollectionInterface $weightUnits; 85 86 /** 87 * @var CollectionInterface 88 */ 89 protected CollectionInterface $labelFormats; 90 91 /** 92 * @var CollectionInterface 93 */ 94 protected CollectionInterface $signatureTypes; 95 96 /** 97 * @var CollectionInterface 98 */ 99 protected CollectionInterface $codMethods; 100 100 101 101 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/BuyShipment.php
r3812630 r3816018 33 33 * @var ShipmentPayload 34 34 */ 35 private $shipmentPayload;36 37 /** 38 * @var array 39 */ 40 private $trackingUrls;35 private ShipmentPayload $shipmentPayload; 36 37 /** 38 * @var array<string, string> 39 */ 40 private array $trackingUrls; 41 41 42 42 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/CreateOrder.php
r3812630 r3816018 32 32 * @var OrderPayload 33 33 */ 34 private $orderPayload;34 private OrderPayload $orderPayload; 35 35 36 36 /** 37 37 * @var BuyShipment 38 38 */ 39 private $buyShipmentEndPoint;39 private BuyShipment $buyShipmentEndPoint; 40 40 41 41 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetOrder.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** 35 35 * @var CreateOrder 36 36 */ 37 private $createOrderEndPoint;37 private CreateOrder $createOrderEndPoint; 38 38 39 39 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetRates.php
r3812630 r3816018 32 32 * @var ShipmentPayload 33 33 */ 34 private $shipmentPayload;34 private ShipmentPayload $shipmentPayload; 35 35 36 36 /** 37 37 * @var RateFilter 38 38 */ 39 private $rateFilter;39 private RateFilter $rateFilter; 40 40 41 41 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetShipment.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** 35 35 * @var BuyShipment 36 36 */ 37 private $buyShipmentEndPoint;37 private BuyShipment $buyShipmentEndPoint; 38 38 39 39 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetShipments.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** 35 35 * @var BuyShipment 36 36 */ 37 private $buyShipmentEndPoint;37 private BuyShipment $buyShipmentEndPoint; 38 38 39 39 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/RateFilter/RateFilter.php
r3812630 r3816018 26 26 * @var LoggerInterface 27 27 */ 28 private $logger;28 private LoggerInterface $logger; 29 29 30 30 /** 31 31 * @var ServiceIdBuilder 32 32 */ 33 private $serviceIdBuilder;33 private ServiceIdBuilder $serviceIdBuilder; 34 34 35 35 /** 36 36 * @var CollectionInterface 37 37 */ 38 private $packageTypes;38 private CollectionInterface $packageTypes; 39 39 40 40 /** 41 41 * @var array<string,bool> 42 42 */ 43 private $carrierHasPackageTypeInServiceName;43 private array $carrierHasPackageTypeInServiceName; 44 44 45 45 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/RefundShipment.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/ApiKey.php
r3812630 r3816018 24 24 * @var Payload 25 25 */ 26 private $payload;26 private Payload $payload; 27 27 28 28 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/Builder/AddressBuilder.php
r3812630 r3816018 25 25 * @var EmptyToNull 26 26 */ 27 private $emptyToNull;27 private EmptyToNull $emptyToNull; 28 28 29 29 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedOrderOptionsBuilder.php
r3812630 r3816018 25 25 * @var EmptyToNull 26 26 */ 27 private $emptyToNull;27 private EmptyToNull $emptyToNull; 28 28 29 29 /** 30 30 * @var AdvancedShipmentOptionsBuilder 31 31 */ 32 private $advancedShipmentOptionsBuilder;32 private AdvancedShipmentOptionsBuilder $advancedShipmentOptionsBuilder; 33 33 34 34 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedShipmentOptionsBuilder.php
r3812630 r3816018 25 25 * @var EmptyToNull 26 26 */ 27 private $emptyToNull;27 private EmptyToNull $emptyToNull; 28 28 29 29 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/OrderPayload.php
r3812630 r3816018 31 31 * @var TypeOrderPayload 32 32 */ 33 private $orderPayload;33 private TypeOrderPayload $orderPayload; 34 34 35 35 /** 36 36 * @var AddressBuilder 37 37 */ 38 private $addressBuilder;38 private AddressBuilder $addressBuilder; 39 39 40 40 /** 41 41 * @var DimensionsBuilder 42 42 */ 43 private $dimensionsBuilder;43 private DimensionsBuilder $dimensionsBuilder; 44 44 45 45 /** 46 46 * @var WeightBuilder 47 47 */ 48 private $weightBuilder;48 private WeightBuilder $weightBuilder; 49 49 50 50 /** 51 51 * @var AdvancedOrderOptionsBuilder 52 52 */ 53 private $advancedOptionsBuilder;53 private AdvancedOrderOptionsBuilder $advancedOptionsBuilder; 54 54 55 55 /** 56 56 * @var EmptyToNull 57 57 */ 58 private $emptyToNull;58 private EmptyToNull $emptyToNull; 59 59 60 60 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/ShipmentPayload.php
r3812630 r3816018 37 37 * @var Payload 38 38 */ 39 protected $payload;39 protected Payload $payload; 40 40 41 41 /** 42 42 * @var AddressBuilder 43 43 */ 44 private $addressBuilder;44 private AddressBuilder $addressBuilder; 45 45 46 46 /** 47 47 * @var DimensionsBuilder 48 48 */ 49 private $dimensionsBuilder;49 private DimensionsBuilder $dimensionsBuilder; 50 50 51 51 /** 52 52 * @var WeightBuilder 53 53 */ 54 private $weightBuilder;54 private WeightBuilder $weightBuilder; 55 55 56 56 /** 57 57 * @var AdvancedShipmentOptionsBuilder 58 58 */ 59 private $advancedOptionsBuilder;59 private AdvancedShipmentOptionsBuilder $advancedOptionsBuilder; 60 60 61 61 /** 62 62 * @var EmptyToNull 63 63 */ 64 private $emptyToNull;64 private EmptyToNull $emptyToNull; 65 65 66 66 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/BuyShipment.php
r3812630 r3816018 32 32 * @var ShipmentPayload 33 33 */ 34 private $shipmentPayload;34 private ShipmentPayload $shipmentPayload; 35 35 36 36 /** 37 37 * @var ShipmentDataBuilder 38 38 */ 39 private $shipmentDataBuilder;39 private ShipmentDataBuilder $shipmentDataBuilder; 40 40 41 41 /** 42 42 * @var BuyShipmentResponseToShipmentTransformer 43 43 */ 44 private $buyShipmentResponseToShipmentTransformer;44 private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer; 45 45 46 46 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/CreateManifest.php
r3812630 r3816018 31 31 * @var ManifestResponseToManifestTransformer 32 32 */ 33 private $manifestTransformer;33 private ManifestResponseToManifestTransformer $manifestTransformer; 34 34 35 35 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/Executor/GetShipmentsExecutor.php
r3812630 r3816018 21 21 use OneTeamSoftware\Packages\GuzzleHttp\Promise\Utils; 22 22 use OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\Executor\Executor; 23 use Throwable; 23 24 24 25 /** … … 109 110 if ($result['state'] !== PromiseInterface::FULFILLED) { 110 111 $reason = $result['reason'] ?? null; 111 $message = $reason instanceof \Throwable ? $reason->getMessage() : (string) $reason;112 $message = $reason instanceof Throwable ? $reason->getMessage() : (string) $reason; 112 113 $this->logger->error(__FILE__, __LINE__, 'Failed to fetch shipment for index %d: %s', $index, $message); 113 114 continue; -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetManifest.php
r3812630 r3816018 30 30 * @var ManifestResponseToManifestTransformer 31 31 */ 32 private $manifestTransformer;32 private ManifestResponseToManifestTransformer $manifestTransformer; 33 33 34 34 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetRates.php
r3812630 r3816018 33 33 * @var ShipmentPayload 34 34 */ 35 private $shipmentPayload;35 private ShipmentPayload $shipmentPayload; 36 36 37 37 /** 38 38 * @var ServiceIdBuilder 39 39 */ 40 private $serviceIdBuilder;40 private ServiceIdBuilder $serviceIdBuilder; 41 41 42 42 /** 43 43 * @var ShipmentDataBuilder 44 44 */ 45 private $shipmentDataBuilder;45 private ShipmentDataBuilder $shipmentDataBuilder; 46 46 47 47 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipment.php
r3812630 r3816018 31 31 * @var ShipmentPayload 32 32 */ 33 private $shipmentPayload;33 private ShipmentPayload $shipmentPayload; 34 34 35 35 /** 36 36 * @var BuyShipmentResponseToShipmentTransformer 37 37 */ 38 private $buyShipmentResponseToShipmentTransformer;38 private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer; 39 39 40 40 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipmentByShipmentId.php
r3812630 r3816018 37 37 * @var string 38 38 */ 39 private $shipmentId;39 private string $shipmentId; 40 40 41 41 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipments.php
r3812630 r3816018 31 31 * @var ShipmentPayload 32 32 */ 33 private $shipmentPayload;33 private ShipmentPayload $shipmentPayload; 34 34 35 35 /** 36 36 * @var BuyShipmentResponseToShipmentTransformer 37 37 */ 38 private $buyShipmentResponseToShipmentTransformer;38 private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer; 39 39 40 40 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetTracking.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/RefundShipment.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/BuyShipmentResponseToShipmentTransformer.php
r3812630 r3816018 17 17 * @var LoggerInterface 18 18 */ 19 private $logger;19 private LoggerInterface $logger; 20 20 21 21 /** 22 22 * @var TypesInterface 23 23 */ 24 private $types;24 private TypesInterface $types; 25 25 26 26 /** 27 27 * @var ShipmentPayload 28 28 */ 29 private $shipmentPayload;30 31 /** 32 * @var array 33 */ 34 private $trackingUrls;29 private ShipmentPayload $shipmentPayload; 30 31 /** 32 * @var array<string, string> 33 */ 34 private array $trackingUrls; 35 35 36 36 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/ManifestResponseToManifestTransformer.php
r3812630 r3816018 12 12 * @var LoggerInterface 13 13 */ 14 private $logger;14 private LoggerInterface $logger; 15 15 16 16 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/ApiKey.php
r3812630 r3816018 24 24 * @var Payload 25 25 */ 26 private $payload;26 private Payload $payload; 27 27 28 28 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/Builder/AddressBuilder.php
r3812630 r3816018 25 25 * @var EmptyToNull 26 26 */ 27 private $emptyToNull;27 private EmptyToNull $emptyToNull; 28 28 29 29 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/Builder/AdvancedShipmentOptionsBuilder.php
r3812630 r3816018 29 29 * @var EmptyToNull 30 30 */ 31 private $emptyToNull;31 private EmptyToNull $emptyToNull; 32 32 33 33 /** 34 34 * @var WeightBuilder 35 35 */ 36 private $weightBuilder;36 private WeightBuilder $weightBuilder; 37 37 38 38 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/Builder/ShipmentDataBuilder.php
r3812630 r3816018 13 13 * @var ShipmentPayload 14 14 */ 15 private $shipmentPayload;15 private ShipmentPayload $shipmentPayload; 16 16 17 17 /** 18 18 * @var Payload 19 19 */ 20 private $payload;20 private Payload $payload; 21 21 22 22 /** -
wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/ShipmentPayload.php
r3812630 r3816018 49 49 * @var Payload 50 50 */ 51 protected $payload;51 protected Payload $payload; 52 52 53 53 /** 54 54 * @var TypesInterface 55 55 */ 56 protected $types;56 protected TypesInterface $types; 57 57 58 58 /** 59 59 * @var AddressBuilder 60 60 */ 61 private $addressBuilder;61 private AddressBuilder $addressBuilder; 62 62 63 63 /** 64 64 * @var DimensionsBuilder 65 65 */ 66 private $dimensionsBuilder;66 private DimensionsBuilder $dimensionsBuilder; 67 67 68 68 /** 69 69 * @var WeightBuilder 70 70 */ 71 private $weightBuilder;71 private WeightBuilder $weightBuilder; 72 72 73 73 /** 74 74 * @var AdvancedShipmentOptionsBuilder 75 75 */ 76 private $advancedOptionsBuilder;76 private AdvancedShipmentOptionsBuilder $advancedOptionsBuilder; 77 77 78 78 /** 79 79 * @var EmptyToNull 80 80 */ 81 private $emptyToNull;81 private EmptyToNull $emptyToNull; 82 82 83 83 /** … … 442 442 ] 443 443 ]; 444 $packages[] = array_filter($packageData, function($value) { return !is_null($value); }); 444 $packages[] = array_filter($packageData, function ($value) { 445 return !is_null($value); 446 }); 445 447 } 446 448 return $packages; … … 495 497 $packageCodes[] = $parcel->getType(); 496 498 } 497 return array_values(array_unique(array_filter($packageCodes, static fn($value) => $value !== null && $value !== ''))); // Return unique, non-empty codes 499 // Return unique, non-empty codes 500 return array_values(array_unique(array_filter( 501 $packageCodes, 502 static fn($value) => $value !== null && $value !== '' 503 ))); 498 504 } 499 505 -
wc-shipstation-shipping/tags/1.4.22/includes/UnitConverter/DimensionConverter.php
r3812630 r3816018 22 22 * constructor 23 23 * 24 * @param string $defaultFromUnit24 * @param string|null $defaultFromUnit 25 25 */ 26 public function __construct( string $defaultFromUnit = null)26 public function __construct(?string $defaultFromUnit = null) 27 27 { 28 28 parent::__construct( -
wc-shipstation-shipping/tags/1.4.22/includes/UnitConverter/UnitConverter.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $defaultFromUnit;24 protected string $defaultFromUnit; 25 25 26 26 /** 27 * @var array 27 * @var array<mixed> 28 28 */ 29 protected $fromMultipliers;29 protected array $fromMultipliers; 30 30 31 31 /** 32 * @var array 32 * @var array<mixed> 33 33 */ 34 protected $toMultipliers;34 protected array $toMultipliers; 35 35 36 36 /** … … 39 39 * @param array $fromMultipliers 40 40 * @param array $toMultipliers 41 * @param string $defaultFromUnit41 * @param string|null $defaultFromUnit 42 42 */ 43 public function __construct(array $fromMultipliers, array $toMultipliers, string $defaultFromUnit = null)43 public function __construct(array $fromMultipliers, array $toMultipliers, ?string $defaultFromUnit = null) 44 44 { 45 45 $this->fromMultipliers = $fromMultipliers; … … 51 51 * converts a given value to a requested unit from a given unit 52 52 * 53 * The converted value is truncated (never rounded up) to two decimal places, 54 * see self::truncate() for the details. 55 * 53 56 * @param float $value 54 57 * @param string $toUnit 55 * @param string $fromUnit58 * @param string|null $fromUnit 56 59 * @return float 57 60 */ 58 public function convert(float $value, string $toUnit, string $fromUnit = null): float61 public function convert(float $value, string $toUnit, ?string $fromUnit = null): float 59 62 { 60 63 $toUnit = strtolower($toUnit); … … 73 76 } 74 77 75 return $value; 78 return $this->truncate($value); 79 } 80 81 /** 82 * truncates the given value to two decimal places without ever rounding it up 83 * 84 * Carriers enforce weight and dimension ceilings in the converted unit. A value 85 * that is rounded up can end up above the true value and the carrier then refuses 86 * to sell the service. For example 2 kg is 70.548 oz, which rounds to 70.55 oz and 87 * converts back to 2.000057 kg - over a 2 kg ceiling - and the carrier responds 88 * with HTTP 422 SHIPMENT.POSTAGE.FAILURE. 89 * 90 * A converted value is therefore never allowed to exceed the true value: it is 91 * truncated towards zero instead, which keeps it at or below the true value. 92 * 93 * Negative values are truncated towards zero as well, so that the magnitude of the 94 * result never exceeds the magnitude of the true value either. The sign is always 95 * preserved and a negative value is never silently turned into zero. 96 * 97 * @param float $value 98 * @return float 99 */ 100 protected function truncate(float $value): float 101 { 102 $truncated = floor(abs($value) * 100) / 100; 103 104 return $value < 0 ? -$truncated : $truncated; 76 105 } 77 106 } -
wc-shipstation-shipping/tags/1.4.22/includes/UnitConverter/UnitConverterInterface.php
r3812630 r3816018 24 24 * @param float $value 25 25 * @param string $toUnit 26 * @param string $fromUnit26 * @param string|null $fromUnit 27 27 * @return float 28 28 */ 29 public function convert(float $value, string $toUnit, string $fromUnit = null): float;29 public function convert(float $value, string $toUnit, ?string $fromUnit = null): float; 30 30 } -
wc-shipstation-shipping/tags/1.4.22/includes/UnitConverter/WeightConverter.php
r3812630 r3816018 22 22 * constructor 23 23 * 24 * @param string $defaultFromUnit24 * @param string|null $defaultFromUnit 25 25 */ 26 public function __construct( string $defaultFromUnit = null)26 public function __construct(?string $defaultFromUnit = null) 27 27 { 28 28 parent::__construct( … … 30 30 [ 31 31 'g' => 0.001, 32 'lbs' => 0.453592 ,33 'oz' => 0.0283495 ,32 'lbs' => 0.45359237, 33 'oz' => 0.028349523125, 34 34 ], 35 35 // from kg 36 36 [ 37 37 'g' => 1000, 38 'lbs' => 2.20462 ,39 'oz' => 35.27 4,38 'lbs' => 2.2046226218, 39 'oz' => 35.27396195, 40 40 ], 41 41 $defaultFromUnit -
wc-shipstation-shipping/tags/1.4.22/includes/WP/Admin/Notices/Notices.php
r3812630 r3816018 19 19 class Notices 20 20 { 21 /** 22 * Library version. Consumers can detect a stale copy loaded by another 23 * plugin (the shared OneTeamSoftware\WP\Admin\Notices\Notices class is 24 * bundled independently per plugin and first-loaded wins) via 25 * defined(Notices::class . '::VERSION') plus version_compare before 26 * calling methods added in newer releases (e.g. enqueueAssets, added 27 * in 1.0.17). Pair with method_exists() guards at call sites. 28 */ 29 public const VERSION = '1.1.0'; 30 31 /** 32 * Handle the dismiss script is attached to; it has no file of its own. 33 */ 34 private const DISMISS_SCRIPT_HANDLE = 'oneteamsoftware-admin-notices-dismiss'; 35 36 /** 37 * Dismisses a notice through its own AJAX action and hides it. 38 * 39 * Delegated, so it covers every dismissible notice on the page, including 40 * one inserted later. The window flag keeps it bound once when several 41 * plugins (each bundling this class) print it. 42 */ 43 private const DISMISS_SCRIPT = 'if (!window.oneTeamSoftwareNoticeDismissBound) { 44 window.oneTeamSoftwareNoticeDismissBound = true; 45 jQuery(document).on("click", ".oneteamsoftware.notice .notice-dismiss[data-dismiss-action]", function() { 46 var dismissButton = jQuery(this); 47 jQuery.post(ajaxurl, {action: dismissButton.attr("data-dismiss-action"), nonce: dismissButton.attr("data-nonce")}).done(function() { 48 dismissButton.closest(".oneteamsoftware.notice").slideUp(); 49 }); 50 }); 51 }'; 52 21 53 /** 22 54 * @var bool … … 113 145 114 146 /** 115 * Enqueue notice assets (visual styling CSS + dismiss JS).116 *117 * @param string $pluginFile The main plugin file path (used for URL generation)118 * @param string $version Version string for cache busting119 * @param string $handlePrefix Optional prefix for asset handles120 * @return void121 */122 public static function enqueueAssets(string $pluginFile, string $version = '1.0.0', string $handlePrefix = 'oneteamsoftware'): void123 {124 if (self::$assetsEnqueued) {125 return;126 }127 128 // $pluginFile must be the consumer's main file path — __DIR__ here breaks inside phars.129 // Consumer plugins are expected to register oneteamsoftware/php-wp-asset-fallback,130 // which swaps .min ↔ unminified based on SCRIPT_DEBUG/WP_DEBUG.131 132 wp_register_style(133 $handlePrefix . '-notices',134 plugins_url('assets/css/Notices.min.css', $pluginFile),135 [],136 $version137 );138 wp_enqueue_style($handlePrefix . '-notices');139 140 wp_register_script(141 $handlePrefix . '-notice-dismisser',142 plugins_url('assets/js/NoticeDismisser.min.js', $pluginFile),143 ['jquery'],144 $version145 );146 wp_enqueue_script($handlePrefix . '-notice-dismisser');147 148 self::$assetsEnqueued = true;149 }150 151 /**152 147 * returns requested property 153 148 * … … 185 180 186 181 /** 182 * Enqueue notice assets (visual styling CSS + dismiss JS). 183 * 184 * @param string $pluginFile The main plugin file path (used for URL generation) 185 * @param string $version Version string for cache busting 186 * @param string $handlePrefix Optional prefix for asset handles 187 * @return void 188 */ 189 public static function enqueueAssets(string $pluginFile, string $version = '1.0.0', string $handlePrefix = 'oneteamsoftware'): void 190 { 191 if (self::$assetsEnqueued) { 192 return; 193 } 194 195 // $pluginFile must be the consumer's main file path — __DIR__ here breaks inside phars. 196 // Consumer plugins are expected to register oneteamsoftware/php-wp-asset-fallback, 197 // which swaps .min ↔ unminified based on SCRIPT_DEBUG/WP_DEBUG. 198 199 wp_register_style( 200 $handlePrefix . '-notices', 201 plugins_url('assets/css/Notices.min.css', $pluginFile), 202 [], 203 $version 204 ); 205 wp_enqueue_style($handlePrefix . '-notices'); 206 207 wp_register_script( 208 $handlePrefix . '-notice-dismisser', 209 plugins_url('assets/js/NoticeDismisser.min.js', $pluginFile), 210 ['jquery'], 211 $version, 212 true 213 ); 214 wp_enqueue_script($handlePrefix . '-notice-dismisser'); 215 216 self::$assetsEnqueued = true; 217 } 218 219 /** 187 220 * dismisses notice 188 221 * … … 191 224 public function dismiss(): void 192 225 { 193 if (wp_verify_nonce(sanitize_key($_REQUEST['nonce']), $this->dismissAction)) { 226 // Records the current user's own dismissal only (user meta), so any 227 // logged-in role may do it. 228 if (current_user_can('read') && wp_verify_nonce(sanitize_key(wp_unslash($_REQUEST['nonce'] ?? '')), $this->dismissAction)) { 194 229 $this->load(); 195 230 $this->dismissed = true; … … 219 254 220 255 /** 256 * replaces all notices with the given list (replaceNotices) 257 * 258 * Unlike add(), this is the CONDITION-notice lifecycle: a stateless caller 259 * recomputes the notice list on every request and replaces it wholesale, 260 * so a resolved condition simply stops supplying content and the notice 261 * disappears on the next display() without any explicit removal. Loads 262 * first, so a same-request replace is never clobbered by the transient 263 * state. 264 * 265 * @param array<int, string> $notices The notices to display, in order. 266 * @return void 267 */ 268 public function replaceNotices(array $notices): void 269 { 270 $this->load(); 271 272 $this->notices = $notices; 273 } 274 275 /** 221 276 * displays notice 222 277 * … … 268 323 269 324 if (false === empty($this->notices) || $this->displayWithoutNotices) { 270 set_transient($cacheKey, get_object_vars($this)); 271 272 // extra effort to save dismissed to work around cache 325 // The transient is shared by every user; dismissal is per user and 326 // lives only in user meta. Storing it here let any logged-in role 327 // (the dismiss nonce is printed wherever the notice shows) hide a 328 // notice from every administrator. 329 $sharedProperties = get_object_vars($this); 330 unset($sharedProperties['dismissed']); 331 set_transient($cacheKey, $sharedProperties); 332 273 333 if ($this->dismissed) { 274 334 update_user_meta(get_current_user_id(), $cacheKey . '_dismissed', true); … … 304 364 $properties = get_transient($cacheKey, null); 305 365 if (is_array($properties)) { 366 // Transients written before dismissal became per-user still carry 367 // a shared flag; ignore it. 368 unset($properties['dismissed']); 306 369 $this->setProperties($properties); 307 370 } … … 364 427 365 428 if ($this->permanent && $this->dismissible) { 366 echo '<button class="notice-dismiss" onclick="jQuery.post(ajaxurl, {action: \'' . esc_attr($this->dismissAction) . '\', nonce: \'' . esc_attr($nonce) . '\'}).done(function() { jQuery(\'#' . esc_attr($noticeBoxId) . '\').slideUp(); });">'; // phpcs:ignore429 echo '<button class="notice-dismiss" data-dismiss-action="' . esc_attr($this->dismissAction) . '" data-nonce="' . esc_attr($nonce) . '">'; 367 430 echo '<span class="screen-reader-text">'; 368 e cho_e('Dismiss', $this->id);431 esc_html_e('Dismiss', $this->id); 369 432 echo '</span>'; 370 433 echo '</button>'; 434 435 $this->addDismissScript(); 371 436 } 372 437 … … 385 450 echo '</div>'; 386 451 } 452 453 /** 454 * Adds the script that makes the dismiss button work 455 * 456 * On a normal page load it is queued for the footer. Notices rendered into 457 * an admin-ajax response never reach a footer, so there the script is 458 * printed right away, inside the fragment; jQuery runs it on insertion. 459 * It depends on nothing there, because the requesting page already has 460 * jQuery and printing a dependency would load it a second time. 461 * 462 * @return void 463 */ 464 private function addDismissScript(): void 465 { 466 if (wp_script_is(self::DISMISS_SCRIPT_HANDLE, 'enqueued')) { 467 return; 468 } 469 470 $isAjaxFragment = wp_doing_ajax(); 471 472 wp_register_script(self::DISMISS_SCRIPT_HANDLE, false, $isAjaxFragment ? [] : ['jquery'], self::VERSION, true); 473 wp_enqueue_script(self::DISMISS_SCRIPT_HANDLE); 474 wp_add_inline_script(self::DISMISS_SCRIPT_HANDLE, self::DISMISS_SCRIPT); 475 476 if ($isAjaxFragment) { 477 wp_print_scripts(self::DISMISS_SCRIPT_HANDLE); 478 } 479 } 387 480 } -
wc-shipstation-shipping/tags/1.4.22/packages/guzzle/src/Handler/CurlFactory.php
r3812630 r3816018 179 179 } 180 180 self::assertFinalProxyOptionTypes($conf, $requiredMultiplex && 'https' !== $request->getUri()->getScheme()); 181 self::assertFinalProxiesSupported($request, $conf); 181 182 self::isolatePreProxyOnAffectedCurl($conf); 182 183 self::normalizeStringableProxyCredentialOptions($conf); … … 890 891 try { 891 892 $proxyUri = new Uri($proxyForParsing); 892 $redactedUserInfo = Psr7\Utils::redactUserInfo($proxyUri)->getUserInfo(); 893 if ($redactedUserInfo === $proxyUri->getUserInfo()) { 894 return $error; 893 // psr7 finds no userinfo behind a scheme with a plus sign. 894 if ($proxyUri->getUserInfo() !== '') { 895 $redactedUserInfo = Psr7\Utils::redactUserInfo($proxyUri)->getUserInfo(); 896 if ($redactedUserInfo === $proxyUri->getUserInfo()) { 897 return $error; 898 } 895 899 } 896 900 } catch (\InvalidArgumentException $e) { … … 950 954 } 951 955 throw new \InvalidArgumentException($name . ' must be a string.'); 956 } 957 } 958 } 959 /** 960 * @param array<int|string, mixed> $conf 961 */ 962 private static function assertFinalProxiesSupported(RequestInterface $request, array $conf): void 963 { 964 $proxies = [$conf[\CURLOPT_PROXY] ?? null]; 965 if (\defined('CURLOPT_PRE_PROXY')) { 966 $proxies[] = $conf[(int) \constant('CURLOPT_PRE_PROXY')] ?? null; 967 } 968 foreach ($proxies as $proxy) { 969 if (!\is_string($proxy) || $proxy === '') { 970 continue; 971 } 972 // libcurl 7.76.0-8.17.0 skips a proxy with undecodable credentials. 973 if (\preg_match('/%[01][0-9A-Fa-f]/', \substr($proxy, 0, (int) \strrpos($proxy, '@'))) !== 0) { 974 throw new RequestException('Proxy credentials must not contain percent-encoded control characters.', $request); 975 } 976 $remainder = \explode('://', $proxy, 2)[1] ?? $proxy; 977 $host = \explode('@', $remainder, 2)[1] ?? $remainder; 978 // libcurl before 7.65.0 uses the host after the first '@', or no proxy. 979 if ($host === '' || $host === '/' || $host === '[' || \strpos($host, ':') === 0 || \strpos($host, '[]') === 0 || \strpos($host, '@') !== \false) { 980 throw new RequestException('The proxy URL is malformed.', $request); 981 } 982 // libcurl 7.47.0-7.51.0 skips a proxy with a host of '.'. 983 if (\preg_match('#^\[?\.(?:[:/\]]|$)#D', $host) !== 0) { 984 throw new RequestException('The proxy URL is malformed.', $request); 985 } 986 // libcurl before 7.31.0 skips a proxy with an empty username. 987 if (\strpos($remainder, ':') === 0 && !CurlVersion::supportsProxyEmptyUsername()) { 988 throw new RequestException('Proxy URLs with an empty username are not supported by the installed libcurl; libcurl 7.31.0 or newer is required.', $request); 952 989 } 953 990 } -
wc-shipstation-shipping/tags/1.4.22/packages/guzzle/src/Handler/CurlVersion.php
r3812630 r3816018 38 38 // plaintext HTTP proxy, and 7.50.2 through 7.51 reject it at connect time. 39 39 private const HTTPS_PROXY_VERSION = '7.52.0'; 40 // curl 7.31.0 started to strip proxy userinfo that has an empty username; 41 // older libcurl leaves it in place, finds no host, and skips the proxy. 42 private const PROXY_EMPTY_USERNAME_VERSION = '7.31.0'; 40 43 private const HANDLER_SHARING_VERSION = '7.35.0'; 41 44 private const SSL_SESSION_SHARING_VERSION = '8.6.0'; … … 122 125 return $versionInfo !== null && \version_compare($versionInfo['version'], self::HTTPS_PROXY_VERSION, '>=') && 0 !== ($httpsProxyFeature & $versionInfo['features']); 123 126 } 127 public static function supportsProxyEmptyUsername(): bool 128 { 129 $version = self::getVersion(); 130 return $version !== null && \version_compare($version, self::PROXY_EMPTY_USERNAME_VERSION, '>='); 131 } 124 132 public static function supportsNtlm(): bool 125 133 { -
wc-shipstation-shipping/tags/1.4.22/packages/guzzle/src/Utils.php
r3812630 r3816018 732 732 if ($uri->getHost() !== $asciiHost) { 733 733 // Replace URI only if the ASCII version is different 734 $uri = $uri->withHost($asciiHost); 734 try { 735 $uri = $uri->withHost($asciiHost); 736 } catch (\InvalidArgumentException $e) { 737 // The conversion can map a character to a URI delimiter. 738 throw new InvalidArgumentException('IDN conversion failed', 0, $e); 739 } 735 740 } 736 741 } … … 756 761 { 757 762 if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) { 758 return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info); 763 // ICU can take quadratic time, and no valid name needs more bytes. 764 if (\strlen($domain) > 4096) { 765 return \false; 766 } 767 try { 768 return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info); 769 } catch (\IntlException $e) { 770 // With intl.use_exceptions, a label too long to encode throws. 771 return \false; 772 } 759 773 } 760 774 throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old'); -
wc-shipstation-shipping/tags/1.4.22/packages/promises/src/Create.php
r3812630 r3816018 21 21 $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null; 22 22 $promise = new Promise($wfn, $cfn); 23 $value->then([$promise, 'resolve'], [$promise, 'reject']); 23 try { 24 $value->then([$promise, 'resolve'], [$promise, 'reject']); 25 } catch (\Throwable $e) { 26 if (State::isPending($promise)) { 27 // The thenable may still hold the callbacks. 28 $promise = new Promise(); 29 $promise->reject($e); 30 } 31 } 24 32 return $promise; 25 33 } -
wc-shipstation-shipping/tags/1.4.22/packages/promises/src/FulfilledPromise.php
r3812630 r3816018 35 35 $value = $this->value; 36 36 $queue->add(static function () use ($p, $value, $onFulfilled): void { 37 if (State::isPending($p)){38 try{37 try { 38 if (State::isPending($p)) { 39 39 $p->resolve($onFulfilled($value)); 40 } catch (\Throwable $e) { 40 } 41 } catch (\Throwable $e) { 42 if (State::isPending($p)) { 41 43 $p->reject($e); 42 44 } -
wc-shipstation-shipping/tags/1.4.22/packages/promises/src/Promise.php
r3812630 r3816018 18 18 private $waitFn; 19 19 private $waitList; 20 private $handlersBefore = []; 20 21 private $handlers = []; 21 22 /** … … 114 115 $this->result = $value; 115 116 $handlers = $this->handlers; 116 $this->handlers = null; 117 $before = $this->handlersBefore; 118 $this->handlers = $this->handlersBefore = null; 117 119 $this->waitList = $this->waitFn = null; 118 120 $this->cancelFn = null; 119 121 if (!$handlers) { 120 122 return; 123 } 124 if ($value instanceof Promise && State::isPending($value)) { 125 // We can just hand our handlers to the next promise. Merging would 126 // copy both lists every time, so only the shorter one is moved. 127 if ($value->handlers === []) { 128 $value->handlers = $handlers; 129 $value->handlersBefore = $before; 130 } elseif (count($value->handlers) + count($value->handlersBefore) < count($handlers) + count($before)) { 131 array_push($before, ...array_reverse($value->handlers), ...$value->handlersBefore); 132 $value->handlers = $handlers; 133 $value->handlersBefore = $before; 134 } else { 135 array_push($value->handlers, ...array_reverse($before), ...$handlers); 136 } 137 return; 138 } 139 if ($before) { 140 $handlers = array_merge(array_reverse($before), $handlers); 121 141 } 122 142 // If the value was not a settled promise or a thenable, then resolve … … 130 150 } 131 151 }); 132 } elseif ($value instanceof Promise && State::isPending($value)) {133 // We can just merge our handlers onto the next promise.134 $value->handlers = array_merge($value->handlers, $handlers);135 152 } else { 136 153 // Resolve the handlers when the forwarded promise is resolved. 137 $value->then(static function ($value) use ($handlers): void { 138 foreach ($handlers as $handler) { 139 self::callHandler(1, $value, $handler); 140 } 141 }, static function ($reason) use ($handlers): void { 142 foreach ($handlers as $handler) { 143 self::callHandler(2, $reason, $handler); 144 } 145 }); 154 try { 155 $value->then(static function ($value) use (&$handlers): void { 156 foreach ($handlers as $handler) { 157 self::callHandler(1, $value, $handler); 158 } 159 }, static function ($reason) use (&$handlers): void { 160 foreach ($handlers as $handler) { 161 self::callHandler(2, $reason, $handler); 162 } 163 }); 164 } catch (\Throwable $e) { 165 Utils::queue()->add(static function () use ($e, $handlers): void { 166 foreach ($handlers as $handler) { 167 self::callHandler(2, $e, $handler); 168 } 169 }); 170 // The thenable may still hold the callbacks. 171 $handlers = []; 172 } 146 173 } 147 174 } … … 181 208 } 182 209 } catch (\Throwable $reason) { 183 $promise->reject($reason); 210 // The handler may have settled the promise itself. 211 if (State::isPending($promise)) { 212 $promise->reject($reason); 213 } 184 214 } 185 215 } -
wc-shipstation-shipping/tags/1.4.22/packages/promises/src/RejectedPromise.php
r3812630 r3816018 35 35 $p = new Promise([$queue, 'run']); 36 36 $queue->add(static function () use ($p, $reason, $onRejected): void { 37 if (State::isPending($p)){38 try{37 try { 38 if (State::isPending($p)) { 39 39 // Return a resolved promise if onRejected does not throw. 40 40 $p->resolve($onRejected($reason)); 41 } catch (\Throwable $e) { 42 // onRejected threw, so return a rejected promise. 41 } 42 } catch (\Throwable $e) { 43 // onRejected threw, so return a rejected promise. 44 if (State::isPending($p)) { 43 45 $p->reject($e); 44 46 } -
wc-shipstation-shipping/tags/1.4.22/packages/promises/src/Utils.php
r3812630 r3816018 47 47 } 48 48 } catch (\Throwable $e) { 49 $promise->reject($e); 49 if (State::isPending($promise)) { 50 $promise->reject($e); 51 } 50 52 } 51 53 }); -
wc-shipstation-shipping/tags/1.4.22/packages/psr7/src/AppendStream.php
r3812630 r3816018 137 137 } elseif ($whence !== \SEEK_SET) { 138 138 throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); 139 } elseif ($offset < 0) { 140 throw new \RuntimeException('The AppendStream cannot seek to a negative offset'); 139 141 } 140 142 $this->pos = $this->current = 0; -
wc-shipstation-shipping/tags/1.4.22/packages/psr7/src/InflateStream.php
r3812630 r3816018 21 21 /** @var StreamInterface */ 22 22 private $stream; 23 /** @var StreamInterface|null */ 24 private $source; 23 25 public function __construct(StreamInterface $stream) 26 { 27 $this->source = $stream; 28 $inflated = self::inflate($stream); 29 $this->stream = $stream->isSeekable() ? $inflated : new NoSeekStream($inflated); 30 } 31 public function close(): void 32 { 33 $this->source = null; 34 $this->stream->close(); 35 } 36 public function detach() 37 { 38 $this->source = null; 39 return $this->stream->detach(); 40 } 41 public function seek($offset, $whence = \SEEK_SET): void 42 { 43 if (!\is_int($offset)) { 44 \trigger_deprecation('guzzlehttp/psr7', '2.11', 'Passing %s to StreamInterface::seek() is deprecated; guzzlehttp/psr7 3.0 requires int for $offset.', \get_debug_type($offset)); 45 } 46 if (!\is_int($whence)) { 47 \trigger_deprecation('guzzlehttp/psr7', '2.11', 'Passing %s to StreamInterface::seek() is deprecated; guzzlehttp/psr7 3.0 requires int for $whence.', \get_debug_type($whence)); 48 } 49 $this->stream->seek($offset, $whence); 50 if ($offset === 0 && $whence === \SEEK_SET && $this->source !== null) { 51 $this->stream = self::inflate($this->source); 52 } 53 } 54 private static function inflate(StreamInterface $stream): Stream 24 55 { 25 56 $resource = StreamWrapper::getResource($stream); … … 29 60 // Default window size is 15. 30 61 stream_filter_append($resource, 'zlib.inflate', \STREAM_FILTER_READ, ['window' => 15 + 32]); 31 $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource));62 return new Stream($resource); 32 63 } 33 64 } -
wc-shipstation-shipping/tags/1.4.22/packages/psr7/src/Message.php
r3812630 r3816018 57 57 $body->rewind(); 58 58 $summary = $body->read($truncateAt); 59 if ($size > $truncateAt) { 59 $lookahead = $size === null ? $body->read(3) : ''; 60 if ($size > $truncateAt || $lookahead !== '') { 60 61 if (preg_match('//u', $summary) !== 1) { 61 $summary = self::trimTrailingIncompleteUtf8Character($summary, $ body->read(3));62 $summary = self::trimTrailingIncompleteUtf8Character($summary, $lookahead !== '' ? $lookahead : $body->read(3)); 62 63 } 63 64 $summary .= ' (truncated...)'; -
wc-shipstation-shipping/tags/1.4.22/readme.txt
r3812630 r3816018 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.3 7 Stable tag: 1.4.2 17 Stable tag: 1.4.22 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 284 284 285 285 == Changelog == 286 = 1.4.22 = 287 * Fixed: PHP 8.4 deprecation notices in the error log 288 * Updated: bundled shared libraries to their latest releases 286 289 = 1.4.21 = 287 290 * Fixed: early translation notice in the error log -
wc-shipstation-shipping/tags/1.4.22/vendor/composer/installed.json
r3812630 r3816018 197 197 { 198 198 "name": "guzzlehttp/guzzle", 199 "version": "7.16. 3",200 "version_normalized": "7.16. 3.0",199 "version": "7.16.5", 200 "version_normalized": "7.16.5.0", 201 201 "source": { 202 202 "type": "git", 203 203 "url": "https://github.com/guzzle/guzzle.git", 204 "reference": " c88a78082757dd5a0c44191651535259fcb6e605"205 }, 206 "dist": { 207 "type": "zip", 208 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ c88a78082757dd5a0c44191651535259fcb6e605",209 "reference": " c88a78082757dd5a0c44191651535259fcb6e605",204 "reference": "b0605f32e77a13cf98bc5e75b1d71877b6814e17" 205 }, 206 "dist": { 207 "type": "zip", 208 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b0605f32e77a13cf98bc5e75b1d71877b6814e17", 209 "reference": "b0605f32e77a13cf98bc5e75b1d71877b6814e17", 210 210 "shasum": "" 211 211 }, 212 212 "require": { 213 213 "ext-json": "*", 214 "guzzlehttp/promises": "^2.6 ",215 "guzzlehttp/psr7": "^2.13. 4",214 "guzzlehttp/promises": "^2.6.1", 215 "guzzlehttp/psr7": "^2.13.5", 216 216 "php": "^7.2.5 || ^8.0", 217 217 "psr/http-client": "^1.0", … … 236 236 "psr/log": "Required for using the Log middleware" 237 237 }, 238 "time": "2026-11- 17T16:23:09+00:00",238 "time": "2026-11-20T22:56:33+00:00", 239 239 "type": "library", 240 240 "extra": { … … 308 308 "support": { 309 309 "issues": "https://github.com/guzzle/guzzle/issues", 310 "source": "https://github.com/guzzle/guzzle/tree/7.16. 3"310 "source": "https://github.com/guzzle/guzzle/tree/7.16.5" 311 311 }, 312 312 "funding": [ … … 328 328 { 329 329 "name": "guzzlehttp/promises", 330 "version": "2.6. 0",331 "version_normalized": "2.6. 0.0",330 "version": "2.6.2", 331 "version_normalized": "2.6.2.0", 332 332 "source": { 333 333 "type": "git", 334 334 "url": "https://github.com/guzzle/promises.git", 335 "reference": " 3d88c829bd5f13d13847b39067dbf09a60af2154"336 }, 337 "dist": { 338 "type": "zip", 339 "url": "https://api.github.com/repos/guzzle/promises/zipball/ 3d88c829bd5f13d13847b39067dbf09a60af2154",340 "reference": " 3d88c829bd5f13d13847b39067dbf09a60af2154",335 "reference": "72e93ed2b1f3d8c09d1460c950bd5726face7ccd" 336 }, 337 "dist": { 338 "type": "zip", 339 "url": "https://api.github.com/repos/guzzle/promises/zipball/72e93ed2b1f3d8c09d1460c950bd5726face7ccd", 340 "reference": "72e93ed2b1f3d8c09d1460c950bd5726face7ccd", 341 341 "shasum": "" 342 342 }, … … 349 349 "phpunit/phpunit": "^8.5.52 || ^9.6.34" 350 350 }, 351 "time": "2026-1 0-18T12:46:59+00:00",351 "time": "2026-11-21T03:45:23+00:00", 352 352 "type": "library", 353 353 "extra": { … … 395 395 "support": { 396 396 "issues": "https://github.com/guzzle/promises/issues", 397 "source": "https://github.com/guzzle/promises/tree/2.6. 0"397 "source": "https://github.com/guzzle/promises/tree/2.6.2" 398 398 }, 399 399 "funding": [ … … 415 415 { 416 416 "name": "guzzlehttp/psr7", 417 "version": "2.13. 5",418 "version_normalized": "2.13. 5.0",417 "version": "2.13.6", 418 "version_normalized": "2.13.6.0", 419 419 "source": { 420 420 "type": "git", 421 421 "url": "https://github.com/guzzle/psr7.git", 422 "reference": " 5aa00c5418afbe3f435910af0e98cb03d659c49d"423 }, 424 "dist": { 425 "type": "zip", 426 "url": "https://api.github.com/repos/guzzle/psr7/zipball/ 5aa00c5418afbe3f435910af0e98cb03d659c49d",427 "reference": " 5aa00c5418afbe3f435910af0e98cb03d659c49d",422 "reference": "2bd3dccf56e99cdacf74b1ad5e06a08a5a7739f2" 423 }, 424 "dist": { 425 "type": "zip", 426 "url": "https://api.github.com/repos/guzzle/psr7/zipball/2bd3dccf56e99cdacf74b1ad5e06a08a5a7739f2", 427 "reference": "2bd3dccf56e99cdacf74b1ad5e06a08a5a7739f2", 428 428 "shasum": "" 429 429 }, … … 449 449 "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 450 450 }, 451 "time": "2026-11- 19T20:34:53+00:00",451 "time": "2026-11-21T23:48:40+00:00", 452 452 "type": "library", 453 453 "extra": { … … 517 517 "support": { 518 518 "issues": "https://github.com/guzzle/psr7/issues", 519 "source": "https://github.com/guzzle/psr7/tree/2.13. 5"519 "source": "https://github.com/guzzle/psr7/tree/2.13.6" 520 520 }, 521 521 "funding": [ … … 537 537 { 538 538 "name": "oneteamsoftware/php-arraymerger", 539 "version": "1.0. 0",540 "version_normalized": "1.0. 0.0",541 "dist": { 542 "type": "zip", 543 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-arraymerger/1.0. 0/php-arraymerger.zip",544 "shasum": " 709a603d765fe071b1e244f41d5a05fa24f362e2"539 "version": "1.0.1", 540 "version_normalized": "1.0.1.0", 541 "dist": { 542 "type": "zip", 543 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-arraymerger/1.0.1/php-arraymerger.zip", 544 "shasum": "3e478a2c2ced401557a70d3a7568a2b4b1120d57" 545 545 }, 546 546 "require-dev": { … … 626 626 { 627 627 "name": "oneteamsoftware/php-cache", 628 "version": "1.0. 0",629 "version_normalized": "1.0. 0.0",630 "dist": { 631 "type": "zip", 632 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-cache/1.0. 0/php-cache.zip",633 "shasum": " a17cfa07bdf6ea9bf59f55e2066dbfd0ddc999cb"634 }, 635 "require": { 636 "php": "^7. 3|| ^8.0"628 "version": "1.0.6", 629 "version_normalized": "1.0.6.0", 630 "dist": { 631 "type": "zip", 632 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-cache/1.0.6/php-cache.zip", 633 "shasum": "dcb831dc8b7bc076478e60bbf2e1f79220965b6d" 634 }, 635 "require": { 636 "php": "^7.4 || ^8.0" 637 637 }, 638 638 "require-dev": { … … 672 672 { 673 673 "name": "oneteamsoftware/php-classnamefinder", 674 "version": "1.0. 0",675 "version_normalized": "1.0. 0.0",676 "dist": { 677 "type": "zip", 678 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-classnamefinder/1.0. 0/php-classnamefinder.zip",679 "shasum": "5 1bbc8bcd2d1407136ea6a59ef3bb77cc497b514"680 }, 681 "require": { 682 "php": "^7. 3|| ^8.0"674 "version": "1.0.1", 675 "version_normalized": "1.0.1.0", 676 "dist": { 677 "type": "zip", 678 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-classnamefinder/1.0.1/php-classnamefinder.zip", 679 "shasum": "523e2c33f142957e909e148e861176dbdc4dd6c2" 680 }, 681 "require": { 682 "php": "^7.4 || ^8.0" 683 683 }, 684 684 "require-dev": { … … 760 760 { 761 761 "name": "oneteamsoftware/php-logger", 762 "version": "1.0. 0",763 "version_normalized": "1.0. 0.0",764 "dist": { 765 "type": "zip", 766 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-logger/1.0. 0/php-logger.zip",767 "shasum": " 15da97c9614a642cce01555779990ff8a621f2e3"768 }, 769 "require": { 770 "php": "^7. 3|| ^8.0"762 "version": "1.0.6", 763 "version_normalized": "1.0.6.0", 764 "dist": { 765 "type": "zip", 766 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-logger/1.0.6/php-logger.zip", 767 "shasum": "0d346e172f54f4660ecca07d1f08ffcd742854d8" 768 }, 769 "require": { 770 "php": "^7.4 || ^8.0" 771 771 }, 772 772 "require-dev": { … … 855 855 { 856 856 "name": "oneteamsoftware/php-shippingcarrier-abstractadapter", 857 "version": "1.0.1 3",858 "version_normalized": "1.0.1 3.0",859 "dist": { 860 "type": "zip", 861 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-shippingcarrier-abstractadapter/1.0.1 3/php-shippingcarrier-abstractadapter.zip",862 "shasum": " e63460e2ba9a9c9b9e5368e17bbae6520333f99a"857 "version": "1.0.18", 858 "version_normalized": "1.0.18.0", 859 "dist": { 860 "type": "zip", 861 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-shippingcarrier-abstractadapter/1.0.18/php-shippingcarrier-abstractadapter.zip", 862 "shasum": "40290295ae44616c0ba272b714d0e736d8eba952" 863 863 }, 864 864 "require": { … … 867 867 "dmitryrechkin/php-namingconverter": "^1.0", 868 868 "guzzlehttp/guzzle": "^7.0", 869 "oneteamsoftware/php-arraymerger": " 1.0.0",870 "oneteamsoftware/php-cache": " 1.0.0",871 "oneteamsoftware/php-classnamefinder": " 1.0.0",872 "oneteamsoftware/php-logger": " 1.0.0",873 "oneteamsoftware/php-unitconverter": " 1.0.0",874 "php": "^7. 3|| ^8.0"869 "oneteamsoftware/php-arraymerger": "^1.0.1", 870 "oneteamsoftware/php-cache": "^1.0.6", 871 "oneteamsoftware/php-classnamefinder": "^1.0.1", 872 "oneteamsoftware/php-logger": "^1.0.6", 873 "oneteamsoftware/php-unitconverter": "^1.0.5", 874 "php": "^7.4 || ^8.0" 875 875 }, 876 876 "require-dev": { 877 877 "dmitryrechkin/php-phpunit-bootstrap": "^1.0", 878 878 "dmitryrechkin/php-standard": "^1.0", 879 "humbug/php-scoper": " 0.17.5",879 "humbug/php-scoper": "^0.18.18", 880 880 "oneteamsoftware/php-scoper-configs": "~1.0.0" 881 881 }, … … 891 891 "OneTeamSoftware\\": "src/", 892 892 "OneTeamSoftware\\Tests\\": "tests/", 893 "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzle http/guzzle/src",894 "OneTeamSoftware\\Packages\\GuzzleHttp\\Promise\\": "packages/ guzzlehttp/promises/src",895 "OneTeamSoftware\\Packages\\GuzzleHttp\\Psr7\\": "packages/ guzzlehttp/psr7/src",893 "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzle/src", 894 "OneTeamSoftware\\Packages\\GuzzleHttp\\Promise\\": "packages/promises/src", 895 "OneTeamSoftware\\Packages\\GuzzleHttp\\Psr7\\": "packages/psr7/src", 896 896 "Psr\\Http\\Client\\": "vendor/psr/http-client/src", 897 897 "Psr\\Http\\Message\\": [ … … 901 901 } 902 902 }, 903 "scripts": { 904 "build-scoper": [ 905 "if [ -f vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh ]; then bash vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh guzzlehttp; else echo 'Skipping scoper (dev dependencies not installed)'; fi" 906 ], 907 "post-install-cmd": [ 908 "@build-scoper" 909 ], 910 "post-update-cmd": [ 911 "@build-scoper" 912 ] 913 }, 903 914 "license": [ 904 915 "GPL-2.0-or-later" … … 916 927 { 917 928 "name": "oneteamsoftware/php-shippingcarrier-shipstation", 918 "version": "2.0.1 1",919 "version_normalized": "2.0.1 1.0",920 "dist": { 921 "type": "zip", 922 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-shippingcarrier-shipstation/2.0.1 1/php-shippingcarrier-shipstation.zip",923 "shasum": " 5eddafa533437304d936626dc7237da284b534ad"924 }, 925 "require": { 926 "oneteamsoftware/php-shippingcarrier-abstractadapter": " 1.0.13",929 "version": "2.0.12", 930 "version_normalized": "2.0.12.0", 931 "dist": { 932 "type": "zip", 933 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-shippingcarrier-shipstation/2.0.12/php-shippingcarrier-shipstation.zip", 934 "shasum": "b9993283ef1b54880b955f3022223fafe024c798" 935 }, 936 "require": { 937 "oneteamsoftware/php-shippingcarrier-abstractadapter": "^1.0.18", 927 938 "php": ">=7.4" 928 939 }, 929 940 "require-dev": { 930 941 "dmitryrechkin/php-phpunit-bootstrap": "^1.0", 931 "dmitryrechkin/php-standard": "^1. 1.1",932 "humbug/php-scoper": " 0.17.5",933 "oneteamsoftware/php-scoper-configs": " ~1.0.0",942 "dmitryrechkin/php-standard": "^1.0", 943 "humbug/php-scoper": "^0.18.18", 944 "oneteamsoftware/php-scoper-configs": "dev-main", 934 945 "oneteamsoftware/php-shippingcarrier-tests": "1.0.1", 935 "phpstan/extension-installer": "^1.4", 936 "phpstan/phpstan": "^2.0", 937 "phpstan/phpstan-strict-rules": "^2.0" 946 "phpunit/phpunit": "^9.6", 947 "vlucas/phpdotenv": "^5.6" 938 948 }, 939 949 "type": "php-shippingcarrier-shipstation", … … 947 957 "psr-4": { 948 958 "OneTeamSoftware\\": "src/", 949 "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzle http/guzzle/src",950 "OneTeamSoftware\\Packages\\GuzzleHttp\\Promise\\": "packages/ guzzlehttp/promises/src",951 "OneTeamSoftware\\Packages\\GuzzleHttp\\Psr7\\": "packages/ guzzlehttp/psr7/src"959 "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzle/src", 960 "OneTeamSoftware\\Packages\\GuzzleHttp\\Promise\\": "packages/promises/src", 961 "OneTeamSoftware\\Packages\\GuzzleHttp\\Psr7\\": "packages/psr7/src" 952 962 } 953 963 }, … … 958 968 }, 959 969 "scripts": { 970 "test": [ 971 "phpunit" 972 ], 973 "stan": [ 974 "phpstan analyse" 975 ], 976 "cs": [ 977 "phpcs" 978 ], 960 979 "post-update-cmd": [ 961 980 "mkdir -p tests/Unit", 962 981 "cp -r vendor/oneteamsoftware/php-shippingcarrier-abstractadapter/tests/Unit/* tests/Unit/", 963 "cp -r vendor/oneteamsoftware/php-shippingcarrier-tests/tests/Unit/* tests/Unit/" 982 "cp -r vendor/oneteamsoftware/php-shippingcarrier-tests/tests/Unit/* tests/Unit/", 983 "[ -f vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh ] && composer build-scoper || echo 'Skipping scoper (dev dependencies not installed)'" 984 ], 985 "build-scoper": [ 986 "bash vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh guzzlehttp" 987 ], 988 "post-install-cmd": [ 989 "mkdir -p tests/Unit", 990 "cp -r vendor/oneteamsoftware/php-shippingcarrier-abstractadapter/tests/Unit/* tests/Unit/", 991 "cp -r vendor/oneteamsoftware/php-shippingcarrier-tests/tests/Unit/* tests/Unit/", 992 "[ -f vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh ] && composer build-scoper || echo 'Skipping scoper (dev dependencies not installed)'" 964 993 ] 965 994 }, … … 975 1004 ], 976 1005 "description": "ShipStation shipping carrier adapter", 1006 "keywords": [ 1007 "carrier", 1008 "logistics", 1009 "shipping", 1010 "shipstation" 1011 ], 977 1012 "install-path": "../oneteamsoftware/php-shippingcarrier-shipstation" 978 1013 }, 979 1014 { 980 1015 "name": "oneteamsoftware/php-unitconverter", 981 "version": "1.0. 0",982 "version_normalized": "1.0. 0.0",983 "dist": { 984 "type": "zip", 985 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-unitconverter/1.0. 0/php-unitconverter.zip",986 "shasum": " ec19abed6d0c22929c5c415cc392ed4b60b4345b"987 }, 988 "require": { 989 "php": "^7. 3|| ^8.0"1016 "version": "1.0.5", 1017 "version_normalized": "1.0.5.0", 1018 "dist": { 1019 "type": "zip", 1020 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-unitconverter/1.0.5/php-unitconverter.zip", 1021 "shasum": "7e36a579d3b23a44136d488366599db19e30e5d3" 1022 }, 1023 "require": { 1024 "php": "^7.4 || ^8.0" 990 1025 }, 991 1026 "require-dev": { … … 1007 1042 "autoload-dev": { 1008 1043 "psr-4": { 1009 " DmitryRechkin\\Tests\\": "tests/"1044 "OneTeamSoftware\\Tests\\": "tests/" 1010 1045 } 1011 1046 }, … … 1168 1203 { 1169 1204 "name": "oneteamsoftware/php-wc-shipping", 1170 "version": "1.0.7 1",1171 "version_normalized": "1.0.7 1.0",1172 "dist": { 1173 "type": "zip", 1174 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-wc-shipping/1.0.7 1/php-wc-shipping.zip",1175 "shasum": " 164c41c2ec707fd3ec7c368fe66b8f01bcd086a2"1176 }, 1177 "require": { 1178 "oneteamsoftware/php-lazyclassproxy": " ~1.0.0",1179 "oneteamsoftware/php-parcel": " ~1.0.0",1180 "oneteamsoftware/php-shippingcarrier-abstractadapter": " ~1.0.0",1205 "version": "1.0.72", 1206 "version_normalized": "1.0.72.0", 1207 "dist": { 1208 "type": "zip", 1209 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-wc-shipping/1.0.72/php-wc-shipping.zip", 1210 "shasum": "4eb0e3bb1b7e33680e95587a3da861c1d6c7bec6" 1211 }, 1212 "require": { 1213 "oneteamsoftware/php-lazyclassproxy": "^1.0.0", 1214 "oneteamsoftware/php-parcel": "^1.0.0", 1215 "oneteamsoftware/php-shippingcarrier-abstractadapter": "^1.0.0", 1181 1216 "oneteamsoftware/php-unitconverter": "^1.0.0", 1182 "oneteamsoftware/php-wc-admin-logexporter": " ~1.0.0",1183 "oneteamsoftware/php-wc-logger": " ~1.0.0",1184 "oneteamsoftware/php-wc-parcel": " ~1.1.0",1185 "oneteamsoftware/php-wp-accordion-form-enhancer": " ~1.0.0",1186 "oneteamsoftware/php-wp-admin-notices": " ~1.0.0",1187 "oneteamsoftware/php-wp-admin-oneteamsoftware": " ~1.1.0",1188 "oneteamsoftware/php-wp-asset-fallback": " ~1.0.0",1189 "oneteamsoftware/php-wp-cache-storage": " ~1.0.0",1190 "oneteamsoftware/php-wp-form-save-validator": " ~1.0.0",1191 "oneteamsoftware/php-wp-form-section-validator": " ~1.0.0",1192 "oneteamsoftware/php-wp-oneteamsoftware-autoloader": " ~1.0.0",1217 "oneteamsoftware/php-wc-admin-logexporter": "^1.0.0", 1218 "oneteamsoftware/php-wc-logger": "^1.0.0", 1219 "oneteamsoftware/php-wc-parcel": "^1.1.0", 1220 "oneteamsoftware/php-wp-accordion-form-enhancer": "^1.0.0", 1221 "oneteamsoftware/php-wp-admin-notices": "^1.0.17", 1222 "oneteamsoftware/php-wp-admin-oneteamsoftware": "^1.1.0", 1223 "oneteamsoftware/php-wp-asset-fallback": "^1.0.0", 1224 "oneteamsoftware/php-wp-cache-storage": "^1.0.0", 1225 "oneteamsoftware/php-wp-form-save-validator": "^1.0.0", 1226 "oneteamsoftware/php-wp-form-section-validator": "^1.0.0", 1227 "oneteamsoftware/php-wp-oneteamsoftware-autoloader": "^1.0.0", 1193 1228 "php": "^7.4 || ^8.0" 1194 1229 }, … … 1284 1319 { 1285 1320 "name": "oneteamsoftware/php-wp-admin-notices", 1286 "version": "1. 0.17",1287 "version_normalized": "1. 0.17.0",1288 "dist": { 1289 "type": "zip", 1290 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-wp-admin-notices/1. 0.17/php-wp-admin-notices.zip",1291 "shasum": " 3e5b1df3bf9b71c1c9b054fc37ff0387a00d5f3f"1321 "version": "1.1.1", 1322 "version_normalized": "1.1.1.0", 1323 "dist": { 1324 "type": "zip", 1325 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-wp-admin-notices/1.1.1/php-wp-admin-notices.zip", 1326 "shasum": "bbbe14f224a00931dae270131cd6fe58f4e3d98c" 1292 1327 }, 1293 1328 "require": { -
wc-shipstation-shipping/tags/1.4.22/vendor/composer/installed.php
r3812630 r3816018 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' e3f83e1e6f5b2031a5c249a30d3b7479817a0a57',6 'reference' => 'c5882ba81266602291b1c0e66d97745055fab65a', 7 7 'type' => 'wc-shipstation-shipping', 8 8 'install_path' => __DIR__ . '/../../', … … 50 50 ), 51 51 'guzzlehttp/guzzle' => array( 52 'pretty_version' => '7.16. 3',53 'version' => '7.16. 3.0',54 'reference' => ' c88a78082757dd5a0c44191651535259fcb6e605',52 'pretty_version' => '7.16.5', 53 'version' => '7.16.5.0', 54 'reference' => 'b0605f32e77a13cf98bc5e75b1d71877b6814e17', 55 55 'type' => 'library', 56 56 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', … … 59 59 ), 60 60 'guzzlehttp/promises' => array( 61 'pretty_version' => '2.6. 0',62 'version' => '2.6. 0.0',63 'reference' => ' 3d88c829bd5f13d13847b39067dbf09a60af2154',61 'pretty_version' => '2.6.2', 62 'version' => '2.6.2.0', 63 'reference' => '72e93ed2b1f3d8c09d1460c950bd5726face7ccd', 64 64 'type' => 'library', 65 65 'install_path' => __DIR__ . '/../guzzlehttp/promises', … … 68 68 ), 69 69 'guzzlehttp/psr7' => array( 70 'pretty_version' => '2.13. 5',71 'version' => '2.13. 5.0',72 'reference' => ' 5aa00c5418afbe3f435910af0e98cb03d659c49d',70 'pretty_version' => '2.13.6', 71 'version' => '2.13.6.0', 72 'reference' => '2bd3dccf56e99cdacf74b1ad5e06a08a5a7739f2', 73 73 'type' => 'library', 74 74 'install_path' => __DIR__ . '/../guzzlehttp/psr7', … … 77 77 ), 78 78 'oneteamsoftware/php-arraymerger' => array( 79 'pretty_version' => '1.0. 0',80 'version' => '1.0. 0.0',79 'pretty_version' => '1.0.1', 80 'version' => '1.0.1.0', 81 81 'reference' => null, 82 82 'type' => 'php-arraymerger', … … 95 95 ), 96 96 'oneteamsoftware/php-cache' => array( 97 'pretty_version' => '1.0. 0',98 'version' => '1.0. 0.0',97 'pretty_version' => '1.0.6', 98 'version' => '1.0.6.0', 99 99 'reference' => null, 100 100 'type' => 'php-cache', … … 104 104 ), 105 105 'oneteamsoftware/php-classnamefinder' => array( 106 'pretty_version' => '1.0. 0',107 'version' => '1.0. 0.0',106 'pretty_version' => '1.0.1', 107 'version' => '1.0.1.0', 108 108 'reference' => null, 109 109 'type' => 'php-classnamefinder', … … 122 122 ), 123 123 'oneteamsoftware/php-logger' => array( 124 'pretty_version' => '1.0. 0',125 'version' => '1.0. 0.0',124 'pretty_version' => '1.0.6', 125 'version' => '1.0.6.0', 126 126 'reference' => null, 127 127 'type' => 'php-logger', … … 140 140 ), 141 141 'oneteamsoftware/php-shippingcarrier-abstractadapter' => array( 142 'pretty_version' => '1.0.1 3',143 'version' => '1.0.1 3.0',142 'pretty_version' => '1.0.18', 143 'version' => '1.0.18.0', 144 144 'reference' => null, 145 145 'type' => 'php-shippingcarrier-abstractadapter', … … 149 149 ), 150 150 'oneteamsoftware/php-shippingcarrier-shipstation' => array( 151 'pretty_version' => '2.0.1 1',152 'version' => '2.0.1 1.0',151 'pretty_version' => '2.0.12', 152 'version' => '2.0.12.0', 153 153 'reference' => null, 154 154 'type' => 'php-shippingcarrier-shipstation', … … 158 158 ), 159 159 'oneteamsoftware/php-unitconverter' => array( 160 'pretty_version' => '1.0. 0',161 'version' => '1.0. 0.0',160 'pretty_version' => '1.0.5', 161 'version' => '1.0.5.0', 162 162 'reference' => null, 163 163 'type' => 'php-unitconverter', … … 194 194 ), 195 195 'oneteamsoftware/php-wc-shipping' => array( 196 'pretty_version' => '1.0.7 1',197 'version' => '1.0.7 1.0',196 'pretty_version' => '1.0.72', 197 'version' => '1.0.72.0', 198 198 'reference' => null, 199 199 'type' => 'php-wc-shipping', … … 212 212 ), 213 213 'oneteamsoftware/php-wp-admin-notices' => array( 214 'pretty_version' => '1. 0.17',215 'version' => '1. 0.17.0',214 'pretty_version' => '1.1.1', 215 'version' => '1.1.1.0', 216 216 'reference' => null, 217 217 'type' => 'php-wp-admin-notices', … … 295 295 'pretty_version' => 'dev-main', 296 296 'version' => 'dev-main', 297 'reference' => ' e3f83e1e6f5b2031a5c249a30d3b7479817a0a57',297 'reference' => 'c5882ba81266602291b1c0e66d97745055fab65a', 298 298 'type' => 'wc-shipstation-shipping', 299 299 'install_path' => __DIR__ . '/../../', -
wc-shipstation-shipping/tags/1.4.22/wc-shipstation-shipping.php
r3812630 r3816018 5 5 * Plugin URI: https://wordpress.org/plugins/wc-shipstation-shipping/ 6 6 * Description: Displays live ShipStation shipping rates at cart and checkout pages 7 * Version: 1.4.2 17 * Version: 1.4.22 8 8 * Tested up to: 7.0 9 9 * Requires PHP: 7.4 … … 26 26 defined('ABSPATH') || exit; 27 27 28 // Shipping framework: 1.0.7 128 // Shipping framework: 1.0.72 29 29 // The exact release of the shared framework this plugin bundles. Another carrier 30 30 // plugin reads this line to tell whether the copy WordPress actually loaded is the … … 81 81 __('Do you like our plugin and can recommend to others?', 'wc-shipstation-shipping') 82 82 ), 83 '1.4.2 1',83 '1.4.22', 84 84 static function (): void { 85 85 // phpcs:ignore PSR1.Classes.ClassDeclaration.MissingNamespace, Squiz.Classes.ValidClassName.NotCamelCaps -- Plugin::getShippingMethods() resolves this class as 'ShippingMethod_' . str_replace('-', '_', $id); renaming it stops the method registering. -
wc-shipstation-shipping/trunk/includes/Cache/Cache.php
r3812630 r3816018 22 22 * @var Storage\StorageInterface 23 23 */ 24 private $storage;24 private Storage\StorageInterface $storage; 25 25 26 26 /** 27 27 * @var bool 28 28 */ 29 private $useCache;29 private bool $useCache; 30 30 31 31 /** 32 32 * @var int 33 33 */ 34 private $defaultExpiresAfter;34 private int $defaultExpiresAfter; 35 35 36 36 /** … … 84 84 * 85 85 * @param string $key 86 * @return true86 * @return bool 87 87 */ 88 88 public function has(string $key): bool -
wc-shipstation-shipping/trunk/includes/Cache/KeyGenerator.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $suffix;24 protected string $suffix; 25 25 26 26 /** -
wc-shipstation-shipping/trunk/includes/Cache/Storage/TmpFile.php
r3812630 r3816018 19 19 class TmpFile implements StorageInterface 20 20 { 21 /** 22 * @var string 23 */ 24 private $basePath; 21 private string $basePath; 25 22 26 23 /** -
wc-shipstation-shipping/trunk/includes/ClassNameFinder/ClassNameFinder.php
r3812630 r3816018 20 20 { 21 21 /** 22 * @var array 22 * @var array<mixed> 23 23 */ 24 private $baseClassPaths;24 private array $baseClassPaths = []; 25 25 26 26 /** -
wc-shipstation-shipping/trunk/includes/Logger/EchoLogger.php
r3812630 r3816018 31 31 public function log(string $level, string $file, int $line, string $message, ...$args): void 32 32 { 33 echo sprintf("[%s:%s] %s\n", basename($file), $line, sprintf($message, ...$args)); 33 $output = sprintf("[%s:%s] %s\n", basename($file), $line, sprintf($message, ...$args)); 34 35 // Escaped, not raw: the log line renders in a browser view of the 36 // stream, and an injected message must not become markup there. 37 echo esc_html($output); 34 38 } 35 39 } -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/AbstractEndPoint.php
r3812630 r3816018 28 28 * @var CacheInterface 29 29 */ 30 protected $cache;30 protected CacheInterface $cache; 31 31 32 32 /** 33 33 * @var Payload 34 34 */ 35 protected $payload;35 protected Payload $payload; 36 36 37 37 /** 38 38 * @var KeyGeneratorInterface 39 39 */ 40 protected $keyGenerator;40 protected KeyGeneratorInterface $keyGenerator; 41 41 42 42 /** 43 43 * @var LoggerInterface 44 44 */ 45 protected $logger;45 protected LoggerInterface $logger; 46 46 47 47 /** 48 48 * @var string 49 49 */ 50 protected $textDomain;50 protected string $textDomain; 51 51 52 52 /** 53 53 * @var TypesInterface 54 54 */ 55 protected $types;55 protected TypesInterface $types; 56 56 57 57 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/EndPointFactory.php
r3812630 r3816018 29 29 * @var string 30 30 */ 31 private $textDomain;31 private string $textDomain; 32 32 33 33 /** 34 34 * @var LoggerInterface 35 35 */ 36 private $logger;36 private LoggerInterface $logger; 37 37 38 38 /** 39 39 * @var TypesInterface 40 40 */ 41 private $types;41 private TypesInterface $types; 42 42 43 43 /** 44 44 * @var KeyGeneratorInterface 45 45 */ 46 private $keyGenerator;46 private KeyGeneratorInterface $keyGenerator; 47 47 48 48 /** 49 49 * @var CacheInterface 50 50 */ 51 private $cache;51 private CacheInterface $cache; 52 52 53 53 /** 54 54 * @var ClassNameFinder 55 55 */ 56 private $classNameFinder;56 private ClassNameFinder $classNameFinder; 57 57 58 58 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/AbstractExecutor.php
r3812630 r3816018 29 29 * @var LoggerInterface 30 30 */ 31 protected $logger;31 protected LoggerInterface $logger; 32 32 33 33 /** 34 34 * @var RequestExecutorInterface 35 35 */ 36 protected $requestExecutor;36 protected RequestExecutorInterface $requestExecutor; 37 37 38 38 /** 39 39 * @var EndPointFactoryInterface 40 40 */ 41 protected $endPointFactory;41 protected EndPointFactoryInterface $endPointFactory; 42 42 43 43 /** 44 44 * @var PayloadFactoryInterface 45 45 */ 46 protected $payloadFactory;46 protected PayloadFactoryInterface $payloadFactory; 47 47 48 48 /** 49 49 * @var FeaturesInterface 50 50 */ 51 protected $features;51 protected FeaturesInterface $features; 52 52 53 53 /** 54 54 * @var TypesInterface 55 55 */ 56 protected $types;56 protected TypesInterface $types; 57 57 58 58 /** 59 59 * @var string 60 60 */ 61 protected $endPointName;61 protected string $endPointName; 62 62 63 63 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorFactory.php
r3812630 r3816018 17 17 namespace OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\Executor; 18 18 19 use OneTeamSoftware\Cache\CacheInterface; 19 20 use OneTeamSoftware\ClassNameFinder\ClassNameFinder; 20 21 use OneTeamSoftware\Logger\LoggerInterface; … … 24 25 use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\PayloadFactoryInterface; 25 26 use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\TypesInterface; 27 use ReflectionException; 28 use ReflectionMethod; 29 use ReflectionNamedType; 26 30 27 31 class ExecutorFactory implements ExecutorFactoryInterface … … 30 34 * @var LoggerInterface 31 35 */ 32 protected $logger;36 protected LoggerInterface $logger; 33 37 34 38 /** 35 39 * @var RequestExecutorInterface 36 40 */ 37 protected $requestExecutor;41 protected RequestExecutorInterface $requestExecutor; 38 42 39 43 /** 40 44 * @var EndPointFactoryInterface 41 45 */ 42 protected $endPointFactory;46 protected EndPointFactoryInterface $endPointFactory; 43 47 44 48 /** 45 49 * @var PayloadFactoryInterface 46 50 */ 47 protected $payloadFactory;51 protected PayloadFactoryInterface $payloadFactory; 48 52 49 53 /** 50 54 * @var FeaturesInterface 51 55 */ 52 protected $features;56 protected FeaturesInterface $features; 53 57 54 58 /** 55 59 * @var TypesInterface 56 60 */ 57 protected $types;61 protected TypesInterface $types; 58 62 59 63 /** 60 64 * @var ClassNameFinder 61 65 */ 62 protected $classNameFinder;66 protected ClassNameFinder $classNameFinder; 63 67 64 68 /** 65 69 * @var array<string,ExecutorInterface> 66 70 */ 67 protected $instances; 71 protected array $instances; 72 73 /** 74 * Optional cache injected into executors that need it (e.g. FedEx OAuth 75 * token caching). Null means no caching (backwards-compatible default). 76 * 77 * @var CacheInterface|null 78 */ 79 private ?CacheInterface $cache = null; 68 80 69 81 /** … … 77 89 * @param PayloadFactoryInterface $payloadFactory 78 90 * @param ClassNameFinder $classNameFinder 91 * @param CacheInterface|null $cache Optional cache for executors that cache tokens/responses 79 92 */ 80 93 public function __construct( … … 85 98 EndPointFactoryInterface $endPointFactory, 86 99 PayloadFactoryInterface $payloadFactory, 87 ClassNameFinder $classNameFinder 100 ClassNameFinder $classNameFinder, 101 ?CacheInterface $cache = null 88 102 ) { 89 103 $this->features = $features; … … 94 108 $this->payloadFactory = $payloadFactory; 95 109 $this->classNameFinder = $classNameFinder; 110 $this->cache = $cache; 96 111 $this->instances = []; 97 112 } … … 115 130 } 116 131 117 $executor = new $executorClassName( 132 // Build the base constructor arguments shared by all executors 133 // (AbstractExecutor signature). 134 $constructorArguments = [ 118 135 $this->features, 119 136 $this->types, … … 122 139 $this->endPointFactory, 123 140 $this->payloadFactory, 124 $endPointName 125 ); 141 $endPointName, 142 ]; 143 144 // Only append the optional cache argument when the concrete executor's 145 // constructor declares an additional (optional) cache parameter. This 146 // keeps backwards compatibility with executors that only accept the 147 // base 7-parameter AbstractExecutor signature. 148 if ($this->cache !== null && $this->constructorAcceptsCache($executorClassName)) { 149 $constructorArguments[] = $this->cache; 150 } 151 152 $executor = new $executorClassName(...$constructorArguments); 126 153 127 154 $this->instances[$endPointName] = $executor; … … 129 156 return $executor; 130 157 } 158 159 /** 160 * Returns true when the given executor class declares an 8th constructor 161 * parameter typed as CacheInterface (used to inject the OAuth token cache 162 * into carriers like FedEx without breaking executors that do not accept it). 163 * 164 * @param string $executorClassName Fully-qualified executor class name 165 * @return bool 166 */ 167 private function constructorAcceptsCache(string $executorClassName): bool 168 { 169 try { 170 $reflectionMethod = new ReflectionMethod($executorClassName, '__construct'); 171 } catch (ReflectionException $reflectionException) { 172 return false; 173 } 174 175 $parameters = $reflectionMethod->getParameters(); 176 if (count($parameters) <= 7) { 177 return false; 178 } 179 180 $cacheParameter = $parameters[7]; 181 $parameterType = $cacheParameter->getType(); 182 if ($parameterType === null) { 183 return false; 184 } 185 186 $typeName = $parameterType instanceof ReflectionNamedType 187 ? $parameterType->getName() 188 : (string) $parameterType; 189 190 return $typeName === CacheInterface::class 191 || is_a($typeName, CacheInterface::class, true); 192 } 131 193 } -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorPerCarrier.php
r3812630 r3816018 57 57 if (false === empty($data['carriers']) && is_array($data['carriers'])) { 58 58 $carriers = $data['carriers']; 59 } else if (false === empty($this->types->getCarriers())){59 } else { 60 60 $carriers = array_keys($this->types->getCarriers()->toArray()); 61 61 } -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/MessagesHandlerFactory.php
r3812630 r3816018 24 24 * @var ClassNameFinder 25 25 */ 26 private $classNameFinder;26 private ClassNameFinder $classNameFinder; 27 27 28 28 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/TypeValuesLoader.php
r3812630 r3816018 26 26 * @var LoggerInterface 27 27 */ 28 protected $logger;28 protected LoggerInterface $logger; 29 29 30 30 /** 31 31 * @var ExecutorFactoryInterface 32 32 */ 33 protected $executorFactory;33 protected ExecutorFactoryInterface $executorFactory; 34 34 35 35 /** 36 * @var array 36 * @var array<mixed> 37 37 */ 38 protected $messages;38 protected array $messages; 39 39 40 40 /** … … 145 145 146 146 foreach ($response as $key => $keyValues) { 147 if (!is_array($keyValues)) { 148 $this->logger->debug(__FILE__, __LINE__, 'Skip non-array response key %s: %s', (string)$key, print_r($keyValues, true)); 149 continue; 150 } 151 147 152 if (empty($values[$key])) { 148 153 $values[$key] = []; -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FileDownloader.php
r3812630 r3816018 29 29 * @var LoggerInterface 30 30 */ 31 protected $logger;31 protected LoggerInterface $logger; 32 32 33 33 /** 34 34 * @var ClientInterface 35 35 */ 36 protected $client;36 protected ClientInterface $client; 37 37 38 38 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FilesDownloaderPromise.php
r3812630 r3816018 24 24 * @var FilesDownloaderInterface 25 25 */ 26 protected $filesDownloader;26 protected FilesDownloaderInterface $filesDownloader; 27 27 28 28 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ManifestFilesDownloader.php
r3812630 r3816018 26 26 * @var FileDownloaderInterface 27 27 */ 28 protected $fileDownloader;28 protected FileDownloaderInterface $fileDownloader; 29 29 30 30 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ShipmentFilesDownloader.php
r3812630 r3816018 26 26 * @var FileDownloaderInterface 27 27 */ 28 protected $fileDownloader;28 protected FileDownloaderInterface $fileDownloader; 29 29 30 30 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Form/AbstractForm.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $textDomain;24 protected string $textDomain; 25 25 26 26 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/GenericAdapter.php
r3812630 r3816018 66 66 * @var string 67 67 */ 68 protected $adapterName;68 protected string $adapterName; 69 69 70 70 /** 71 71 * @var string 72 72 */ 73 protected $textDomain;73 protected string $textDomain; 74 74 75 75 /** 76 76 * @var string 77 77 */ 78 protected $name;78 protected string $name; 79 79 80 80 /** 81 81 * @var ClientInterface 82 82 */ 83 protected $client;83 protected ClientInterface $client; 84 84 85 85 /** 86 86 * @var LoggerInterface 87 87 */ 88 protected $logger;88 protected LoggerInterface $logger; 89 89 90 90 /** 91 91 * @var KeyGeneratorInterface 92 92 */ 93 protected $keyGenerator;93 protected KeyGeneratorInterface $keyGenerator; 94 94 95 95 /** 96 96 * @var CacheInterface 97 97 */ 98 protected $cache;98 protected CacheInterface $cache; 99 99 100 100 /** 101 101 * @var TypesInterface 102 102 */ 103 protected $types;103 protected TypesInterface $types; 104 104 105 105 /** 106 106 * @var FeaturesInterface 107 107 */ 108 protected $features;108 protected FeaturesInterface $features; 109 109 110 110 /** 111 111 * @var FormInterface 112 112 */ 113 protected $form;113 protected FormInterface $form; 114 114 115 115 /** 116 116 * @var ClassNameFinder 117 117 */ 118 protected $classNameFinder;118 protected ClassNameFinder $classNameFinder; 119 119 120 120 /** 121 121 * @var PayloadFactory 122 122 */ 123 protected $payloadFactory;123 protected PayloadFactory $payloadFactory; 124 124 125 125 /** 126 126 * @var ExecutorFactory 127 127 */ 128 protected $executorFactory;128 protected ExecutorFactory $executorFactory; 129 129 130 130 /** … … 667 667 array_merge( 668 668 $this->form->getFieldValues($data), 669 ['init_types_cache_key' => 'types'] 669 [ 670 'init_types_cache_key' => 'types', 671 'sandbox' => !empty($data['sandbox']), 672 ] 670 673 ) 671 674 ); … … 950 953 $endPointFactory, 951 954 $this->payloadFactory, 952 $this->classNameFinder 955 $this->classNameFinder, 956 $this->cache 953 957 ); 954 958 } -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/Client.php
r3812630 r3816018 27 27 { 28 28 /** 29 * What replaces a credential in the debug log. 30 * 31 * @var string 32 */ 33 private const REDACTED = '[REDACTED]'; 34 35 /** 36 * Bodies above this size (base64 labels, PDFs) are logged as their size only: 37 * scanning them costs more than they are worth in a debug log. 38 * 39 * @var int 40 */ 41 private const MAXIMUM_REDACTED_BODY_BYTES = 65536; 42 43 /** 44 * Name fragments that mark a header or field as a credential, compared 45 * against the name lowercased with '-' and '_' removed (API-Key, api_key and 46 * apiKey all become "apikey"). The debug log is shipped in support bundles, 47 * so carrier credentials must never reach it (#732). 48 * 49 * @var array<string> 50 */ 51 private const CREDENTIAL_NAME_FRAGMENTS = [ 52 'authorization', 53 'password', 54 'passwd', 55 'secret', 56 'token', 57 'apikey', 58 'accesskey', 59 'privatekey', 60 'licensekey', 61 'cookie', 62 ]; 63 64 /** 29 65 * @var GuzzleClientInterface 30 66 */ 31 protected $httpClient;67 protected GuzzleClientInterface $httpClient; 32 68 33 69 /** 34 70 * @var LoggerInterface 35 71 */ 36 protected $logger;72 protected LoggerInterface $logger; 37 73 38 74 /** … … 63 99 64 100 // @codingStandardsIgnoreLine 65 $this->logger->debug(__FILE__, __LINE__, 'sendAsync, method: %s, uri: %s, headers: %s, body: %s', $method, $ uri, print_r($headers, true), $body);101 $this->logger->debug(__FILE__, __LINE__, 'sendAsync, method: %s, uri: %s, headers: %s, body: %s', $method, $this->redactQueryParameters($uri), print_r($this->redactHeaders($headers), true), $this->redactBody($body)); 66 102 67 103 $httpRequest = new HttpRequest( … … 98 134 99 135 // @codingStandardsIgnoreLine 100 $this->logger->debug(__FILE__, __LINE__, 'Response code: %d, contents: %s', $statusCode, (ctype_print($contents) ? $ contents: 'binary contents'));136 $this->logger->debug(__FILE__, __LINE__, 'Response code: %d, contents: %s', $statusCode, (ctype_print($contents) ? $this->redactBody($contents) : 'binary contents')); 101 137 102 138 return $responseHandler->getResponse($contents, $statusCode); 139 } 140 141 /** 142 * returns headers with credential values replaced 143 * 144 * @param array<mixed> $headers 145 * @return array<mixed> 146 */ 147 private function redactHeaders(array $headers): array 148 { 149 foreach ($headers as $name => $value) { 150 if ($this->isCredentialName((string) $name)) { 151 $headers[$name] = self::REDACTED; 152 } 153 } 154 155 return $headers; 156 } 157 158 /** 159 * returns a request or response body with credential values replaced, for 160 * the JSON, form-encoded and XML bodies the carrier adapters exchange 161 * 162 * @param string $body 163 * @return string 164 */ 165 private function redactBody(string $body): string 166 { 167 if (strlen($body) > self::MAXIMUM_REDACTED_BODY_BYTES) { 168 return '[' . strlen($body) . ' bytes, not logged]'; 169 } 170 171 $decoded = json_decode($body, true); 172 if (is_array($decoded)) { 173 return (string) json_encode($this->redactArray($decoded), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); 174 } 175 176 if (preg_match('/^[^\s<{]+=[^\s]*$/', $body) === 1) { 177 parse_str($body, $fields); 178 179 return http_build_query($this->redactArray($fields)); 180 } 181 182 $redacted = preg_replace_callback( 183 '/<([A-Za-z0-9_:.-]+)(\s[^>]*)?>(<!\[CDATA\[.*?\]\]>|[^<]*)<\/\1>/s', 184 function (array $matches): string { 185 if (!$this->isCredentialName($matches[1])) { 186 return $matches[0]; 187 } 188 189 return '<' . $matches[1] . $matches[2] . '>' . self::REDACTED . '</' . $matches[1] . '>'; 190 }, 191 $body 192 ); 193 if ($redacted !== null) { 194 $redacted = preg_replace_callback( 195 '/([A-Za-z0-9_:.-]+)(\s*=\s*)(["\'])([^"\'\r\n]*)\3/', 196 function (array $matches): string { 197 if (!$this->isCredentialName($matches[1])) { 198 return $matches[0]; 199 } 200 201 return $matches[1] . $matches[2] . $matches[3] . self::REDACTED . $matches[3]; 202 }, 203 $redacted 204 ); 205 } 206 207 if ($redacted !== null) { 208 // JSON that did not decode (Guzzle truncates the body in exception 209 // messages): redact "name":"value" pairs textually. 210 $redacted = preg_replace_callback( 211 '/"([^"\\\\]+)"(\s*:\s*)"((?:[^"\\\\]|\\\\.)*)("?)/', 212 function (array $matches): string { 213 if (!$this->isCredentialName($matches[1])) { 214 return $matches[0]; 215 } 216 217 return '"' . $matches[1] . '"' . $matches[2] . '"' . self::REDACTED . $matches[4]; 218 }, 219 $redacted 220 ); 221 } 222 223 return $redacted ?? '[body not logged: redaction failed, preg error ' . preg_last_error() . ']'; 224 } 225 226 /** 227 * returns text with credential query parameters (?api_key=... / &token=...) replaced 228 * 229 * @param string $text 230 * @return string 231 */ 232 private function redactQueryParameters(string $text): string 233 { 234 $redacted = preg_replace_callback( 235 '/([?&])([^=&\s#]+)=([^&\s#]*)/', 236 function (array $matches): string { 237 return $this->isCredentialName(urldecode($matches[2])) ? $matches[1] . $matches[2] . '=' . self::REDACTED : $matches[0]; 238 }, 239 $text 240 ); 241 242 return $redacted ?? '[not logged: redaction failed, preg error ' . preg_last_error() . ']'; 243 } 244 245 /** 246 * returns a decoded body with credential values replaced, at any depth 247 * 248 * @param array<mixed> $fields 249 * @return array<mixed> 250 */ 251 private function redactArray(array $fields): array 252 { 253 foreach ($fields as $name => $value) { 254 if (is_string($name) && $this->isCredentialName($name)) { 255 $fields[$name] = self::REDACTED; 256 } elseif (is_array($value)) { 257 $fields[$name] = $this->redactArray($value); 258 } 259 } 260 261 return $fields; 262 } 263 264 /** 265 * returns true when a header or field name carries a credential 266 * 267 * @param string $name 268 * @return bool 269 */ 270 private function isCredentialName(string $name): bool 271 { 272 $normalizedName = str_replace(['-', '_'], '', strtolower($name)); 273 if ($normalizedName === 'key') { 274 return true; 275 } 276 277 foreach (self::CREDENTIAL_NAME_FRAGMENTS as $fragment) { 278 if (strpos($normalizedName, $fragment) !== false) { 279 return true; 280 } 281 } 282 283 return false; 103 284 } 104 285 … … 111 292 private function getErrorResponse(GuzzleException $httpException): array 112 293 { 113 $this->logger->debug(__FILE__, __LINE__, 'Exception: %s', print_r($httpException, true));294 $this->logger->debug(__FILE__, __LINE__, 'Exception: %s', $this->redactQueryParameters($this->redactBody($httpException->getMessage()))); 114 295 115 296 $newResponse = []; -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractRequest.php
r3812630 r3816018 22 22 { 23 23 /** 24 * @var array 24 * @var array<mixed> 25 25 */ 26 protected $extras;26 protected array $extras; 27 27 28 28 /** 29 29 * @var EndPointInterface 30 30 */ 31 protected $endPoint;31 protected EndPointInterface $endPoint; 32 32 33 33 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractResponseHandler.php
r3812630 r3816018 26 26 * @var LoggerInterface 27 27 */ 28 protected $logger;28 protected LoggerInterface $logger; 29 29 30 30 /** 31 31 * @var EndPointInterface 32 32 */ 33 protected $endPoint;33 protected EndPointInterface $endPoint; 34 34 35 35 /** 36 36 * @var MessagesHandlerInterface 37 37 */ 38 protected $messagesHandler;38 protected MessagesHandlerInterface $messagesHandler; 39 39 40 40 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/JsonResponseHandler.php
r3812630 r3816018 30 30 $this->logger->debug(__FILE__, __LINE__, 'Response: %s', (string)$contents); 31 31 32 $newResponse = []; 32 $newResponse = [ 33 'code' => $statusCode, 34 ]; 33 35 34 36 $response = json_decode($contents, true) ?? []; -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutor.php
r3812630 r3816018 28 28 * @var ClientInterface 29 29 */ 30 protected $client;30 protected ClientInterface $client; 31 31 32 32 /** 33 33 * @var LoggerInterface 34 34 */ 35 protected $logger;35 protected LoggerInterface $logger; 36 36 37 37 /** 38 38 * @var RequestFactoryInterface 39 39 */ 40 protected $requestFactory;40 protected RequestFactoryInterface $requestFactory; 41 41 42 42 /** 43 43 * @var ResponseHandlerFactoryInterface 44 44 */ 45 protected $responseHandlerFactory;45 protected ResponseHandlerFactoryInterface $responseHandlerFactory; 46 46 47 47 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutorFactory.php
r3812630 r3816018 26 26 * @var ClientInterface 27 27 */ 28 protected $client;28 protected ClientInterface $client; 29 29 30 30 /** 31 31 * @var LoggerInterface 32 32 */ 33 protected $logger;33 protected LoggerInterface $logger; 34 34 35 35 /** 36 36 * @var RequestFactoryInterface 37 37 */ 38 protected $requestFactory;38 protected RequestFactoryInterface $requestFactory; 39 39 40 40 /** 41 41 * @var ResponseHandlerFactoryInterface 42 42 */ 43 protected $responseHandlerFactory;43 protected ResponseHandlerFactoryInterface $responseHandlerFactory; 44 44 45 45 /** 46 46 * @var ClassNameFinder 47 47 */ 48 protected $classNameFinder;48 protected ClassNameFinder $classNameFinder; 49 49 50 50 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestFactory.php
r3812630 r3816018 25 25 * @var ClassNameFinder 26 26 */ 27 private $classNameFinder;27 private ClassNameFinder $classNameFinder; 28 28 29 29 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponseHandlerFactory.php
r3812630 r3816018 28 28 * @var LoggerInterface 29 29 */ 30 private $logger;30 private LoggerInterface $logger; 31 31 32 32 /** 33 33 * @var MessagesHandlerInterface 34 34 */ 35 private $messagesHandler;35 private MessagesHandlerInterface $messagesHandler; 36 36 37 37 /** 38 38 * @var ClassNameFinder 39 39 */ 40 private $classNameFinder;40 private ClassNameFinder $classNameFinder; 41 41 42 42 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponsesMerger.php
r3812630 r3816018 21 21 use OneTeamSoftware\Packages\GuzzleHttp\Promise\PromiseInterface; 22 22 use OneTeamSoftware\Packages\GuzzleHttp\Promise\Utils; 23 use Throwable; 23 24 24 25 class ResponsesMerger 25 26 { 26 /** 27 * @var LoggerInterface 28 */ 29 protected $logger; 27 protected LoggerInterface $logger; 30 28 31 /** 32 * @var ArrayRecursiveDistinctMerger 33 */ 34 protected $arrayMerger; 29 protected ArrayRecursiveDistinctMerger $arrayMerger; 35 30 36 31 /** … … 46 41 47 42 /** 48 * creates a single promise for the multiple promises43 * Merges multiple response promises into a single response promise. 49 44 * 50 * @param array $promises 45 * Uses Utils::settle so every promise is awaited regardless of outcome: one 46 * rejected promise (a carrier or package request that failed) cannot void the 47 * whole merge. Fulfilled responses are recursively merged; rejected ones are 48 * dropped and their failures surfaced in the merged response's `messages` 49 * (plain strings, the framework convention), so working carriers' data still 50 * comes through and the caller can see what failed. 51 * 52 * @param array<PromiseInterface> $promises 51 53 * @return PromiseInterface 52 54 */ 53 55 public function merge(array $promises): PromiseInterface 54 56 { 55 $promise = Utils::all($promises); 56 $promise = $promise->then( 57 function (array $responses) { 58 $newResponse = []; 59 foreach ($responses as $response) { 60 $this->logger->debug(__FILE__, __LINE__, 'Merge Response: %s', print_r($response, true)); 61 62 $newResponse = $this->arrayMerger->merge($newResponse, $response); 63 } 64 65 $this->logger->debug(__FILE__, __LINE__, 'New Response: %s', print_r($newResponse, true)); 66 67 return $newResponse; 57 return Utils::settle($promises)->then( 58 function (array $settled): array { 59 return $this->mergeSettledResults($settled); 68 60 } 69 61 ); 62 } 70 63 71 return $promise; 64 /** 65 * Reduces the settled promise results into a single merged response. 66 * 67 * Fulfilled results are merged in order; rejected results are collected as 68 * human-readable failure messages and appended to the merged response. 69 * 70 * @param array $settled results as returned by Utils::settle, each with a `state` key 71 * @return array<string, mixed> 72 */ 73 private function mergeSettledResults(array $settled): array 74 { 75 $mergedResponse = []; 76 $failureMessages = []; 77 78 foreach ($settled as $key => $result) { 79 if ($this->isFulfilled($result)) { 80 $mergedResponse = $this->mergeResponse($mergedResponse, $this->extractValue($result)); 81 continue; 82 } 83 84 $failureMessages[] = $this->buildFailureMessage($key, $result); 85 } 86 87 return $this->withFailureMessages($mergedResponse, $failureMessages); 88 } 89 90 /** 91 * Returns true when a settled result represents a fulfilled promise. 92 * 93 * @param mixed $result one settled result entry 94 * @return bool 95 */ 96 private function isFulfilled($result): bool 97 { 98 return is_array($result) && ($result['state'] ?? '') === PromiseInterface::FULFILLED; 99 } 100 101 /** 102 * Extracts the fulfilled promise's value as an array, defaulting to empty. 103 * 104 * @param array $result a fulfilled settled result entry 105 * @return array<string, mixed> 106 */ 107 private function extractValue(array $result): array 108 { 109 $value = $result['value'] ?? []; 110 111 return is_array($value) ? $value : []; 112 } 113 114 /** 115 * Merges a single fulfilled response into the accumulator, logging it for debugging. 116 * 117 * @param array<string, mixed> $mergedResponse the running merged response 118 * @param array<string, mixed> $response the fulfilled response to fold in 119 * @return array<string, mixed> 120 */ 121 private function mergeResponse(array $mergedResponse, array $response): array 122 { 123 $this->logger->debug(__FILE__, __LINE__, 'Merge Response: %s', print_r($response, true)); 124 125 return $this->arrayMerger->merge($mergedResponse, $response); 126 } 127 128 /** 129 * Builds a human-readable failure message for a rejected promise, logging a warning. 130 * 131 * @param int|string $key the promise key (e.g. carrier prefix or package index) 132 * @param mixed $result the rejected settled result entry 133 * @return string 134 */ 135 private function buildFailureMessage($key, $result): string 136 { 137 $reason = is_array($result) ? ($result['reason'] ?? null) : null; 138 $message = $reason instanceof Throwable ? $reason->getMessage() : (string) $reason; 139 140 $this->logger->warning( 141 __FILE__, 142 __LINE__, 143 'Merge dropping rejected promise for "%s": %s', 144 (string) $key, 145 $message 146 ); 147 148 return sprintf('Carrier "%s" request failed: %s', (string) $key, $message); 149 } 150 151 /** 152 * Appends rejected-carrier failure messages to the merged response, preserving any 153 * messages already present in fulfilled responses. 154 * 155 * @param array<string, mixed> $mergedResponse 156 * @param array<int, string> $failureMessages 157 * @return array<string, mixed> 158 */ 159 private function withFailureMessages(array $mergedResponse, array $failureMessages): array 160 { 161 if (empty($failureMessages)) { 162 return $mergedResponse; 163 } 164 165 $existingMessages = isset($mergedResponse['messages']) && is_array($mergedResponse['messages']) 166 ? $mergedResponse['messages'] 167 : []; 168 $mergedResponse['messages'] = array_merge($existingMessages, $failureMessages); 169 170 return $mergedResponse; 72 171 } 73 172 } -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/Request.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $method;24 protected string $method; 25 25 26 26 /** 27 27 * @var string 28 28 */ 29 protected $uri;29 protected string $uri; 30 30 31 31 /** 32 * @var array 32 * @var array<mixed> 33 33 */ 34 protected $headers;34 protected array $headers; 35 35 36 36 /** 37 37 * @var string 38 38 */ 39 protected $body;39 protected string $body; 40 40 41 41 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/Parts.php
r3812630 r3816018 24 24 * @var integer 25 25 */ 26 protected $index;26 protected int $index; 27 27 28 28 /** 29 * @var array 29 * @var array<mixed> 30 30 */ 31 protected $parts;31 protected array $parts; 32 32 33 33 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/ShipmentId.php
r3812630 r3816018 22 22 * @var StringBuilder 23 23 */ 24 protected $stringBuilder;24 protected StringBuilder $stringBuilder; 25 25 26 26 /** 27 * @var array 27 * @var array<mixed> 28 28 */ 29 protected $values;29 protected array $values; 30 30 31 31 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringBuilder.php
r3812630 r3816018 22 22 * @var Parts $parts 23 23 */ 24 protected $parts;24 protected Parts $parts; 25 25 26 26 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringParser.php
r3812630 r3816018 22 22 * @var Parts $parts 23 23 */ 24 protected $parts;24 protected Parts $parts; 25 25 26 26 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Collection.php
r3812630 r3816018 20 20 { 21 21 /** 22 * @var array 22 * @var array<mixed> 23 23 */ 24 protected $values;24 protected array $values; 25 25 26 26 /** 27 * @var array 27 * @var array<mixed> 28 28 */ 29 protected $lowercaseKeyMap;29 protected array $lowercaseKeyMap; 30 30 31 31 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/OrderPayload.php
r3812630 r3816018 26 26 * @var Payload 27 27 */ 28 protected $payload;28 protected Payload $payload; 29 29 30 30 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload.php
r3812630 r3816018 33 33 * @var DictionaryInterface 34 34 */ 35 protected $dictionary;35 protected DictionaryInterface $dictionary; 36 36 37 37 /** 38 38 * @var TypesInterface 39 39 */ 40 protected $types;40 protected TypesInterface $types; 41 41 42 42 /** 43 43 * @var ParcelsFactory 44 44 */ 45 protected $parcelsFactory;45 protected ParcelsFactory $parcelsFactory; 46 46 47 47 /** 48 48 * @var AddressFactory 49 49 */ 50 protected $addressFactory;50 protected AddressFactory $addressFactory; 51 51 52 52 /** 53 53 * @var ItemFactory 54 54 */ 55 protected $itemFactory;55 protected ItemFactory $itemFactory; 56 56 57 57 /** 58 58 * @var DimensionsFactory 59 59 */ 60 protected $dimensionsFactory;60 protected DimensionsFactory $dimensionsFactory; 61 61 62 62 /** 63 63 * @var WeightFactory 64 64 */ 65 protected $weightFactory;65 protected WeightFactory $weightFactory; 66 66 67 67 /** 68 68 * @var array<Parcel> 69 69 */ 70 protected $parcels;71 72 /** 73 * @var array<string, Item>74 */ 75 protected $itemsPerKey;70 protected ?array $parcels = null; 71 72 /** 73 * @var array<string,array<\OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\Payload\Item>> 74 */ 75 protected array $itemsPerKey; 76 76 77 77 /** 78 78 * @var array<string,Dimensions> 79 79 */ 80 protected $dimensionsPerKey;80 protected array $dimensionsPerKey; 81 81 82 82 /** 83 83 * @var array<string,Weight> 84 84 */ 85 protected $weightPerKey;86 87 /** 88 * @var array 89 */ 90 protected $addressesPerKey;85 protected array $weightPerKey; 86 87 /** 88 * @var array<mixed> 89 */ 90 protected array $addressesPerKey; 91 91 92 92 /** … … 291 291 * 292 292 * @param string $key 293 * @return array< Item>293 * @return array<\OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\Payload\Item> 294 294 */ 295 295 public function getItems(string $key): array … … 842 842 * returns COD amount 843 843 * 844 * @return string844 * @return float 845 845 */ 846 846 public function getCodAmount(): float -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Address.php
r3812630 r3816018 24 24 * @var DictionaryInterface 25 25 */ 26 private $dictionary;26 private DictionaryInterface $dictionary; 27 27 28 28 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Dimensions.php
r3812630 r3816018 22 22 { 23 23 /** 24 * @var Dictionary 24 * @var DictionaryInterface 25 25 */ 26 private $dictionary;26 private DictionaryInterface $dictionary; 27 27 28 28 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsArrayBuilder.php
r3812630 r3816018 26 26 * @var CollectionInterface 27 27 */ 28 private $dimensionUnits;28 private CollectionInterface $dimensionUnits; 29 29 30 30 /** 31 31 * @var DimensionConverter 32 32 */ 33 private $dimensionConverter;33 private DimensionConverter $dimensionConverter; 34 34 35 35 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsFactory.php
r3812630 r3816018 24 24 * @var DimensionsArrayBuilder 25 25 */ 26 private $dimensionsArrayBuilder;26 private DimensionsArrayBuilder $dimensionsArrayBuilder; 27 27 28 28 /** … … 40 40 * 41 41 * @param DictionaryInterface $dictionary 42 * @return Item42 * @return Dimensions 43 43 */ 44 44 public function create(DictionaryInterface $dictionary): Dimensions -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Item.php
r3812630 r3816018 23 23 { 24 24 /** 25 * @var Dictionary 26 */ 27 private $dictionary;25 * @var DictionaryInterface 26 */ 27 private DictionaryInterface $dictionary; 28 28 29 29 /** 30 30 * @var Dimensions 31 31 */ 32 private $dimensions;32 private ?Dimensions $dimensions = null; 33 33 34 34 /** 35 35 * @var Weight 36 36 */ 37 private $weight;37 private ?Weight $weight = null; 38 38 39 39 /** … … 100 100 101 101 /** 102 * returns manufacturer name 103 * 104 * @return string 105 */ 106 public function getManufacturerName(): string 107 { 108 return $this->dictionary->getString('manufacturer_name'); 109 } 110 111 /** 112 * returns manufacturer address line 1 113 * 114 * @return string 115 */ 116 public function getManufacturerAddress1(): string 117 { 118 return $this->dictionary->getString('manufacturer_address1'); 119 } 120 121 /** 122 * returns manufacturer city 123 * 124 * @return string 125 */ 126 public function getManufacturerCity(): string 127 { 128 return $this->dictionary->getString('manufacturer_city'); 129 } 130 131 /** 132 * returns manufacturer province/state code 133 * 134 * @return string 135 */ 136 public function getManufacturerProvinceCode(): string 137 { 138 return $this->dictionary->getString('manufacturer_province_code'); 139 } 140 141 /** 142 * returns manufacturer postal code 143 * 144 * @return string 145 */ 146 public function getManufacturerPostalCode(): string 147 { 148 return $this->dictionary->getString('manufacturer_postal_code'); 149 } 150 151 /** 152 * returns manufacturer country code 153 * 154 * @return string 155 */ 156 public function getManufacturerCountryCode(): string 157 { 158 return $this->dictionary->getString('manufacturer_country_code'); 159 } 160 161 /** 102 162 * returns country of origin 103 163 * … … 150 210 } 151 211 152 $this->dimensions = $this->dictionary->get('dimensions'); 153 if (false === ($this->dimensions instanceof Dimensions)) { 154 $this->dimensions = new Dimensions(new Dictionary([])); 155 } 212 $dimensions = $this->dictionary->get('dimensions'); 213 if (false === ($dimensions instanceof Dimensions)) { 214 $dimensions = new Dimensions(new Dictionary([])); 215 } 216 $this->dimensions = $dimensions; 156 217 157 218 return $this->dimensions; … … 169 230 } 170 231 171 $this->weight = $this->dictionary->get('weight'); 172 if (false === ($this->weight instanceof Weight)) { 173 $this->weight = new Weight(new Dictionary([])); 174 } 232 $weight = $this->dictionary->get('weight'); 233 if (false === ($weight instanceof Weight)) { 234 $weight = new Weight(new Dictionary([])); 235 } 236 $this->weight = $weight; 175 237 176 238 return $this->weight; -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ItemFactory.php
r3812630 r3816018 24 24 * @var DimensionsFactory 25 25 */ 26 private $dimensionsFactory;26 private DimensionsFactory $dimensionsFactory; 27 27 28 28 /** 29 29 * @var WeightFactory 30 30 */ 31 private $weightFactory;31 private WeightFactory $weightFactory; 32 32 33 33 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Parcel.php
r3812630 r3816018 25 25 * @var DictionaryInterface 26 26 */ 27 private $dictionary;27 private DictionaryInterface $dictionary; 28 28 29 29 /** 30 30 * @var array<Item> 31 31 */ 32 private $items;32 private ?array $items = null; 33 33 34 34 /** 35 35 * @var string 36 36 */ 37 private $freightClass;37 private ?string $freightClass = null; 38 38 39 39 /** 40 40 * @var Dimensions 41 41 */ 42 private $dimensions;42 private ?Dimensions $dimensions = null; 43 43 44 44 /** 45 45 * @var Weight 46 46 */ 47 private $weight;47 private ?Weight $weight = null; 48 48 49 49 /** … … 109 109 } 110 110 111 $this->dimensions = $this->dictionary->get('dimensions'); 112 if (false === ($this->dimensions instanceof Dimensions)) { 113 $this->dimensions = new Dimensions(new Dictionary([])); 114 } 111 $dimensions = $this->dictionary->get('dimensions'); 112 if (false === ($dimensions instanceof Dimensions)) { 113 $dimensions = new Dimensions(new Dictionary([])); 114 } 115 $this->dimensions = $dimensions; 115 116 116 117 return $this->dimensions; … … 128 129 } 129 130 130 $this->weight = $this->dictionary->get('weight'); 131 if (false === ($this->weight instanceof Weight)) { 132 $this->weight = new Weight(new Dictionary([])); 133 } 131 $weight = $this->dictionary->get('weight'); 132 if (false === ($weight instanceof Weight)) { 133 $weight = new Weight(new Dictionary([])); 134 } 135 $this->weight = $weight; 134 136 135 137 return $this->weight; -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelFactory.php
r3812630 r3816018 25 25 * @var TypesInterface 26 26 */ 27 private $types;27 private TypesInterface $types; 28 28 29 29 /** 30 30 * @var DimensionsFactory 31 31 */ 32 private $dimensionsFactory;32 private DimensionsFactory $dimensionsFactory; 33 33 34 34 /** 35 35 * @var WeightFactory 36 36 */ 37 private $weightFactory;37 private WeightFactory $weightFactory; 38 38 39 39 /** 40 40 * @var ItemFactory 41 41 */ 42 private $ItemFactory;42 private ItemFactory $ItemFactory; 43 43 44 44 /** … … 104 104 foreach ($items as $item) { 105 105 if ($this->isValidItemArray($item)) { 106 $newItems[] = $this->ItemFactory->create($dictionary->withArray($item) , $dictionary);106 $newItems[] = $this->ItemFactory->create($dictionary->withArray($item)); 107 107 } 108 108 } … … 119 119 private function isValidItemArray(array $item): bool 120 120 { 121 if (false === is_array($item)) {122 return false;123 }124 125 121 if (empty($item['name'])) { 126 122 return false; -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelsFactory.php
r3812630 r3816018 24 24 * @var ParcelFactory 25 25 */ 26 private $parcelFactory;26 private ParcelFactory $parcelFactory; 27 27 28 28 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Weight.php
r3812630 r3816018 22 22 { 23 23 /** 24 * @var Dictionary 24 * @var DictionaryInterface 25 25 */ 26 private $dictionary;26 private DictionaryInterface $dictionary; 27 27 28 28 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightArrayBuilder.php
r3812630 r3816018 26 26 * @var CollectionInterface 27 27 */ 28 private $weightUnits;28 private CollectionInterface $weightUnits; 29 29 30 30 /** 31 31 * @var WeightConverter 32 32 */ 33 private $weightConverter;33 private WeightConverter $weightConverter; 34 34 35 35 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightFactory.php
r3812630 r3816018 24 24 * @var WeightArrayBuilder 25 25 */ 26 private $weightArrayBuilder;26 private WeightArrayBuilder $weightArrayBuilder; 27 27 28 28 /** … … 40 40 * 41 41 * @param DictionaryInterface $dictionary 42 * @return Item42 * @return Weight 43 43 */ 44 44 public function create(DictionaryInterface $dictionary): Weight -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/PayloadFactory.php
r3812630 r3816018 26 26 { 27 27 /** 28 * @var Types 28 * @var TypesInterface 29 29 */ 30 protected $types;30 protected TypesInterface $types; 31 31 32 32 /** 33 33 * @var DictionaryFactory 34 34 */ 35 protected $dictionaryFactory;35 protected DictionaryFactory $dictionaryFactory; 36 36 37 37 /** 38 38 * @var ParcelsFactory 39 39 */ 40 protected $parcelsFactory;40 protected ParcelsFactory $parcelsFactory; 41 41 42 42 /** 43 43 * @var AddressFactory 44 44 */ 45 protected $addressFactory;45 protected AddressFactory $addressFactory; 46 46 47 47 /** 48 48 * @var ItemFactory 49 49 */ 50 protected $itemFactory;50 protected ItemFactory $itemFactory; 51 51 52 52 /** 53 53 * @var DimensionsFactory 54 54 */ 55 protected $dimensionsFactory;55 protected DimensionsFactory $dimensionsFactory; 56 56 57 57 /** 58 58 * @var WeightFactory 59 59 */ 60 protected $weightFactory;60 protected WeightFactory $weightFactory; 61 61 62 62 /** 63 63 * @var string 64 64 */ 65 protected $hash;65 protected string $hash; 66 66 67 67 /** 68 68 * @var Payload 69 69 */ 70 protected $instance;70 protected Payload $instance; 71 71 72 72 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Types.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $textDomain;25 26 /** 27 * @var Collection 28 */ 29 protected $carriers;30 31 /** 32 * @var Collection 33 */ 34 protected $contentTypes;35 36 /** 37 * @var Collection 38 */ 39 protected $currencies;40 41 /** 42 * @var Collection 43 */ 44 protected $services;45 46 /** 47 * @var Collection 48 */ 49 protected $packageTypes;50 51 /** 52 * @var Collection 53 */ 54 protected $orderStatuses;55 56 /** 57 * @var Collection 58 */ 59 protected $statuses;60 61 /** 62 * @var Collection 63 */ 64 protected $stores;65 66 /** 67 * @var Collection 68 */ 69 protected $warehouses;70 71 /** 72 * @var Collection 73 */ 74 protected $completedStatuses;75 76 /** 77 * @var Collection 78 */ 79 protected $dimensionUnits;80 81 /** 82 * @var Collection 83 */ 84 protected $weightUnits;85 86 /** 87 * @var Collection 88 */ 89 protected $labelFormats;90 91 /** 92 * @var Collection 93 */ 94 protected $signatureTypes;95 96 /** 97 * @var Collection 98 */ 99 protected $codMethods;24 protected string $textDomain; 25 26 /** 27 * @var CollectionInterface 28 */ 29 protected CollectionInterface $carriers; 30 31 /** 32 * @var CollectionInterface 33 */ 34 protected CollectionInterface $contentTypes; 35 36 /** 37 * @var CollectionInterface 38 */ 39 protected CollectionInterface $currencies; 40 41 /** 42 * @var CollectionInterface 43 */ 44 protected CollectionInterface $services; 45 46 /** 47 * @var CollectionInterface 48 */ 49 protected CollectionInterface $packageTypes; 50 51 /** 52 * @var CollectionInterface 53 */ 54 protected CollectionInterface $orderStatuses; 55 56 /** 57 * @var CollectionInterface 58 */ 59 protected CollectionInterface $statuses; 60 61 /** 62 * @var CollectionInterface 63 */ 64 protected CollectionInterface $stores; 65 66 /** 67 * @var CollectionInterface 68 */ 69 protected CollectionInterface $warehouses; 70 71 /** 72 * @var CollectionInterface 73 */ 74 protected CollectionInterface $completedStatuses; 75 76 /** 77 * @var CollectionInterface 78 */ 79 protected CollectionInterface $dimensionUnits; 80 81 /** 82 * @var CollectionInterface 83 */ 84 protected CollectionInterface $weightUnits; 85 86 /** 87 * @var CollectionInterface 88 */ 89 protected CollectionInterface $labelFormats; 90 91 /** 92 * @var CollectionInterface 93 */ 94 protected CollectionInterface $signatureTypes; 95 96 /** 97 * @var CollectionInterface 98 */ 99 protected CollectionInterface $codMethods; 100 100 101 101 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/BuyShipment.php
r3812630 r3816018 33 33 * @var ShipmentPayload 34 34 */ 35 private $shipmentPayload;36 37 /** 38 * @var array 39 */ 40 private $trackingUrls;35 private ShipmentPayload $shipmentPayload; 36 37 /** 38 * @var array<string, string> 39 */ 40 private array $trackingUrls; 41 41 42 42 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/CreateOrder.php
r3812630 r3816018 32 32 * @var OrderPayload 33 33 */ 34 private $orderPayload;34 private OrderPayload $orderPayload; 35 35 36 36 /** 37 37 * @var BuyShipment 38 38 */ 39 private $buyShipmentEndPoint;39 private BuyShipment $buyShipmentEndPoint; 40 40 41 41 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetOrder.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** 35 35 * @var CreateOrder 36 36 */ 37 private $createOrderEndPoint;37 private CreateOrder $createOrderEndPoint; 38 38 39 39 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetRates.php
r3812630 r3816018 32 32 * @var ShipmentPayload 33 33 */ 34 private $shipmentPayload;34 private ShipmentPayload $shipmentPayload; 35 35 36 36 /** 37 37 * @var RateFilter 38 38 */ 39 private $rateFilter;39 private RateFilter $rateFilter; 40 40 41 41 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetShipment.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** 35 35 * @var BuyShipment 36 36 */ 37 private $buyShipmentEndPoint;37 private BuyShipment $buyShipmentEndPoint; 38 38 39 39 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetShipments.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** 35 35 * @var BuyShipment 36 36 */ 37 private $buyShipmentEndPoint;37 private BuyShipment $buyShipmentEndPoint; 38 38 39 39 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/RateFilter/RateFilter.php
r3812630 r3816018 26 26 * @var LoggerInterface 27 27 */ 28 private $logger;28 private LoggerInterface $logger; 29 29 30 30 /** 31 31 * @var ServiceIdBuilder 32 32 */ 33 private $serviceIdBuilder;33 private ServiceIdBuilder $serviceIdBuilder; 34 34 35 35 /** 36 36 * @var CollectionInterface 37 37 */ 38 private $packageTypes;38 private CollectionInterface $packageTypes; 39 39 40 40 /** 41 41 * @var array<string,bool> 42 42 */ 43 private $carrierHasPackageTypeInServiceName;43 private array $carrierHasPackageTypeInServiceName; 44 44 45 45 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/RefundShipment.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/ApiKey.php
r3812630 r3816018 24 24 * @var Payload 25 25 */ 26 private $payload;26 private Payload $payload; 27 27 28 28 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/Builder/AddressBuilder.php
r3812630 r3816018 25 25 * @var EmptyToNull 26 26 */ 27 private $emptyToNull;27 private EmptyToNull $emptyToNull; 28 28 29 29 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedOrderOptionsBuilder.php
r3812630 r3816018 25 25 * @var EmptyToNull 26 26 */ 27 private $emptyToNull;27 private EmptyToNull $emptyToNull; 28 28 29 29 /** 30 30 * @var AdvancedShipmentOptionsBuilder 31 31 */ 32 private $advancedShipmentOptionsBuilder;32 private AdvancedShipmentOptionsBuilder $advancedShipmentOptionsBuilder; 33 33 34 34 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedShipmentOptionsBuilder.php
r3812630 r3816018 25 25 * @var EmptyToNull 26 26 */ 27 private $emptyToNull;27 private EmptyToNull $emptyToNull; 28 28 29 29 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/OrderPayload.php
r3812630 r3816018 31 31 * @var TypeOrderPayload 32 32 */ 33 private $orderPayload;33 private TypeOrderPayload $orderPayload; 34 34 35 35 /** 36 36 * @var AddressBuilder 37 37 */ 38 private $addressBuilder;38 private AddressBuilder $addressBuilder; 39 39 40 40 /** 41 41 * @var DimensionsBuilder 42 42 */ 43 private $dimensionsBuilder;43 private DimensionsBuilder $dimensionsBuilder; 44 44 45 45 /** 46 46 * @var WeightBuilder 47 47 */ 48 private $weightBuilder;48 private WeightBuilder $weightBuilder; 49 49 50 50 /** 51 51 * @var AdvancedOrderOptionsBuilder 52 52 */ 53 private $advancedOptionsBuilder;53 private AdvancedOrderOptionsBuilder $advancedOptionsBuilder; 54 54 55 55 /** 56 56 * @var EmptyToNull 57 57 */ 58 private $emptyToNull;58 private EmptyToNull $emptyToNull; 59 59 60 60 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/ShipmentPayload.php
r3812630 r3816018 37 37 * @var Payload 38 38 */ 39 protected $payload;39 protected Payload $payload; 40 40 41 41 /** 42 42 * @var AddressBuilder 43 43 */ 44 private $addressBuilder;44 private AddressBuilder $addressBuilder; 45 45 46 46 /** 47 47 * @var DimensionsBuilder 48 48 */ 49 private $dimensionsBuilder;49 private DimensionsBuilder $dimensionsBuilder; 50 50 51 51 /** 52 52 * @var WeightBuilder 53 53 */ 54 private $weightBuilder;54 private WeightBuilder $weightBuilder; 55 55 56 56 /** 57 57 * @var AdvancedShipmentOptionsBuilder 58 58 */ 59 private $advancedOptionsBuilder;59 private AdvancedShipmentOptionsBuilder $advancedOptionsBuilder; 60 60 61 61 /** 62 62 * @var EmptyToNull 63 63 */ 64 private $emptyToNull;64 private EmptyToNull $emptyToNull; 65 65 66 66 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/BuyShipment.php
r3812630 r3816018 32 32 * @var ShipmentPayload 33 33 */ 34 private $shipmentPayload;34 private ShipmentPayload $shipmentPayload; 35 35 36 36 /** 37 37 * @var ShipmentDataBuilder 38 38 */ 39 private $shipmentDataBuilder;39 private ShipmentDataBuilder $shipmentDataBuilder; 40 40 41 41 /** 42 42 * @var BuyShipmentResponseToShipmentTransformer 43 43 */ 44 private $buyShipmentResponseToShipmentTransformer;44 private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer; 45 45 46 46 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/CreateManifest.php
r3812630 r3816018 31 31 * @var ManifestResponseToManifestTransformer 32 32 */ 33 private $manifestTransformer;33 private ManifestResponseToManifestTransformer $manifestTransformer; 34 34 35 35 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/Executor/GetShipmentsExecutor.php
r3812630 r3816018 21 21 use OneTeamSoftware\Packages\GuzzleHttp\Promise\Utils; 22 22 use OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\Executor\Executor; 23 use Throwable; 23 24 24 25 /** … … 109 110 if ($result['state'] !== PromiseInterface::FULFILLED) { 110 111 $reason = $result['reason'] ?? null; 111 $message = $reason instanceof \Throwable ? $reason->getMessage() : (string) $reason;112 $message = $reason instanceof Throwable ? $reason->getMessage() : (string) $reason; 112 113 $this->logger->error(__FILE__, __LINE__, 'Failed to fetch shipment for index %d: %s', $index, $message); 113 114 continue; -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetManifest.php
r3812630 r3816018 30 30 * @var ManifestResponseToManifestTransformer 31 31 */ 32 private $manifestTransformer;32 private ManifestResponseToManifestTransformer $manifestTransformer; 33 33 34 34 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetRates.php
r3812630 r3816018 33 33 * @var ShipmentPayload 34 34 */ 35 private $shipmentPayload;35 private ShipmentPayload $shipmentPayload; 36 36 37 37 /** 38 38 * @var ServiceIdBuilder 39 39 */ 40 private $serviceIdBuilder;40 private ServiceIdBuilder $serviceIdBuilder; 41 41 42 42 /** 43 43 * @var ShipmentDataBuilder 44 44 */ 45 private $shipmentDataBuilder;45 private ShipmentDataBuilder $shipmentDataBuilder; 46 46 47 47 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipment.php
r3812630 r3816018 31 31 * @var ShipmentPayload 32 32 */ 33 private $shipmentPayload;33 private ShipmentPayload $shipmentPayload; 34 34 35 35 /** 36 36 * @var BuyShipmentResponseToShipmentTransformer 37 37 */ 38 private $buyShipmentResponseToShipmentTransformer;38 private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer; 39 39 40 40 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipmentByShipmentId.php
r3812630 r3816018 37 37 * @var string 38 38 */ 39 private $shipmentId;39 private string $shipmentId; 40 40 41 41 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipments.php
r3812630 r3816018 31 31 * @var ShipmentPayload 32 32 */ 33 private $shipmentPayload;33 private ShipmentPayload $shipmentPayload; 34 34 35 35 /** 36 36 * @var BuyShipmentResponseToShipmentTransformer 37 37 */ 38 private $buyShipmentResponseToShipmentTransformer;38 private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer; 39 39 40 40 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetTracking.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/RefundShipment.php
r3812630 r3816018 30 30 * @var ShipmentPayload 31 31 */ 32 private $shipmentPayload;32 private ShipmentPayload $shipmentPayload; 33 33 34 34 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/BuyShipmentResponseToShipmentTransformer.php
r3812630 r3816018 17 17 * @var LoggerInterface 18 18 */ 19 private $logger;19 private LoggerInterface $logger; 20 20 21 21 /** 22 22 * @var TypesInterface 23 23 */ 24 private $types;24 private TypesInterface $types; 25 25 26 26 /** 27 27 * @var ShipmentPayload 28 28 */ 29 private $shipmentPayload;30 31 /** 32 * @var array 33 */ 34 private $trackingUrls;29 private ShipmentPayload $shipmentPayload; 30 31 /** 32 * @var array<string, string> 33 */ 34 private array $trackingUrls; 35 35 36 36 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/ManifestResponseToManifestTransformer.php
r3812630 r3816018 12 12 * @var LoggerInterface 13 13 */ 14 private $logger;14 private LoggerInterface $logger; 15 15 16 16 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/ApiKey.php
r3812630 r3816018 24 24 * @var Payload 25 25 */ 26 private $payload;26 private Payload $payload; 27 27 28 28 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/Builder/AddressBuilder.php
r3812630 r3816018 25 25 * @var EmptyToNull 26 26 */ 27 private $emptyToNull;27 private EmptyToNull $emptyToNull; 28 28 29 29 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/Builder/AdvancedShipmentOptionsBuilder.php
r3812630 r3816018 29 29 * @var EmptyToNull 30 30 */ 31 private $emptyToNull;31 private EmptyToNull $emptyToNull; 32 32 33 33 /** 34 34 * @var WeightBuilder 35 35 */ 36 private $weightBuilder;36 private WeightBuilder $weightBuilder; 37 37 38 38 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/Builder/ShipmentDataBuilder.php
r3812630 r3816018 13 13 * @var ShipmentPayload 14 14 */ 15 private $shipmentPayload;15 private ShipmentPayload $shipmentPayload; 16 16 17 17 /** 18 18 * @var Payload 19 19 */ 20 private $payload;20 private Payload $payload; 21 21 22 22 /** -
wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/ShipmentPayload.php
r3812630 r3816018 49 49 * @var Payload 50 50 */ 51 protected $payload;51 protected Payload $payload; 52 52 53 53 /** 54 54 * @var TypesInterface 55 55 */ 56 protected $types;56 protected TypesInterface $types; 57 57 58 58 /** 59 59 * @var AddressBuilder 60 60 */ 61 private $addressBuilder;61 private AddressBuilder $addressBuilder; 62 62 63 63 /** 64 64 * @var DimensionsBuilder 65 65 */ 66 private $dimensionsBuilder;66 private DimensionsBuilder $dimensionsBuilder; 67 67 68 68 /** 69 69 * @var WeightBuilder 70 70 */ 71 private $weightBuilder;71 private WeightBuilder $weightBuilder; 72 72 73 73 /** 74 74 * @var AdvancedShipmentOptionsBuilder 75 75 */ 76 private $advancedOptionsBuilder;76 private AdvancedShipmentOptionsBuilder $advancedOptionsBuilder; 77 77 78 78 /** 79 79 * @var EmptyToNull 80 80 */ 81 private $emptyToNull;81 private EmptyToNull $emptyToNull; 82 82 83 83 /** … … 442 442 ] 443 443 ]; 444 $packages[] = array_filter($packageData, function($value) { return !is_null($value); }); 444 $packages[] = array_filter($packageData, function ($value) { 445 return !is_null($value); 446 }); 445 447 } 446 448 return $packages; … … 495 497 $packageCodes[] = $parcel->getType(); 496 498 } 497 return array_values(array_unique(array_filter($packageCodes, static fn($value) => $value !== null && $value !== ''))); // Return unique, non-empty codes 499 // Return unique, non-empty codes 500 return array_values(array_unique(array_filter( 501 $packageCodes, 502 static fn($value) => $value !== null && $value !== '' 503 ))); 498 504 } 499 505 -
wc-shipstation-shipping/trunk/includes/UnitConverter/DimensionConverter.php
r3812630 r3816018 22 22 * constructor 23 23 * 24 * @param string $defaultFromUnit24 * @param string|null $defaultFromUnit 25 25 */ 26 public function __construct( string $defaultFromUnit = null)26 public function __construct(?string $defaultFromUnit = null) 27 27 { 28 28 parent::__construct( -
wc-shipstation-shipping/trunk/includes/UnitConverter/UnitConverter.php
r3812630 r3816018 22 22 * @var string 23 23 */ 24 protected $defaultFromUnit;24 protected string $defaultFromUnit; 25 25 26 26 /** 27 * @var array 27 * @var array<mixed> 28 28 */ 29 protected $fromMultipliers;29 protected array $fromMultipliers; 30 30 31 31 /** 32 * @var array 32 * @var array<mixed> 33 33 */ 34 protected $toMultipliers;34 protected array $toMultipliers; 35 35 36 36 /** … … 39 39 * @param array $fromMultipliers 40 40 * @param array $toMultipliers 41 * @param string $defaultFromUnit41 * @param string|null $defaultFromUnit 42 42 */ 43 public function __construct(array $fromMultipliers, array $toMultipliers, string $defaultFromUnit = null)43 public function __construct(array $fromMultipliers, array $toMultipliers, ?string $defaultFromUnit = null) 44 44 { 45 45 $this->fromMultipliers = $fromMultipliers; … … 51 51 * converts a given value to a requested unit from a given unit 52 52 * 53 * The converted value is truncated (never rounded up) to two decimal places, 54 * see self::truncate() for the details. 55 * 53 56 * @param float $value 54 57 * @param string $toUnit 55 * @param string $fromUnit58 * @param string|null $fromUnit 56 59 * @return float 57 60 */ 58 public function convert(float $value, string $toUnit, string $fromUnit = null): float61 public function convert(float $value, string $toUnit, ?string $fromUnit = null): float 59 62 { 60 63 $toUnit = strtolower($toUnit); … … 73 76 } 74 77 75 return $value; 78 return $this->truncate($value); 79 } 80 81 /** 82 * truncates the given value to two decimal places without ever rounding it up 83 * 84 * Carriers enforce weight and dimension ceilings in the converted unit. A value 85 * that is rounded up can end up above the true value and the carrier then refuses 86 * to sell the service. For example 2 kg is 70.548 oz, which rounds to 70.55 oz and 87 * converts back to 2.000057 kg - over a 2 kg ceiling - and the carrier responds 88 * with HTTP 422 SHIPMENT.POSTAGE.FAILURE. 89 * 90 * A converted value is therefore never allowed to exceed the true value: it is 91 * truncated towards zero instead, which keeps it at or below the true value. 92 * 93 * Negative values are truncated towards zero as well, so that the magnitude of the 94 * result never exceeds the magnitude of the true value either. The sign is always 95 * preserved and a negative value is never silently turned into zero. 96 * 97 * @param float $value 98 * @return float 99 */ 100 protected function truncate(float $value): float 101 { 102 $truncated = floor(abs($value) * 100) / 100; 103 104 return $value < 0 ? -$truncated : $truncated; 76 105 } 77 106 } -
wc-shipstation-shipping/trunk/includes/UnitConverter/UnitConverterInterface.php
r3812630 r3816018 24 24 * @param float $value 25 25 * @param string $toUnit 26 * @param string $fromUnit26 * @param string|null $fromUnit 27 27 * @return float 28 28 */ 29 public function convert(float $value, string $toUnit, string $fromUnit = null): float;29 public function convert(float $value, string $toUnit, ?string $fromUnit = null): float; 30 30 } -
wc-shipstation-shipping/trunk/includes/UnitConverter/WeightConverter.php
r3812630 r3816018 22 22 * constructor 23 23 * 24 * @param string $defaultFromUnit24 * @param string|null $defaultFromUnit 25 25 */ 26 public function __construct( string $defaultFromUnit = null)26 public function __construct(?string $defaultFromUnit = null) 27 27 { 28 28 parent::__construct( … … 30 30 [ 31 31 'g' => 0.001, 32 'lbs' => 0.453592 ,33 'oz' => 0.0283495 ,32 'lbs' => 0.45359237, 33 'oz' => 0.028349523125, 34 34 ], 35 35 // from kg 36 36 [ 37 37 'g' => 1000, 38 'lbs' => 2.20462 ,39 'oz' => 35.27 4,38 'lbs' => 2.2046226218, 39 'oz' => 35.27396195, 40 40 ], 41 41 $defaultFromUnit -
wc-shipstation-shipping/trunk/includes/WP/Admin/Notices/Notices.php
r3812630 r3816018 19 19 class Notices 20 20 { 21 /** 22 * Library version. Consumers can detect a stale copy loaded by another 23 * plugin (the shared OneTeamSoftware\WP\Admin\Notices\Notices class is 24 * bundled independently per plugin and first-loaded wins) via 25 * defined(Notices::class . '::VERSION') plus version_compare before 26 * calling methods added in newer releases (e.g. enqueueAssets, added 27 * in 1.0.17). Pair with method_exists() guards at call sites. 28 */ 29 public const VERSION = '1.1.0'; 30 31 /** 32 * Handle the dismiss script is attached to; it has no file of its own. 33 */ 34 private const DISMISS_SCRIPT_HANDLE = 'oneteamsoftware-admin-notices-dismiss'; 35 36 /** 37 * Dismisses a notice through its own AJAX action and hides it. 38 * 39 * Delegated, so it covers every dismissible notice on the page, including 40 * one inserted later. The window flag keeps it bound once when several 41 * plugins (each bundling this class) print it. 42 */ 43 private const DISMISS_SCRIPT = 'if (!window.oneTeamSoftwareNoticeDismissBound) { 44 window.oneTeamSoftwareNoticeDismissBound = true; 45 jQuery(document).on("click", ".oneteamsoftware.notice .notice-dismiss[data-dismiss-action]", function() { 46 var dismissButton = jQuery(this); 47 jQuery.post(ajaxurl, {action: dismissButton.attr("data-dismiss-action"), nonce: dismissButton.attr("data-nonce")}).done(function() { 48 dismissButton.closest(".oneteamsoftware.notice").slideUp(); 49 }); 50 }); 51 }'; 52 21 53 /** 22 54 * @var bool … … 113 145 114 146 /** 115 * Enqueue notice assets (visual styling CSS + dismiss JS).116 *117 * @param string $pluginFile The main plugin file path (used for URL generation)118 * @param string $version Version string for cache busting119 * @param string $handlePrefix Optional prefix for asset handles120 * @return void121 */122 public static function enqueueAssets(string $pluginFile, string $version = '1.0.0', string $handlePrefix = 'oneteamsoftware'): void123 {124 if (self::$assetsEnqueued) {125 return;126 }127 128 // $pluginFile must be the consumer's main file path — __DIR__ here breaks inside phars.129 // Consumer plugins are expected to register oneteamsoftware/php-wp-asset-fallback,130 // which swaps .min ↔ unminified based on SCRIPT_DEBUG/WP_DEBUG.131 132 wp_register_style(133 $handlePrefix . '-notices',134 plugins_url('assets/css/Notices.min.css', $pluginFile),135 [],136 $version137 );138 wp_enqueue_style($handlePrefix . '-notices');139 140 wp_register_script(141 $handlePrefix . '-notice-dismisser',142 plugins_url('assets/js/NoticeDismisser.min.js', $pluginFile),143 ['jquery'],144 $version145 );146 wp_enqueue_script($handlePrefix . '-notice-dismisser');147 148 self::$assetsEnqueued = true;149 }150 151 /**152 147 * returns requested property 153 148 * … … 185 180 186 181 /** 182 * Enqueue notice assets (visual styling CSS + dismiss JS). 183 * 184 * @param string $pluginFile The main plugin file path (used for URL generation) 185 * @param string $version Version string for cache busting 186 * @param string $handlePrefix Optional prefix for asset handles 187 * @return void 188 */ 189 public static function enqueueAssets(string $pluginFile, string $version = '1.0.0', string $handlePrefix = 'oneteamsoftware'): void 190 { 191 if (self::$assetsEnqueued) { 192 return; 193 } 194 195 // $pluginFile must be the consumer's main file path — __DIR__ here breaks inside phars. 196 // Consumer plugins are expected to register oneteamsoftware/php-wp-asset-fallback, 197 // which swaps .min ↔ unminified based on SCRIPT_DEBUG/WP_DEBUG. 198 199 wp_register_style( 200 $handlePrefix . '-notices', 201 plugins_url('assets/css/Notices.min.css', $pluginFile), 202 [], 203 $version 204 ); 205 wp_enqueue_style($handlePrefix . '-notices'); 206 207 wp_register_script( 208 $handlePrefix . '-notice-dismisser', 209 plugins_url('assets/js/NoticeDismisser.min.js', $pluginFile), 210 ['jquery'], 211 $version, 212 true 213 ); 214 wp_enqueue_script($handlePrefix . '-notice-dismisser'); 215 216 self::$assetsEnqueued = true; 217 } 218 219 /** 187 220 * dismisses notice 188 221 * … … 191 224 public function dismiss(): void 192 225 { 193 if (wp_verify_nonce(sanitize_key($_REQUEST['nonce']), $this->dismissAction)) { 226 // Records the current user's own dismissal only (user meta), so any 227 // logged-in role may do it. 228 if (current_user_can('read') && wp_verify_nonce(sanitize_key(wp_unslash($_REQUEST['nonce'] ?? '')), $this->dismissAction)) { 194 229 $this->load(); 195 230 $this->dismissed = true; … … 219 254 220 255 /** 256 * replaces all notices with the given list (replaceNotices) 257 * 258 * Unlike add(), this is the CONDITION-notice lifecycle: a stateless caller 259 * recomputes the notice list on every request and replaces it wholesale, 260 * so a resolved condition simply stops supplying content and the notice 261 * disappears on the next display() without any explicit removal. Loads 262 * first, so a same-request replace is never clobbered by the transient 263 * state. 264 * 265 * @param array<int, string> $notices The notices to display, in order. 266 * @return void 267 */ 268 public function replaceNotices(array $notices): void 269 { 270 $this->load(); 271 272 $this->notices = $notices; 273 } 274 275 /** 221 276 * displays notice 222 277 * … … 268 323 269 324 if (false === empty($this->notices) || $this->displayWithoutNotices) { 270 set_transient($cacheKey, get_object_vars($this)); 271 272 // extra effort to save dismissed to work around cache 325 // The transient is shared by every user; dismissal is per user and 326 // lives only in user meta. Storing it here let any logged-in role 327 // (the dismiss nonce is printed wherever the notice shows) hide a 328 // notice from every administrator. 329 $sharedProperties = get_object_vars($this); 330 unset($sharedProperties['dismissed']); 331 set_transient($cacheKey, $sharedProperties); 332 273 333 if ($this->dismissed) { 274 334 update_user_meta(get_current_user_id(), $cacheKey . '_dismissed', true); … … 304 364 $properties = get_transient($cacheKey, null); 305 365 if (is_array($properties)) { 366 // Transients written before dismissal became per-user still carry 367 // a shared flag; ignore it. 368 unset($properties['dismissed']); 306 369 $this->setProperties($properties); 307 370 } … … 364 427 365 428 if ($this->permanent && $this->dismissible) { 366 echo '<button class="notice-dismiss" onclick="jQuery.post(ajaxurl, {action: \'' . esc_attr($this->dismissAction) . '\', nonce: \'' . esc_attr($nonce) . '\'}).done(function() { jQuery(\'#' . esc_attr($noticeBoxId) . '\').slideUp(); });">'; // phpcs:ignore429 echo '<button class="notice-dismiss" data-dismiss-action="' . esc_attr($this->dismissAction) . '" data-nonce="' . esc_attr($nonce) . '">'; 367 430 echo '<span class="screen-reader-text">'; 368 e cho_e('Dismiss', $this->id);431 esc_html_e('Dismiss', $this->id); 369 432 echo '</span>'; 370 433 echo '</button>'; 434 435 $this->addDismissScript(); 371 436 } 372 437 … … 385 450 echo '</div>'; 386 451 } 452 453 /** 454 * Adds the script that makes the dismiss button work 455 * 456 * On a normal page load it is queued for the footer. Notices rendered into 457 * an admin-ajax response never reach a footer, so there the script is 458 * printed right away, inside the fragment; jQuery runs it on insertion. 459 * It depends on nothing there, because the requesting page already has 460 * jQuery and printing a dependency would load it a second time. 461 * 462 * @return void 463 */ 464 private function addDismissScript(): void 465 { 466 if (wp_script_is(self::DISMISS_SCRIPT_HANDLE, 'enqueued')) { 467 return; 468 } 469 470 $isAjaxFragment = wp_doing_ajax(); 471 472 wp_register_script(self::DISMISS_SCRIPT_HANDLE, false, $isAjaxFragment ? [] : ['jquery'], self::VERSION, true); 473 wp_enqueue_script(self::DISMISS_SCRIPT_HANDLE); 474 wp_add_inline_script(self::DISMISS_SCRIPT_HANDLE, self::DISMISS_SCRIPT); 475 476 if ($isAjaxFragment) { 477 wp_print_scripts(self::DISMISS_SCRIPT_HANDLE); 478 } 479 } 387 480 } -
wc-shipstation-shipping/trunk/packages/guzzle/src/Handler/CurlFactory.php
r3812630 r3816018 179 179 } 180 180 self::assertFinalProxyOptionTypes($conf, $requiredMultiplex && 'https' !== $request->getUri()->getScheme()); 181 self::assertFinalProxiesSupported($request, $conf); 181 182 self::isolatePreProxyOnAffectedCurl($conf); 182 183 self::normalizeStringableProxyCredentialOptions($conf); … … 890 891 try { 891 892 $proxyUri = new Uri($proxyForParsing); 892 $redactedUserInfo = Psr7\Utils::redactUserInfo($proxyUri)->getUserInfo(); 893 if ($redactedUserInfo === $proxyUri->getUserInfo()) { 894 return $error; 893 // psr7 finds no userinfo behind a scheme with a plus sign. 894 if ($proxyUri->getUserInfo() !== '') { 895 $redactedUserInfo = Psr7\Utils::redactUserInfo($proxyUri)->getUserInfo(); 896 if ($redactedUserInfo === $proxyUri->getUserInfo()) { 897 return $error; 898 } 895 899 } 896 900 } catch (\InvalidArgumentException $e) { … … 950 954 } 951 955 throw new \InvalidArgumentException($name . ' must be a string.'); 956 } 957 } 958 } 959 /** 960 * @param array<int|string, mixed> $conf 961 */ 962 private static function assertFinalProxiesSupported(RequestInterface $request, array $conf): void 963 { 964 $proxies = [$conf[\CURLOPT_PROXY] ?? null]; 965 if (\defined('CURLOPT_PRE_PROXY')) { 966 $proxies[] = $conf[(int) \constant('CURLOPT_PRE_PROXY')] ?? null; 967 } 968 foreach ($proxies as $proxy) { 969 if (!\is_string($proxy) || $proxy === '') { 970 continue; 971 } 972 // libcurl 7.76.0-8.17.0 skips a proxy with undecodable credentials. 973 if (\preg_match('/%[01][0-9A-Fa-f]/', \substr($proxy, 0, (int) \strrpos($proxy, '@'))) !== 0) { 974 throw new RequestException('Proxy credentials must not contain percent-encoded control characters.', $request); 975 } 976 $remainder = \explode('://', $proxy, 2)[1] ?? $proxy; 977 $host = \explode('@', $remainder, 2)[1] ?? $remainder; 978 // libcurl before 7.65.0 uses the host after the first '@', or no proxy. 979 if ($host === '' || $host === '/' || $host === '[' || \strpos($host, ':') === 0 || \strpos($host, '[]') === 0 || \strpos($host, '@') !== \false) { 980 throw new RequestException('The proxy URL is malformed.', $request); 981 } 982 // libcurl 7.47.0-7.51.0 skips a proxy with a host of '.'. 983 if (\preg_match('#^\[?\.(?:[:/\]]|$)#D', $host) !== 0) { 984 throw new RequestException('The proxy URL is malformed.', $request); 985 } 986 // libcurl before 7.31.0 skips a proxy with an empty username. 987 if (\strpos($remainder, ':') === 0 && !CurlVersion::supportsProxyEmptyUsername()) { 988 throw new RequestException('Proxy URLs with an empty username are not supported by the installed libcurl; libcurl 7.31.0 or newer is required.', $request); 952 989 } 953 990 } -
wc-shipstation-shipping/trunk/packages/guzzle/src/Handler/CurlVersion.php
r3812630 r3816018 38 38 // plaintext HTTP proxy, and 7.50.2 through 7.51 reject it at connect time. 39 39 private const HTTPS_PROXY_VERSION = '7.52.0'; 40 // curl 7.31.0 started to strip proxy userinfo that has an empty username; 41 // older libcurl leaves it in place, finds no host, and skips the proxy. 42 private const PROXY_EMPTY_USERNAME_VERSION = '7.31.0'; 40 43 private const HANDLER_SHARING_VERSION = '7.35.0'; 41 44 private const SSL_SESSION_SHARING_VERSION = '8.6.0'; … … 122 125 return $versionInfo !== null && \version_compare($versionInfo['version'], self::HTTPS_PROXY_VERSION, '>=') && 0 !== ($httpsProxyFeature & $versionInfo['features']); 123 126 } 127 public static function supportsProxyEmptyUsername(): bool 128 { 129 $version = self::getVersion(); 130 return $version !== null && \version_compare($version, self::PROXY_EMPTY_USERNAME_VERSION, '>='); 131 } 124 132 public static function supportsNtlm(): bool 125 133 { -
wc-shipstation-shipping/trunk/packages/guzzle/src/Utils.php
r3812630 r3816018 732 732 if ($uri->getHost() !== $asciiHost) { 733 733 // Replace URI only if the ASCII version is different 734 $uri = $uri->withHost($asciiHost); 734 try { 735 $uri = $uri->withHost($asciiHost); 736 } catch (\InvalidArgumentException $e) { 737 // The conversion can map a character to a URI delimiter. 738 throw new InvalidArgumentException('IDN conversion failed', 0, $e); 739 } 735 740 } 736 741 } … … 756 761 { 757 762 if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) { 758 return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info); 763 // ICU can take quadratic time, and no valid name needs more bytes. 764 if (\strlen($domain) > 4096) { 765 return \false; 766 } 767 try { 768 return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info); 769 } catch (\IntlException $e) { 770 // With intl.use_exceptions, a label too long to encode throws. 771 return \false; 772 } 759 773 } 760 774 throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old'); -
wc-shipstation-shipping/trunk/packages/promises/src/Create.php
r3812630 r3816018 21 21 $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null; 22 22 $promise = new Promise($wfn, $cfn); 23 $value->then([$promise, 'resolve'], [$promise, 'reject']); 23 try { 24 $value->then([$promise, 'resolve'], [$promise, 'reject']); 25 } catch (\Throwable $e) { 26 if (State::isPending($promise)) { 27 // The thenable may still hold the callbacks. 28 $promise = new Promise(); 29 $promise->reject($e); 30 } 31 } 24 32 return $promise; 25 33 } -
wc-shipstation-shipping/trunk/packages/promises/src/FulfilledPromise.php
r3812630 r3816018 35 35 $value = $this->value; 36 36 $queue->add(static function () use ($p, $value, $onFulfilled): void { 37 if (State::isPending($p)){38 try{37 try { 38 if (State::isPending($p)) { 39 39 $p->resolve($onFulfilled($value)); 40 } catch (\Throwable $e) { 40 } 41 } catch (\Throwable $e) { 42 if (State::isPending($p)) { 41 43 $p->reject($e); 42 44 } -
wc-shipstation-shipping/trunk/packages/promises/src/Promise.php
r3812630 r3816018 18 18 private $waitFn; 19 19 private $waitList; 20 private $handlersBefore = []; 20 21 private $handlers = []; 21 22 /** … … 114 115 $this->result = $value; 115 116 $handlers = $this->handlers; 116 $this->handlers = null; 117 $before = $this->handlersBefore; 118 $this->handlers = $this->handlersBefore = null; 117 119 $this->waitList = $this->waitFn = null; 118 120 $this->cancelFn = null; 119 121 if (!$handlers) { 120 122 return; 123 } 124 if ($value instanceof Promise && State::isPending($value)) { 125 // We can just hand our handlers to the next promise. Merging would 126 // copy both lists every time, so only the shorter one is moved. 127 if ($value->handlers === []) { 128 $value->handlers = $handlers; 129 $value->handlersBefore = $before; 130 } elseif (count($value->handlers) + count($value->handlersBefore) < count($handlers) + count($before)) { 131 array_push($before, ...array_reverse($value->handlers), ...$value->handlersBefore); 132 $value->handlers = $handlers; 133 $value->handlersBefore = $before; 134 } else { 135 array_push($value->handlers, ...array_reverse($before), ...$handlers); 136 } 137 return; 138 } 139 if ($before) { 140 $handlers = array_merge(array_reverse($before), $handlers); 121 141 } 122 142 // If the value was not a settled promise or a thenable, then resolve … … 130 150 } 131 151 }); 132 } elseif ($value instanceof Promise && State::isPending($value)) {133 // We can just merge our handlers onto the next promise.134 $value->handlers = array_merge($value->handlers, $handlers);135 152 } else { 136 153 // Resolve the handlers when the forwarded promise is resolved. 137 $value->then(static function ($value) use ($handlers): void { 138 foreach ($handlers as $handler) { 139 self::callHandler(1, $value, $handler); 140 } 141 }, static function ($reason) use ($handlers): void { 142 foreach ($handlers as $handler) { 143 self::callHandler(2, $reason, $handler); 144 } 145 }); 154 try { 155 $value->then(static function ($value) use (&$handlers): void { 156 foreach ($handlers as $handler) { 157 self::callHandler(1, $value, $handler); 158 } 159 }, static function ($reason) use (&$handlers): void { 160 foreach ($handlers as $handler) { 161 self::callHandler(2, $reason, $handler); 162 } 163 }); 164 } catch (\Throwable $e) { 165 Utils::queue()->add(static function () use ($e, $handlers): void { 166 foreach ($handlers as $handler) { 167 self::callHandler(2, $e, $handler); 168 } 169 }); 170 // The thenable may still hold the callbacks. 171 $handlers = []; 172 } 146 173 } 147 174 } … … 181 208 } 182 209 } catch (\Throwable $reason) { 183 $promise->reject($reason); 210 // The handler may have settled the promise itself. 211 if (State::isPending($promise)) { 212 $promise->reject($reason); 213 } 184 214 } 185 215 } -
wc-shipstation-shipping/trunk/packages/promises/src/RejectedPromise.php
r3812630 r3816018 35 35 $p = new Promise([$queue, 'run']); 36 36 $queue->add(static function () use ($p, $reason, $onRejected): void { 37 if (State::isPending($p)){38 try{37 try { 38 if (State::isPending($p)) { 39 39 // Return a resolved promise if onRejected does not throw. 40 40 $p->resolve($onRejected($reason)); 41 } catch (\Throwable $e) { 42 // onRejected threw, so return a rejected promise. 41 } 42 } catch (\Throwable $e) { 43 // onRejected threw, so return a rejected promise. 44 if (State::isPending($p)) { 43 45 $p->reject($e); 44 46 } -
wc-shipstation-shipping/trunk/packages/promises/src/Utils.php
r3812630 r3816018 47 47 } 48 48 } catch (\Throwable $e) { 49 $promise->reject($e); 49 if (State::isPending($promise)) { 50 $promise->reject($e); 51 } 50 52 } 51 53 }); -
wc-shipstation-shipping/trunk/packages/psr7/src/AppendStream.php
r3812630 r3816018 137 137 } elseif ($whence !== \SEEK_SET) { 138 138 throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); 139 } elseif ($offset < 0) { 140 throw new \RuntimeException('The AppendStream cannot seek to a negative offset'); 139 141 } 140 142 $this->pos = $this->current = 0; -
wc-shipstation-shipping/trunk/packages/psr7/src/InflateStream.php
r3812630 r3816018 21 21 /** @var StreamInterface */ 22 22 private $stream; 23 /** @var StreamInterface|null */ 24 private $source; 23 25 public function __construct(StreamInterface $stream) 26 { 27 $this->source = $stream; 28 $inflated = self::inflate($stream); 29 $this->stream = $stream->isSeekable() ? $inflated : new NoSeekStream($inflated); 30 } 31 public function close(): void 32 { 33 $this->source = null; 34 $this->stream->close(); 35 } 36 public function detach() 37 { 38 $this->source = null; 39 return $this->stream->detach(); 40 } 41 public function seek($offset, $whence = \SEEK_SET): void 42 { 43 if (!\is_int($offset)) { 44 \trigger_deprecation('guzzlehttp/psr7', '2.11', 'Passing %s to StreamInterface::seek() is deprecated; guzzlehttp/psr7 3.0 requires int for $offset.', \get_debug_type($offset)); 45 } 46 if (!\is_int($whence)) { 47 \trigger_deprecation('guzzlehttp/psr7', '2.11', 'Passing %s to StreamInterface::seek() is deprecated; guzzlehttp/psr7 3.0 requires int for $whence.', \get_debug_type($whence)); 48 } 49 $this->stream->seek($offset, $whence); 50 if ($offset === 0 && $whence === \SEEK_SET && $this->source !== null) { 51 $this->stream = self::inflate($this->source); 52 } 53 } 54 private static function inflate(StreamInterface $stream): Stream 24 55 { 25 56 $resource = StreamWrapper::getResource($stream); … … 29 60 // Default window size is 15. 30 61 stream_filter_append($resource, 'zlib.inflate', \STREAM_FILTER_READ, ['window' => 15 + 32]); 31 $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource));62 return new Stream($resource); 32 63 } 33 64 } -
wc-shipstation-shipping/trunk/packages/psr7/src/Message.php
r3812630 r3816018 57 57 $body->rewind(); 58 58 $summary = $body->read($truncateAt); 59 if ($size > $truncateAt) { 59 $lookahead = $size === null ? $body->read(3) : ''; 60 if ($size > $truncateAt || $lookahead !== '') { 60 61 if (preg_match('//u', $summary) !== 1) { 61 $summary = self::trimTrailingIncompleteUtf8Character($summary, $ body->read(3));62 $summary = self::trimTrailingIncompleteUtf8Character($summary, $lookahead !== '' ? $lookahead : $body->read(3)); 62 63 } 63 64 $summary .= ' (truncated...)'; -
wc-shipstation-shipping/trunk/readme.txt
r3812630 r3816018 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.3 7 Stable tag: 1.4.2 17 Stable tag: 1.4.22 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 284 284 285 285 == Changelog == 286 = 1.4.22 = 287 * Fixed: PHP 8.4 deprecation notices in the error log 288 * Updated: bundled shared libraries to their latest releases 286 289 = 1.4.21 = 287 290 * Fixed: early translation notice in the error log -
wc-shipstation-shipping/trunk/vendor/composer/installed.json
r3812630 r3816018 197 197 { 198 198 "name": "guzzlehttp/guzzle", 199 "version": "7.16. 3",200 "version_normalized": "7.16. 3.0",199 "version": "7.16.5", 200 "version_normalized": "7.16.5.0", 201 201 "source": { 202 202 "type": "git", 203 203 "url": "https://github.com/guzzle/guzzle.git", 204 "reference": " c88a78082757dd5a0c44191651535259fcb6e605"205 }, 206 "dist": { 207 "type": "zip", 208 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ c88a78082757dd5a0c44191651535259fcb6e605",209 "reference": " c88a78082757dd5a0c44191651535259fcb6e605",204 "reference": "b0605f32e77a13cf98bc5e75b1d71877b6814e17" 205 }, 206 "dist": { 207 "type": "zip", 208 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b0605f32e77a13cf98bc5e75b1d71877b6814e17", 209 "reference": "b0605f32e77a13cf98bc5e75b1d71877b6814e17", 210 210 "shasum": "" 211 211 }, 212 212 "require": { 213 213 "ext-json": "*", 214 "guzzlehttp/promises": "^2.6 ",215 "guzzlehttp/psr7": "^2.13. 4",214 "guzzlehttp/promises": "^2.6.1", 215 "guzzlehttp/psr7": "^2.13.5", 216 216 "php": "^7.2.5 || ^8.0", 217 217 "psr/http-client": "^1.0", … … 236 236 "psr/log": "Required for using the Log middleware" 237 237 }, 238 "time": "2026-11- 17T16:23:09+00:00",238 "time": "2026-11-20T22:56:33+00:00", 239 239 "type": "library", 240 240 "extra": { … … 308 308 "support": { 309 309 "issues": "https://github.com/guzzle/guzzle/issues", 310 "source": "https://github.com/guzzle/guzzle/tree/7.16. 3"310 "source": "https://github.com/guzzle/guzzle/tree/7.16.5" 311 311 }, 312 312 "funding": [ … … 328 328 { 329 329 "name": "guzzlehttp/promises", 330 "version": "2.6. 0",331 "version_normalized": "2.6. 0.0",330 "version": "2.6.2", 331 "version_normalized": "2.6.2.0", 332 332 "source": { 333 333 "type": "git", 334 334 "url": "https://github.com/guzzle/promises.git", 335 "reference": " 3d88c829bd5f13d13847b39067dbf09a60af2154"336 }, 337 "dist": { 338 "type": "zip", 339 "url": "https://api.github.com/repos/guzzle/promises/zipball/ 3d88c829bd5f13d13847b39067dbf09a60af2154",340 "reference": " 3d88c829bd5f13d13847b39067dbf09a60af2154",335 "reference": "72e93ed2b1f3d8c09d1460c950bd5726face7ccd" 336 }, 337 "dist": { 338 "type": "zip", 339 "url": "https://api.github.com/repos/guzzle/promises/zipball/72e93ed2b1f3d8c09d1460c950bd5726face7ccd", 340 "reference": "72e93ed2b1f3d8c09d1460c950bd5726face7ccd", 341 341 "shasum": "" 342 342 }, … … 349 349 "phpunit/phpunit": "^8.5.52 || ^9.6.34" 350 350 }, 351 "time": "2026-1 0-18T12:46:59+00:00",351 "time": "2026-11-21T03:45:23+00:00", 352 352 "type": "library", 353 353 "extra": { … … 395 395 "support": { 396 396 "issues": "https://github.com/guzzle/promises/issues", 397 "source": "https://github.com/guzzle/promises/tree/2.6. 0"397 "source": "https://github.com/guzzle/promises/tree/2.6.2" 398 398 }, 399 399 "funding": [ … … 415 415 { 416 416 "name": "guzzlehttp/psr7", 417 "version": "2.13. 5",418 "version_normalized": "2.13. 5.0",417 "version": "2.13.6", 418 "version_normalized": "2.13.6.0", 419 419 "source": { 420 420 "type": "git", 421 421 "url": "https://github.com/guzzle/psr7.git", 422 "reference": " 5aa00c5418afbe3f435910af0e98cb03d659c49d"423 }, 424 "dist": { 425 "type": "zip", 426 "url": "https://api.github.com/repos/guzzle/psr7/zipball/ 5aa00c5418afbe3f435910af0e98cb03d659c49d",427 "reference": " 5aa00c5418afbe3f435910af0e98cb03d659c49d",422 "reference": "2bd3dccf56e99cdacf74b1ad5e06a08a5a7739f2" 423 }, 424 "dist": { 425 "type": "zip", 426 "url": "https://api.github.com/repos/guzzle/psr7/zipball/2bd3dccf56e99cdacf74b1ad5e06a08a5a7739f2", 427 "reference": "2bd3dccf56e99cdacf74b1ad5e06a08a5a7739f2", 428 428 "shasum": "" 429 429 }, … … 449 449 "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 450 450 }, 451 "time": "2026-11- 19T20:34:53+00:00",451 "time": "2026-11-21T23:48:40+00:00", 452 452 "type": "library", 453 453 "extra": { … … 517 517 "support": { 518 518 "issues": "https://github.com/guzzle/psr7/issues", 519 "source": "https://github.com/guzzle/psr7/tree/2.13. 5"519 "source": "https://github.com/guzzle/psr7/tree/2.13.6" 520 520 }, 521 521 "funding": [ … … 537 537 { 538 538 "name": "oneteamsoftware/php-arraymerger", 539 "version": "1.0. 0",540 "version_normalized": "1.0. 0.0",541 "dist": { 542 "type": "zip", 543 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-arraymerger/1.0. 0/php-arraymerger.zip",544 "shasum": " 709a603d765fe071b1e244f41d5a05fa24f362e2"539 "version": "1.0.1", 540 "version_normalized": "1.0.1.0", 541 "dist": { 542 "type": "zip", 543 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-arraymerger/1.0.1/php-arraymerger.zip", 544 "shasum": "3e478a2c2ced401557a70d3a7568a2b4b1120d57" 545 545 }, 546 546 "require-dev": { … … 626 626 { 627 627 "name": "oneteamsoftware/php-cache", 628 "version": "1.0. 0",629 "version_normalized": "1.0. 0.0",630 "dist": { 631 "type": "zip", 632 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-cache/1.0. 0/php-cache.zip",633 "shasum": " a17cfa07bdf6ea9bf59f55e2066dbfd0ddc999cb"634 }, 635 "require": { 636 "php": "^7. 3|| ^8.0"628 "version": "1.0.6", 629 "version_normalized": "1.0.6.0", 630 "dist": { 631 "type": "zip", 632 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-cache/1.0.6/php-cache.zip", 633 "shasum": "dcb831dc8b7bc076478e60bbf2e1f79220965b6d" 634 }, 635 "require": { 636 "php": "^7.4 || ^8.0" 637 637 }, 638 638 "require-dev": { … … 672 672 { 673 673 "name": "oneteamsoftware/php-classnamefinder", 674 "version": "1.0. 0",675 "version_normalized": "1.0. 0.0",676 "dist": { 677 "type": "zip", 678 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-classnamefinder/1.0. 0/php-classnamefinder.zip",679 "shasum": "5 1bbc8bcd2d1407136ea6a59ef3bb77cc497b514"680 }, 681 "require": { 682 "php": "^7. 3|| ^8.0"674 "version": "1.0.1", 675 "version_normalized": "1.0.1.0", 676 "dist": { 677 "type": "zip", 678 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-classnamefinder/1.0.1/php-classnamefinder.zip", 679 "shasum": "523e2c33f142957e909e148e861176dbdc4dd6c2" 680 }, 681 "require": { 682 "php": "^7.4 || ^8.0" 683 683 }, 684 684 "require-dev": { … … 760 760 { 761 761 "name": "oneteamsoftware/php-logger", 762 "version": "1.0. 0",763 "version_normalized": "1.0. 0.0",764 "dist": { 765 "type": "zip", 766 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-logger/1.0. 0/php-logger.zip",767 "shasum": " 15da97c9614a642cce01555779990ff8a621f2e3"768 }, 769 "require": { 770 "php": "^7. 3|| ^8.0"762 "version": "1.0.6", 763 "version_normalized": "1.0.6.0", 764 "dist": { 765 "type": "zip", 766 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-logger/1.0.6/php-logger.zip", 767 "shasum": "0d346e172f54f4660ecca07d1f08ffcd742854d8" 768 }, 769 "require": { 770 "php": "^7.4 || ^8.0" 771 771 }, 772 772 "require-dev": { … … 855 855 { 856 856 "name": "oneteamsoftware/php-shippingcarrier-abstractadapter", 857 "version": "1.0.1 3",858 "version_normalized": "1.0.1 3.0",859 "dist": { 860 "type": "zip", 861 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-shippingcarrier-abstractadapter/1.0.1 3/php-shippingcarrier-abstractadapter.zip",862 "shasum": " e63460e2ba9a9c9b9e5368e17bbae6520333f99a"857 "version": "1.0.18", 858 "version_normalized": "1.0.18.0", 859 "dist": { 860 "type": "zip", 861 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-shippingcarrier-abstractadapter/1.0.18/php-shippingcarrier-abstractadapter.zip", 862 "shasum": "40290295ae44616c0ba272b714d0e736d8eba952" 863 863 }, 864 864 "require": { … … 867 867 "dmitryrechkin/php-namingconverter": "^1.0", 868 868 "guzzlehttp/guzzle": "^7.0", 869 "oneteamsoftware/php-arraymerger": " 1.0.0",870 "oneteamsoftware/php-cache": " 1.0.0",871 "oneteamsoftware/php-classnamefinder": " 1.0.0",872 "oneteamsoftware/php-logger": " 1.0.0",873 "oneteamsoftware/php-unitconverter": " 1.0.0",874 "php": "^7. 3|| ^8.0"869 "oneteamsoftware/php-arraymerger": "^1.0.1", 870 "oneteamsoftware/php-cache": "^1.0.6", 871 "oneteamsoftware/php-classnamefinder": "^1.0.1", 872 "oneteamsoftware/php-logger": "^1.0.6", 873 "oneteamsoftware/php-unitconverter": "^1.0.5", 874 "php": "^7.4 || ^8.0" 875 875 }, 876 876 "require-dev": { 877 877 "dmitryrechkin/php-phpunit-bootstrap": "^1.0", 878 878 "dmitryrechkin/php-standard": "^1.0", 879 "humbug/php-scoper": " 0.17.5",879 "humbug/php-scoper": "^0.18.18", 880 880 "oneteamsoftware/php-scoper-configs": "~1.0.0" 881 881 }, … … 891 891 "OneTeamSoftware\\": "src/", 892 892 "OneTeamSoftware\\Tests\\": "tests/", 893 "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzle http/guzzle/src",894 "OneTeamSoftware\\Packages\\GuzzleHttp\\Promise\\": "packages/ guzzlehttp/promises/src",895 "OneTeamSoftware\\Packages\\GuzzleHttp\\Psr7\\": "packages/ guzzlehttp/psr7/src",893 "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzle/src", 894 "OneTeamSoftware\\Packages\\GuzzleHttp\\Promise\\": "packages/promises/src", 895 "OneTeamSoftware\\Packages\\GuzzleHttp\\Psr7\\": "packages/psr7/src", 896 896 "Psr\\Http\\Client\\": "vendor/psr/http-client/src", 897 897 "Psr\\Http\\Message\\": [ … … 901 901 } 902 902 }, 903 "scripts": { 904 "build-scoper": [ 905 "if [ -f vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh ]; then bash vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh guzzlehttp; else echo 'Skipping scoper (dev dependencies not installed)'; fi" 906 ], 907 "post-install-cmd": [ 908 "@build-scoper" 909 ], 910 "post-update-cmd": [ 911 "@build-scoper" 912 ] 913 }, 903 914 "license": [ 904 915 "GPL-2.0-or-later" … … 916 927 { 917 928 "name": "oneteamsoftware/php-shippingcarrier-shipstation", 918 "version": "2.0.1 1",919 "version_normalized": "2.0.1 1.0",920 "dist": { 921 "type": "zip", 922 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-shippingcarrier-shipstation/2.0.1 1/php-shippingcarrier-shipstation.zip",923 "shasum": " 5eddafa533437304d936626dc7237da284b534ad"924 }, 925 "require": { 926 "oneteamsoftware/php-shippingcarrier-abstractadapter": " 1.0.13",929 "version": "2.0.12", 930 "version_normalized": "2.0.12.0", 931 "dist": { 932 "type": "zip", 933 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-shippingcarrier-shipstation/2.0.12/php-shippingcarrier-shipstation.zip", 934 "shasum": "b9993283ef1b54880b955f3022223fafe024c798" 935 }, 936 "require": { 937 "oneteamsoftware/php-shippingcarrier-abstractadapter": "^1.0.18", 927 938 "php": ">=7.4" 928 939 }, 929 940 "require-dev": { 930 941 "dmitryrechkin/php-phpunit-bootstrap": "^1.0", 931 "dmitryrechkin/php-standard": "^1. 1.1",932 "humbug/php-scoper": " 0.17.5",933 "oneteamsoftware/php-scoper-configs": " ~1.0.0",942 "dmitryrechkin/php-standard": "^1.0", 943 "humbug/php-scoper": "^0.18.18", 944 "oneteamsoftware/php-scoper-configs": "dev-main", 934 945 "oneteamsoftware/php-shippingcarrier-tests": "1.0.1", 935 "phpstan/extension-installer": "^1.4", 936 "phpstan/phpstan": "^2.0", 937 "phpstan/phpstan-strict-rules": "^2.0" 946 "phpunit/phpunit": "^9.6", 947 "vlucas/phpdotenv": "^5.6" 938 948 }, 939 949 "type": "php-shippingcarrier-shipstation", … … 947 957 "psr-4": { 948 958 "OneTeamSoftware\\": "src/", 949 "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzle http/guzzle/src",950 "OneTeamSoftware\\Packages\\GuzzleHttp\\Promise\\": "packages/ guzzlehttp/promises/src",951 "OneTeamSoftware\\Packages\\GuzzleHttp\\Psr7\\": "packages/ guzzlehttp/psr7/src"959 "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzle/src", 960 "OneTeamSoftware\\Packages\\GuzzleHttp\\Promise\\": "packages/promises/src", 961 "OneTeamSoftware\\Packages\\GuzzleHttp\\Psr7\\": "packages/psr7/src" 952 962 } 953 963 }, … … 958 968 }, 959 969 "scripts": { 970 "test": [ 971 "phpunit" 972 ], 973 "stan": [ 974 "phpstan analyse" 975 ], 976 "cs": [ 977 "phpcs" 978 ], 960 979 "post-update-cmd": [ 961 980 "mkdir -p tests/Unit", 962 981 "cp -r vendor/oneteamsoftware/php-shippingcarrier-abstractadapter/tests/Unit/* tests/Unit/", 963 "cp -r vendor/oneteamsoftware/php-shippingcarrier-tests/tests/Unit/* tests/Unit/" 982 "cp -r vendor/oneteamsoftware/php-shippingcarrier-tests/tests/Unit/* tests/Unit/", 983 "[ -f vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh ] && composer build-scoper || echo 'Skipping scoper (dev dependencies not installed)'" 984 ], 985 "build-scoper": [ 986 "bash vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh guzzlehttp" 987 ], 988 "post-install-cmd": [ 989 "mkdir -p tests/Unit", 990 "cp -r vendor/oneteamsoftware/php-shippingcarrier-abstractadapter/tests/Unit/* tests/Unit/", 991 "cp -r vendor/oneteamsoftware/php-shippingcarrier-tests/tests/Unit/* tests/Unit/", 992 "[ -f vendor/oneteamsoftware/php-scoper-configs/php-scoper.sh ] && composer build-scoper || echo 'Skipping scoper (dev dependencies not installed)'" 964 993 ] 965 994 }, … … 975 1004 ], 976 1005 "description": "ShipStation shipping carrier adapter", 1006 "keywords": [ 1007 "carrier", 1008 "logistics", 1009 "shipping", 1010 "shipstation" 1011 ], 977 1012 "install-path": "../oneteamsoftware/php-shippingcarrier-shipstation" 978 1013 }, 979 1014 { 980 1015 "name": "oneteamsoftware/php-unitconverter", 981 "version": "1.0. 0",982 "version_normalized": "1.0. 0.0",983 "dist": { 984 "type": "zip", 985 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-unitconverter/1.0. 0/php-unitconverter.zip",986 "shasum": " ec19abed6d0c22929c5c415cc392ed4b60b4345b"987 }, 988 "require": { 989 "php": "^7. 3|| ^8.0"1016 "version": "1.0.5", 1017 "version_normalized": "1.0.5.0", 1018 "dist": { 1019 "type": "zip", 1020 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-unitconverter/1.0.5/php-unitconverter.zip", 1021 "shasum": "7e36a579d3b23a44136d488366599db19e30e5d3" 1022 }, 1023 "require": { 1024 "php": "^7.4 || ^8.0" 990 1025 }, 991 1026 "require-dev": { … … 1007 1042 "autoload-dev": { 1008 1043 "psr-4": { 1009 " DmitryRechkin\\Tests\\": "tests/"1044 "OneTeamSoftware\\Tests\\": "tests/" 1010 1045 } 1011 1046 }, … … 1168 1203 { 1169 1204 "name": "oneteamsoftware/php-wc-shipping", 1170 "version": "1.0.7 1",1171 "version_normalized": "1.0.7 1.0",1172 "dist": { 1173 "type": "zip", 1174 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-wc-shipping/1.0.7 1/php-wc-shipping.zip",1175 "shasum": " 164c41c2ec707fd3ec7c368fe66b8f01bcd086a2"1176 }, 1177 "require": { 1178 "oneteamsoftware/php-lazyclassproxy": " ~1.0.0",1179 "oneteamsoftware/php-parcel": " ~1.0.0",1180 "oneteamsoftware/php-shippingcarrier-abstractadapter": " ~1.0.0",1205 "version": "1.0.72", 1206 "version_normalized": "1.0.72.0", 1207 "dist": { 1208 "type": "zip", 1209 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-wc-shipping/1.0.72/php-wc-shipping.zip", 1210 "shasum": "4eb0e3bb1b7e33680e95587a3da861c1d6c7bec6" 1211 }, 1212 "require": { 1213 "oneteamsoftware/php-lazyclassproxy": "^1.0.0", 1214 "oneteamsoftware/php-parcel": "^1.0.0", 1215 "oneteamsoftware/php-shippingcarrier-abstractadapter": "^1.0.0", 1181 1216 "oneteamsoftware/php-unitconverter": "^1.0.0", 1182 "oneteamsoftware/php-wc-admin-logexporter": " ~1.0.0",1183 "oneteamsoftware/php-wc-logger": " ~1.0.0",1184 "oneteamsoftware/php-wc-parcel": " ~1.1.0",1185 "oneteamsoftware/php-wp-accordion-form-enhancer": " ~1.0.0",1186 "oneteamsoftware/php-wp-admin-notices": " ~1.0.0",1187 "oneteamsoftware/php-wp-admin-oneteamsoftware": " ~1.1.0",1188 "oneteamsoftware/php-wp-asset-fallback": " ~1.0.0",1189 "oneteamsoftware/php-wp-cache-storage": " ~1.0.0",1190 "oneteamsoftware/php-wp-form-save-validator": " ~1.0.0",1191 "oneteamsoftware/php-wp-form-section-validator": " ~1.0.0",1192 "oneteamsoftware/php-wp-oneteamsoftware-autoloader": " ~1.0.0",1217 "oneteamsoftware/php-wc-admin-logexporter": "^1.0.0", 1218 "oneteamsoftware/php-wc-logger": "^1.0.0", 1219 "oneteamsoftware/php-wc-parcel": "^1.1.0", 1220 "oneteamsoftware/php-wp-accordion-form-enhancer": "^1.0.0", 1221 "oneteamsoftware/php-wp-admin-notices": "^1.0.17", 1222 "oneteamsoftware/php-wp-admin-oneteamsoftware": "^1.1.0", 1223 "oneteamsoftware/php-wp-asset-fallback": "^1.0.0", 1224 "oneteamsoftware/php-wp-cache-storage": "^1.0.0", 1225 "oneteamsoftware/php-wp-form-save-validator": "^1.0.0", 1226 "oneteamsoftware/php-wp-form-section-validator": "^1.0.0", 1227 "oneteamsoftware/php-wp-oneteamsoftware-autoloader": "^1.0.0", 1193 1228 "php": "^7.4 || ^8.0" 1194 1229 }, … … 1284 1319 { 1285 1320 "name": "oneteamsoftware/php-wp-admin-notices", 1286 "version": "1. 0.17",1287 "version_normalized": "1. 0.17.0",1288 "dist": { 1289 "type": "zip", 1290 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-wp-admin-notices/1. 0.17/php-wp-admin-notices.zip",1291 "shasum": " 3e5b1df3bf9b71c1c9b054fc37ff0387a00d5f3f"1321 "version": "1.1.1", 1322 "version_normalized": "1.1.1.0", 1323 "dist": { 1324 "type": "zip", 1325 "url": "https://pve-200-gitlab.tailfff0bf.ts.net/api/v4/projects/5/packages/generic/php-wp-admin-notices/1.1.1/php-wp-admin-notices.zip", 1326 "shasum": "bbbe14f224a00931dae270131cd6fe58f4e3d98c" 1292 1327 }, 1293 1328 "require": { -
wc-shipstation-shipping/trunk/vendor/composer/installed.php
r3812630 r3816018 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' e3f83e1e6f5b2031a5c249a30d3b7479817a0a57',6 'reference' => 'c5882ba81266602291b1c0e66d97745055fab65a', 7 7 'type' => 'wc-shipstation-shipping', 8 8 'install_path' => __DIR__ . '/../../', … … 50 50 ), 51 51 'guzzlehttp/guzzle' => array( 52 'pretty_version' => '7.16. 3',53 'version' => '7.16. 3.0',54 'reference' => ' c88a78082757dd5a0c44191651535259fcb6e605',52 'pretty_version' => '7.16.5', 53 'version' => '7.16.5.0', 54 'reference' => 'b0605f32e77a13cf98bc5e75b1d71877b6814e17', 55 55 'type' => 'library', 56 56 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', … … 59 59 ), 60 60 'guzzlehttp/promises' => array( 61 'pretty_version' => '2.6. 0',62 'version' => '2.6. 0.0',63 'reference' => ' 3d88c829bd5f13d13847b39067dbf09a60af2154',61 'pretty_version' => '2.6.2', 62 'version' => '2.6.2.0', 63 'reference' => '72e93ed2b1f3d8c09d1460c950bd5726face7ccd', 64 64 'type' => 'library', 65 65 'install_path' => __DIR__ . '/../guzzlehttp/promises', … … 68 68 ), 69 69 'guzzlehttp/psr7' => array( 70 'pretty_version' => '2.13. 5',71 'version' => '2.13. 5.0',72 'reference' => ' 5aa00c5418afbe3f435910af0e98cb03d659c49d',70 'pretty_version' => '2.13.6', 71 'version' => '2.13.6.0', 72 'reference' => '2bd3dccf56e99cdacf74b1ad5e06a08a5a7739f2', 73 73 'type' => 'library', 74 74 'install_path' => __DIR__ . '/../guzzlehttp/psr7', … … 77 77 ), 78 78 'oneteamsoftware/php-arraymerger' => array( 79 'pretty_version' => '1.0. 0',80 'version' => '1.0. 0.0',79 'pretty_version' => '1.0.1', 80 'version' => '1.0.1.0', 81 81 'reference' => null, 82 82 'type' => 'php-arraymerger', … … 95 95 ), 96 96 'oneteamsoftware/php-cache' => array( 97 'pretty_version' => '1.0. 0',98 'version' => '1.0. 0.0',97 'pretty_version' => '1.0.6', 98 'version' => '1.0.6.0', 99 99 'reference' => null, 100 100 'type' => 'php-cache', … … 104 104 ), 105 105 'oneteamsoftware/php-classnamefinder' => array( 106 'pretty_version' => '1.0. 0',107 'version' => '1.0. 0.0',106 'pretty_version' => '1.0.1', 107 'version' => '1.0.1.0', 108 108 'reference' => null, 109 109 'type' => 'php-classnamefinder', … … 122 122 ), 123 123 'oneteamsoftware/php-logger' => array( 124 'pretty_version' => '1.0. 0',125 'version' => '1.0. 0.0',124 'pretty_version' => '1.0.6', 125 'version' => '1.0.6.0', 126 126 'reference' => null, 127 127 'type' => 'php-logger', … … 140 140 ), 141 141 'oneteamsoftware/php-shippingcarrier-abstractadapter' => array( 142 'pretty_version' => '1.0.1 3',143 'version' => '1.0.1 3.0',142 'pretty_version' => '1.0.18', 143 'version' => '1.0.18.0', 144 144 'reference' => null, 145 145 'type' => 'php-shippingcarrier-abstractadapter', … … 149 149 ), 150 150 'oneteamsoftware/php-shippingcarrier-shipstation' => array( 151 'pretty_version' => '2.0.1 1',152 'version' => '2.0.1 1.0',151 'pretty_version' => '2.0.12', 152 'version' => '2.0.12.0', 153 153 'reference' => null, 154 154 'type' => 'php-shippingcarrier-shipstation', … … 158 158 ), 159 159 'oneteamsoftware/php-unitconverter' => array( 160 'pretty_version' => '1.0. 0',161 'version' => '1.0. 0.0',160 'pretty_version' => '1.0.5', 161 'version' => '1.0.5.0', 162 162 'reference' => null, 163 163 'type' => 'php-unitconverter', … … 194 194 ), 195 195 'oneteamsoftware/php-wc-shipping' => array( 196 'pretty_version' => '1.0.7 1',197 'version' => '1.0.7 1.0',196 'pretty_version' => '1.0.72', 197 'version' => '1.0.72.0', 198 198 'reference' => null, 199 199 'type' => 'php-wc-shipping', … … 212 212 ), 213 213 'oneteamsoftware/php-wp-admin-notices' => array( 214 'pretty_version' => '1. 0.17',215 'version' => '1. 0.17.0',214 'pretty_version' => '1.1.1', 215 'version' => '1.1.1.0', 216 216 'reference' => null, 217 217 'type' => 'php-wp-admin-notices', … … 295 295 'pretty_version' => 'dev-main', 296 296 'version' => 'dev-main', 297 'reference' => ' e3f83e1e6f5b2031a5c249a30d3b7479817a0a57',297 'reference' => 'c5882ba81266602291b1c0e66d97745055fab65a', 298 298 'type' => 'wc-shipstation-shipping', 299 299 'install_path' => __DIR__ . '/../../', -
wc-shipstation-shipping/trunk/wc-shipstation-shipping.php
r3812630 r3816018 5 5 * Plugin URI: https://wordpress.org/plugins/wc-shipstation-shipping/ 6 6 * Description: Displays live ShipStation shipping rates at cart and checkout pages 7 * Version: 1.4.2 17 * Version: 1.4.22 8 8 * Tested up to: 7.0 9 9 * Requires PHP: 7.4 … … 26 26 defined('ABSPATH') || exit; 27 27 28 // Shipping framework: 1.0.7 128 // Shipping framework: 1.0.72 29 29 // The exact release of the shared framework this plugin bundles. Another carrier 30 30 // plugin reads this line to tell whether the copy WordPress actually loaded is the … … 81 81 __('Do you like our plugin and can recommend to others?', 'wc-shipstation-shipping') 82 82 ), 83 '1.4.2 1',83 '1.4.22', 84 84 static function (): void { 85 85 // phpcs:ignore PSR1.Classes.ClassDeclaration.MissingNamespace, Squiz.Classes.ValidClassName.NotCamelCaps -- Plugin::getShippingMethods() resolves this class as 'ShippingMethod_' . str_replace('-', '_', $id); renaming it stops the method registering.
Note:
See TracChangeset
for help on using the changeset viewer.