Plugin Directory

Changeset 3816018


Ignore:
Timestamp:
11/22/2026 01:50:23 AM (less than one hour ago)
Author:
oneteamsoftware
Message:

Release 1.4.22

Location:
wc-shipstation-shipping
Files:
8 added
200 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wc-shipstation-shipping/tags/1.4.22/includes/Cache/Cache.php

    r3812630 r3816018  
    2222         * @var Storage\StorageInterface
    2323         */
    24         private $storage;
     24        private Storage\StorageInterface $storage;
    2525
    2626        /**
    2727         * @var bool
    2828         */
    29         private $useCache;
     29        private bool $useCache;
    3030
    3131        /**
    3232         * @var int
    3333         */
    34         private $defaultExpiresAfter;
     34        private int $defaultExpiresAfter;
    3535
    3636        /**
    … …  
    8484         *
    8585         * @param string $key
    86          * @return true
     86         * @return bool
    8787         */
    8888        public function has(string $key): bool
  • wc-shipstation-shipping/tags/1.4.22/includes/Cache/KeyGenerator.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    24         protected $suffix;
     24        protected string $suffix;
    2525
    2626        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/Cache/Storage/TmpFile.php

    r3812630 r3816018  
    1919class TmpFile implements StorageInterface
    2020{
    21         /**
    22          * @var string
    23          */
    24         private $basePath;
     21        private string $basePath;
    2522
    2623        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ClassNameFinder/ClassNameFinder.php

    r3812630 r3816018  
    2020{
    2121        /**
    22          * @var array
     22         * @var array<mixed>
    2323         */
    24         private $baseClassPaths;
     24        private array $baseClassPaths = [];
    2525
    2626        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/Logger/EchoLogger.php

    r3812630 r3816018  
    3131        public function log(string $level, string $file, int $line, string $message, ...$args): void
    3232        {
    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);
    3438        }
    3539}
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/AbstractEndPoint.php

    r3812630 r3816018  
    2828         * @var CacheInterface
    2929         */
    30         protected $cache;
     30        protected CacheInterface $cache;
    3131
    3232        /**
    3333         * @var Payload
    3434         */
    35         protected $payload;
     35        protected Payload $payload;
    3636
    3737        /**
    3838         * @var KeyGeneratorInterface
    3939         */
    40         protected $keyGenerator;
     40        protected KeyGeneratorInterface $keyGenerator;
    4141
    4242        /**
    4343         * @var LoggerInterface
    4444         */
    45         protected $logger;
     45        protected LoggerInterface $logger;
    4646
    4747        /**
    4848         * @var string
    4949         */
    50         protected $textDomain;
     50        protected string $textDomain;
    5151
    5252        /**
    5353         * @var TypesInterface
    5454         */
    55         protected $types;
     55        protected TypesInterface $types;
    5656
    5757        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/EndPointFactory.php

    r3812630 r3816018  
    2929         * @var string
    3030         */
    31         private $textDomain;
     31        private string $textDomain;
    3232
    3333        /**
    3434         * @var LoggerInterface
    3535         */
    36         private $logger;
     36        private LoggerInterface $logger;
    3737
    3838        /**
    3939         * @var TypesInterface
    4040         */
    41         private $types;
     41        private TypesInterface $types;
    4242
    4343        /**
    4444         * @var KeyGeneratorInterface
    4545         */
    46         private $keyGenerator;
     46        private KeyGeneratorInterface $keyGenerator;
    4747
    4848        /**
    4949         * @var CacheInterface
    5050         */
    51         private $cache;
     51        private CacheInterface $cache;
    5252
    5353        /**
    5454         * @var ClassNameFinder
    5555         */
    56         private $classNameFinder;
     56        private ClassNameFinder $classNameFinder;
    5757
    5858        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/AbstractExecutor.php

    r3812630 r3816018  
    2929         * @var LoggerInterface
    3030         */
    31         protected $logger;
     31        protected LoggerInterface $logger;
    3232
    3333        /**
    3434         * @var RequestExecutorInterface
    3535         */
    36         protected $requestExecutor;
     36        protected RequestExecutorInterface $requestExecutor;
    3737
    3838        /**
    3939         * @var EndPointFactoryInterface
    4040         */
    41         protected $endPointFactory;
     41        protected EndPointFactoryInterface $endPointFactory;
    4242
    4343        /**
    4444         * @var PayloadFactoryInterface
    4545         */
    46         protected $payloadFactory;
     46        protected PayloadFactoryInterface $payloadFactory;
    4747
    4848        /**
    4949         * @var FeaturesInterface
    5050         */
    51         protected $features;
     51        protected FeaturesInterface $features;
    5252
    5353        /**
    5454         * @var TypesInterface
    5555         */
    56         protected $types;
     56        protected TypesInterface $types;
    5757
    5858        /**
    5959         * @var string
    6060         */
    61         protected $endPointName;
     61        protected string $endPointName;
    6262
    6363        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorFactory.php

    r3812630 r3816018  
    1717namespace OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\Executor;
    1818
     19use OneTeamSoftware\Cache\CacheInterface;
    1920use OneTeamSoftware\ClassNameFinder\ClassNameFinder;
    2021use OneTeamSoftware\Logger\LoggerInterface;
    … …  
    2425use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\PayloadFactoryInterface;
    2526use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\TypesInterface;
     27use ReflectionException;
     28use ReflectionMethod;
     29use ReflectionNamedType;
    2630
    2731class ExecutorFactory implements ExecutorFactoryInterface
    … …  
    3034         * @var LoggerInterface
    3135         */
    32         protected $logger;
     36        protected LoggerInterface $logger;
    3337
    3438        /**
    3539         * @var RequestExecutorInterface
    3640         */
    37         protected $requestExecutor;
     41        protected RequestExecutorInterface $requestExecutor;
    3842
    3943        /**
    4044         * @var EndPointFactoryInterface
    4145         */
    42         protected $endPointFactory;
     46        protected EndPointFactoryInterface $endPointFactory;
    4347
    4448        /**
    4549         * @var PayloadFactoryInterface
    4650         */
    47         protected $payloadFactory;
     51        protected PayloadFactoryInterface $payloadFactory;
    4852
    4953        /**
    5054         * @var FeaturesInterface
    5155         */
    52         protected $features;
     56        protected FeaturesInterface $features;
    5357
    5458        /**
    5559         * @var TypesInterface
    5660         */
    57         protected $types;
     61        protected TypesInterface $types;
    5862
    5963        /**
    6064         * @var ClassNameFinder
    6165         */
    62         protected $classNameFinder;
     66        protected ClassNameFinder $classNameFinder;
    6367
    6468        /**
    6569         * @var array<string,ExecutorInterface>
    6670         */
    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;
    6880
    6981        /**
    … …  
    7789         * @param PayloadFactoryInterface $payloadFactory
    7890         * @param ClassNameFinder $classNameFinder
     91         * @param CacheInterface|null $cache Optional cache for executors that cache tokens/responses
    7992         */
    8093        public function __construct(
    … …  
    8598                EndPointFactoryInterface $endPointFactory,
    8699                PayloadFactoryInterface $payloadFactory,
    87                 ClassNameFinder $classNameFinder
     100                ClassNameFinder $classNameFinder,
     101                ?CacheInterface $cache = null
    88102        ) {
    89103                $this->features = $features;
    … …  
    94108                $this->payloadFactory = $payloadFactory;
    95109                $this->classNameFinder = $classNameFinder;
     110                $this->cache = $cache;
    96111                $this->instances = [];
    97112        }
    … …  
    115130                }
    116131
    117                 $executor = new $executorClassName(
     132                // Build the base constructor arguments shared by all executors
     133                // (AbstractExecutor signature).
     134                $constructorArguments = [
    118135                        $this->features,
    119136                        $this->types,
    … …  
    122139                        $this->endPointFactory,
    123140                        $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);
    126153
    127154                $this->instances[$endPointName] = $executor;
    … …  
    129156                return $executor;
    130157        }
     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        }
    131193}
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorPerCarrier.php

    r3812630 r3816018  
    5757                if (false === empty($data['carriers']) && is_array($data['carriers'])) {
    5858                        $carriers = $data['carriers'];
    59                 } elseif (false === empty($this->types->getCarriers())) {
     59                } else {
    6060                        $carriers = array_keys($this->types->getCarriers()->toArray());
    6161                }
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/MessagesHandlerFactory.php

    r3812630 r3816018  
    2424         * @var ClassNameFinder
    2525         */
    26         private $classNameFinder;
     26        private ClassNameFinder $classNameFinder;
    2727
    2828        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/EndPoint/TypeValuesLoader.php

    r3812630 r3816018  
    2626         * @var LoggerInterface
    2727         */
    28         protected $logger;
     28        protected LoggerInterface $logger;
    2929
    3030        /**
    3131         * @var ExecutorFactoryInterface
    3232         */
    33         protected $executorFactory;
     33        protected ExecutorFactoryInterface $executorFactory;
    3434
    3535        /**
    36          * @var array
     36         * @var array<mixed>
    3737         */
    38         protected $messages;
     38        protected array $messages;
    3939
    4040        /**
    … …  
    145145
    146146                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
    147152                        if (empty($values[$key])) {
    148153                                $values[$key] = [];
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FileDownloader.php

    r3812630 r3816018  
    2929         * @var LoggerInterface
    3030         */
    31         protected $logger;
     31        protected LoggerInterface $logger;
    3232
    3333        /**
    3434         * @var ClientInterface
    3535         */
    36         protected $client;
     36        protected ClientInterface $client;
    3737
    3838        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FilesDownloaderPromise.php

    r3812630 r3816018  
    2424         * @var FilesDownloaderInterface
    2525         */
    26         protected $filesDownloader;
     26        protected FilesDownloaderInterface $filesDownloader;
    2727
    2828        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ManifestFilesDownloader.php

    r3812630 r3816018  
    2626         * @var FileDownloaderInterface
    2727         */
    28         protected $fileDownloader;
     28        protected FileDownloaderInterface $fileDownloader;
    2929
    3030        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ShipmentFilesDownloader.php

    r3812630 r3816018  
    2626         * @var FileDownloaderInterface
    2727         */
    28         protected $fileDownloader;
     28        protected FileDownloaderInterface $fileDownloader;
    2929
    3030        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Form/AbstractForm.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    24         protected $textDomain;
     24        protected string $textDomain;
    2525
    2626        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/GenericAdapter.php

    r3812630 r3816018  
    6666         * @var string
    6767         */
    68         protected $adapterName;
     68        protected string $adapterName;
    6969
    7070        /**
    7171         * @var string
    7272         */
    73         protected $textDomain;
     73        protected string $textDomain;
    7474
    7575        /**
    7676         * @var string
    7777         */
    78         protected $name;
     78        protected string $name;
    7979
    8080        /**
    8181         * @var ClientInterface
    8282         */
    83         protected $client;
     83        protected ClientInterface $client;
    8484
    8585        /**
    8686         * @var LoggerInterface
    8787         */
    88         protected $logger;
     88        protected LoggerInterface $logger;
    8989
    9090        /**
    9191         * @var KeyGeneratorInterface
    9292         */
    93         protected $keyGenerator;
     93        protected KeyGeneratorInterface $keyGenerator;
    9494
    9595        /**
    9696         * @var CacheInterface
    9797         */
    98         protected $cache;
     98        protected CacheInterface $cache;
    9999
    100100        /**
    101101         * @var TypesInterface
    102102         */
    103         protected $types;
     103        protected TypesInterface $types;
    104104
    105105        /**
    106106         * @var FeaturesInterface
    107107         */
    108         protected $features;
     108        protected FeaturesInterface $features;
    109109
    110110        /**
    111111         * @var FormInterface
    112112         */
    113         protected $form;
     113        protected FormInterface $form;
    114114
    115115        /**
    116116         * @var ClassNameFinder
    117117         */
    118         protected $classNameFinder;
     118        protected ClassNameFinder $classNameFinder;
    119119
    120120        /**
    121121         * @var PayloadFactory
    122122         */
    123         protected $payloadFactory;
     123        protected PayloadFactory $payloadFactory;
    124124
    125125        /**
    126126         * @var ExecutorFactory
    127127         */
    128         protected $executorFactory;
     128        protected ExecutorFactory $executorFactory;
    129129
    130130        /**
    … …  
    667667                        array_merge(
    668668                                $this->form->getFieldValues($data),
    669                                 ['init_types_cache_key' => 'types']
     669                                [
     670                                        'init_types_cache_key' => 'types',
     671                                        'sandbox' => !empty($data['sandbox']),
     672                                ]
    670673                        )
    671674                );
    … …  
    950953                        $endPointFactory,
    951954                        $this->payloadFactory,
    952                         $this->classNameFinder
     955                        $this->classNameFinder,
     956                        $this->cache
    953957                );
    954958        }
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/Client.php

    r3812630 r3816018  
    2727{
    2828        /**
     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        /**
    2965         * @var GuzzleClientInterface
    3066         */
    31         protected $httpClient;
     67        protected GuzzleClientInterface $httpClient;
    3268
    3369        /**
    3470         * @var LoggerInterface
    3571         */
    36         protected $logger;
     72        protected LoggerInterface $logger;
    3773
    3874        /**
    … …  
    6399
    64100                // @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));
    66102
    67103                $httpRequest = new HttpRequest(
    … …  
    98134
    99135                // @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'));
    101137
    102138                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;
    103284        }
    104285
    … …  
    111292        private function getErrorResponse(GuzzleException $httpException): array
    112293        {
    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())));
    114295
    115296                $newResponse = [];
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractRequest.php

    r3812630 r3816018  
    2222{
    2323        /**
    24          * @var array
     24         * @var array<mixed>
    2525         */
    26         protected $extras;
     26        protected array $extras;
    2727
    2828        /**
    2929         * @var EndPointInterface
    3030         */
    31         protected $endPoint;
     31        protected EndPointInterface $endPoint;
    3232
    3333        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractResponseHandler.php

    r3812630 r3816018  
    2626         * @var LoggerInterface
    2727         */
    28         protected $logger;
     28        protected LoggerInterface $logger;
    2929
    3030        /**
    3131         * @var EndPointInterface
    3232         */
    33         protected $endPoint;
     33        protected EndPointInterface $endPoint;
    3434
    3535        /**
    3636         * @var MessagesHandlerInterface
    3737         */
    38         protected $messagesHandler;
     38        protected MessagesHandlerInterface $messagesHandler;
    3939
    4040        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/JsonResponseHandler.php

    r3812630 r3816018  
    3030                $this->logger->debug(__FILE__, __LINE__, 'Response: %s', (string)$contents);
    3131
    32                 $newResponse = [];
     32                $newResponse = [
     33                        'code' => $statusCode,
     34                ];
    3335
    3436                $response = json_decode($contents, true) ?? [];
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutor.php

    r3812630 r3816018  
    2828         * @var ClientInterface
    2929         */
    30         protected $client;
     30        protected ClientInterface $client;
    3131
    3232        /**
    3333         * @var LoggerInterface
    3434         */
    35         protected $logger;
     35        protected LoggerInterface $logger;
    3636
    3737        /**
    3838         * @var RequestFactoryInterface
    3939         */
    40         protected $requestFactory;
     40        protected RequestFactoryInterface $requestFactory;
    4141
    4242        /**
    4343         * @var ResponseHandlerFactoryInterface
    4444         */
    45         protected $responseHandlerFactory;
     45        protected ResponseHandlerFactoryInterface $responseHandlerFactory;
    4646
    4747        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutorFactory.php

    r3812630 r3816018  
    2626         * @var ClientInterface
    2727         */
    28         protected $client;
     28        protected ClientInterface $client;
    2929
    3030        /**
    3131         * @var LoggerInterface
    3232         */
    33         protected $logger;
     33        protected LoggerInterface $logger;
    3434
    3535        /**
    3636         * @var RequestFactoryInterface
    3737         */
    38         protected $requestFactory;
     38        protected RequestFactoryInterface $requestFactory;
    3939
    4040        /**
    4141         * @var ResponseHandlerFactoryInterface
    4242         */
    43         protected $responseHandlerFactory;
     43        protected ResponseHandlerFactoryInterface $responseHandlerFactory;
    4444
    4545        /**
    4646         * @var ClassNameFinder
    4747         */
    48         protected $classNameFinder;
     48        protected ClassNameFinder $classNameFinder;
    4949
    5050        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestFactory.php

    r3812630 r3816018  
    2525         * @var ClassNameFinder
    2626         */
    27         private $classNameFinder;
     27        private ClassNameFinder $classNameFinder;
    2828
    2929        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponseHandlerFactory.php

    r3812630 r3816018  
    2828         * @var LoggerInterface
    2929         */
    30         private $logger;
     30        private LoggerInterface $logger;
    3131
    3232        /**
    3333         * @var MessagesHandlerInterface
    3434         */
    35         private $messagesHandler;
     35        private MessagesHandlerInterface $messagesHandler;
    3636
    3737        /**
    3838         * @var ClassNameFinder
    3939         */
    40         private $classNameFinder;
     40        private ClassNameFinder $classNameFinder;
    4141
    4242        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponsesMerger.php

    r3812630 r3816018  
    2121use OneTeamSoftware\Packages\GuzzleHttp\Promise\PromiseInterface;
    2222use OneTeamSoftware\Packages\GuzzleHttp\Promise\Utils;
     23use Throwable;
    2324
    2425class ResponsesMerger
    2526{
    26         /**
    27          * @var LoggerInterface
    28          */
    29         protected $logger;
     27        protected LoggerInterface $logger;
    3028
    31         /**
    32          * @var ArrayRecursiveDistinctMerger
    33          */
    34         protected $arrayMerger;
     29        protected ArrayRecursiveDistinctMerger $arrayMerger;
    3530
    3631        /**
    … …  
    4641
    4742        /**
    48          * creates a single promise for the multiple promises
     43         * Merges multiple response promises into a single response promise.
    4944         *
    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
    5153         * @return PromiseInterface
    5254         */
    5355        public function merge(array $promises): PromiseInterface
    5456        {
    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);
    6860                        }
    6961                );
     62        }
    7063
    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;
    72171        }
    73172}
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Http/Request.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    24         protected $method;
     24        protected string $method;
    2525
    2626        /**
    2727         * @var string
    2828         */
    29         protected $uri;
     29        protected string $uri;
    3030
    3131        /**
    32          * @var array
     32         * @var array<mixed>
    3333         */
    34         protected $headers;
     34        protected array $headers;
    3535
    3636        /**
    3737         * @var string
    3838         */
    39         protected $body;
     39        protected string $body;
    4040
    4141        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/Parts.php

    r3812630 r3816018  
    2424         * @var integer
    2525         */
    26         protected $index;
     26        protected int $index;
    2727
    2828        /**
    29          * @var array
     29         * @var array<mixed>
    3030         */
    31         protected $parts;
     31        protected array $parts;
    3232
    3333        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/ShipmentId.php

    r3812630 r3816018  
    2222         * @var StringBuilder
    2323         */
    24         protected $stringBuilder;
     24        protected StringBuilder $stringBuilder;
    2525
    2626        /**
    27          * @var array
     27         * @var array<mixed>
    2828         */
    29         protected $values;
     29        protected array $values;
    3030
    3131        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringBuilder.php

    r3812630 r3816018  
    2222         * @var Parts $parts
    2323         */
    24         protected $parts;
     24        protected Parts $parts;
    2525
    2626        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringParser.php

    r3812630 r3816018  
    2222         * @var Parts $parts
    2323         */
    24         protected $parts;
     24        protected Parts $parts;
    2525
    2626        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Collection.php

    r3812630 r3816018  
    2020{
    2121        /**
    22          * @var array
     22         * @var array<mixed>
    2323         */
    24         protected $values;
     24        protected array $values;
    2525
    2626        /**
    27          * @var array
     27         * @var array<mixed>
    2828         */
    29         protected $lowercaseKeyMap;
     29        protected array $lowercaseKeyMap;
    3030
    3131        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/OrderPayload.php

    r3812630 r3816018  
    2626         * @var Payload
    2727         */
    28         protected $payload;
     28        protected Payload $payload;
    2929
    3030        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload.php

    r3812630 r3816018  
    3333         * @var DictionaryInterface
    3434         */
    35         protected $dictionary;
     35        protected DictionaryInterface $dictionary;
    3636
    3737        /**
    3838         * @var TypesInterface
    3939         */
    40         protected $types;
     40        protected TypesInterface $types;
    4141
    4242        /**
    4343         * @var ParcelsFactory
    4444         */
    45         protected $parcelsFactory;
     45        protected ParcelsFactory $parcelsFactory;
    4646
    4747        /**
    4848         * @var AddressFactory
    4949         */
    50         protected $addressFactory;
     50        protected AddressFactory $addressFactory;
    5151
    5252        /**
    5353         * @var ItemFactory
    5454         */
    55         protected $itemFactory;
     55        protected ItemFactory $itemFactory;
    5656
    5757        /**
    5858         * @var DimensionsFactory
    5959         */
    60         protected $dimensionsFactory;
     60        protected DimensionsFactory $dimensionsFactory;
    6161
    6262        /**
    6363         * @var WeightFactory
    6464         */
    65         protected $weightFactory;
     65        protected WeightFactory $weightFactory;
    6666
    6767        /**
    6868         * @var array<Parcel>
    6969         */
    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;
    7676
    7777        /**
    7878         * @var array<string,Dimensions>
    7979         */
    80         protected $dimensionsPerKey;
     80        protected array $dimensionsPerKey;
    8181
    8282        /**
    8383         * @var array<string,Weight>
    8484         */
    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;
    9191
    9292        /**
    … …  
    291291         *
    292292         * @param string $key
    293          * @return array<Item>
     293         * @return array<\OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\Payload\Item>
    294294         */
    295295        public function getItems(string $key): array
    … …  
    842842         * returns COD amount
    843843         *
    844          * @return string
     844         * @return float
    845845         */
    846846        public function getCodAmount(): float
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Address.php

    r3812630 r3816018  
    2424         * @var DictionaryInterface
    2525         */
    26         private $dictionary;
     26        private DictionaryInterface $dictionary;
    2727
    2828        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Dimensions.php

    r3812630 r3816018  
    2222{
    2323        /**
    24          * @var Dictionary
     24         * @var DictionaryInterface
    2525         */
    26         private $dictionary;
     26        private DictionaryInterface $dictionary;
    2727
    2828        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsArrayBuilder.php

    r3812630 r3816018  
    2626         * @var CollectionInterface
    2727         */
    28         private $dimensionUnits;
     28        private CollectionInterface $dimensionUnits;
    2929
    3030        /**
    3131         * @var DimensionConverter
    3232         */
    33         private $dimensionConverter;
     33        private DimensionConverter $dimensionConverter;
    3434
    3535        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsFactory.php

    r3812630 r3816018  
    2424         * @var DimensionsArrayBuilder
    2525         */
    26         private $dimensionsArrayBuilder;
     26        private DimensionsArrayBuilder $dimensionsArrayBuilder;
    2727
    2828        /**
    … …  
    4040         *
    4141         * @param DictionaryInterface $dictionary
    42          * @return Item
     42         * @return Dimensions
    4343         */
    4444        public function create(DictionaryInterface $dictionary): Dimensions
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Item.php

    r3812630 r3816018  
    2323{
    2424        /**
    25          * @var Dictionary
    26          */
    27         private $dictionary;
     25         * @var DictionaryInterface
     26         */
     27        private DictionaryInterface $dictionary;
    2828
    2929        /**
    3030         * @var Dimensions
    3131         */
    32         private $dimensions;
     32        private ?Dimensions $dimensions = null;
    3333
    3434        /**
    3535         * @var Weight
    3636         */
    37         private $weight;
     37        private ?Weight $weight = null;
    3838
    3939        /**
    … …  
    100100
    101101        /**
     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        /**
    102162         * returns country of origin
    103163         *
    … …  
    150210                }
    151211
    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;
    156217
    157218                return $this->dimensions;
    … …  
    169230                }
    170231
    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;
    175237
    176238                return $this->weight;
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ItemFactory.php

    r3812630 r3816018  
    2424         * @var DimensionsFactory
    2525         */
    26         private $dimensionsFactory;
     26        private DimensionsFactory $dimensionsFactory;
    2727
    2828        /**
    2929         * @var WeightFactory
    3030         */
    31         private $weightFactory;
     31        private WeightFactory $weightFactory;
    3232
    3333        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Parcel.php

    r3812630 r3816018  
    2525         * @var DictionaryInterface
    2626         */
    27         private $dictionary;
     27        private DictionaryInterface $dictionary;
    2828
    2929        /**
    3030         * @var array<Item>
    3131         */
    32         private $items;
     32        private ?array $items = null;
    3333
    3434        /**
    3535         * @var string
    3636         */
    37         private $freightClass;
     37        private ?string $freightClass = null;
    3838
    3939        /**
    4040         * @var Dimensions
    4141         */
    42         private $dimensions;
     42        private ?Dimensions $dimensions = null;
    4343
    4444        /**
    4545         * @var Weight
    4646         */
    47         private $weight;
     47        private ?Weight $weight = null;
    4848
    4949        /**
    … …  
    109109                }
    110110
    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;
    115116
    116117                return $this->dimensions;
    … …  
    128129                }
    129130
    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;
    134136
    135137                return $this->weight;
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelFactory.php

    r3812630 r3816018  
    2525         * @var TypesInterface
    2626         */
    27         private $types;
     27        private TypesInterface $types;
    2828
    2929        /**
    3030         * @var DimensionsFactory
    3131         */
    32         private $dimensionsFactory;
     32        private DimensionsFactory $dimensionsFactory;
    3333
    3434        /**
    3535         * @var WeightFactory
    3636         */
    37         private $weightFactory;
     37        private WeightFactory $weightFactory;
    3838
    3939        /**
    4040         * @var ItemFactory
    4141         */
    42         private $ItemFactory;
     42        private ItemFactory $ItemFactory;
    4343
    4444        /**
    … …  
    104104                foreach ($items as $item) {
    105105                        if ($this->isValidItemArray($item)) {
    106                                 $newItems[] = $this->ItemFactory->create($dictionary->withArray($item), $dictionary);
     106                                $newItems[] = $this->ItemFactory->create($dictionary->withArray($item));
    107107                        }
    108108                }
    … …  
    119119        private function isValidItemArray(array $item): bool
    120120        {
    121                 if (false === is_array($item)) {
    122                         return false;
    123                 }
    124 
    125121                if (empty($item['name'])) {
    126122                        return false;
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelsFactory.php

    r3812630 r3816018  
    2424         * @var ParcelFactory
    2525         */
    26         private $parcelFactory;
     26        private ParcelFactory $parcelFactory;
    2727
    2828        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Weight.php

    r3812630 r3816018  
    2222{
    2323        /**
    24          * @var Dictionary
     24         * @var DictionaryInterface
    2525         */
    26         private $dictionary;
     26        private DictionaryInterface $dictionary;
    2727
    2828        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightArrayBuilder.php

    r3812630 r3816018  
    2626         * @var CollectionInterface
    2727         */
    28         private $weightUnits;
     28        private CollectionInterface $weightUnits;
    2929
    3030        /**
    3131         * @var WeightConverter
    3232         */
    33         private $weightConverter;
     33        private WeightConverter $weightConverter;
    3434
    3535        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightFactory.php

    r3812630 r3816018  
    2424         * @var WeightArrayBuilder
    2525         */
    26         private $weightArrayBuilder;
     26        private WeightArrayBuilder $weightArrayBuilder;
    2727
    2828        /**
    … …  
    4040         *
    4141         * @param DictionaryInterface $dictionary
    42          * @return Item
     42         * @return Weight
    4343         */
    4444        public function create(DictionaryInterface $dictionary): Weight
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/PayloadFactory.php

    r3812630 r3816018  
    2626{
    2727        /**
    28          * @var Types
     28         * @var TypesInterface
    2929         */
    30         protected $types;
     30        protected TypesInterface $types;
    3131
    3232        /**
    3333         * @var DictionaryFactory
    3434         */
    35         protected $dictionaryFactory;
     35        protected DictionaryFactory $dictionaryFactory;
    3636
    3737        /**
    3838         * @var ParcelsFactory
    3939         */
    40         protected $parcelsFactory;
     40        protected ParcelsFactory $parcelsFactory;
    4141
    4242        /**
    4343         * @var AddressFactory
    4444         */
    45         protected $addressFactory;
     45        protected AddressFactory $addressFactory;
    4646
    4747        /**
    4848         * @var ItemFactory
    4949         */
    50         protected $itemFactory;
     50        protected ItemFactory $itemFactory;
    5151
    5252        /**
    5353         * @var DimensionsFactory
    5454         */
    55         protected $dimensionsFactory;
     55        protected DimensionsFactory $dimensionsFactory;
    5656
    5757        /**
    5858         * @var WeightFactory
    5959         */
    60         protected $weightFactory;
     60        protected WeightFactory $weightFactory;
    6161
    6262        /**
    6363         * @var string
    6464         */
    65         protected $hash;
     65        protected string $hash;
    6666
    6767        /**
    6868         * @var Payload
    6969         */
    70         protected $instance;
     70        protected Payload $instance;
    7171
    7272        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/AbstractAdapter/Type/Types.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    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;
    100100
    101101        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/BuyShipment.php

    r3812630 r3816018  
    3333         * @var ShipmentPayload
    3434         */
    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;
    4141
    4242        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/CreateOrder.php

    r3812630 r3816018  
    3232         * @var OrderPayload
    3333         */
    34         private $orderPayload;
     34        private OrderPayload $orderPayload;
    3535
    3636        /**
    3737         * @var BuyShipment
    3838         */
    39         private $buyShipmentEndPoint;
     39        private BuyShipment $buyShipmentEndPoint;
    4040
    4141        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetOrder.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
    3535         * @var CreateOrder
    3636         */
    37         private $createOrderEndPoint;
     37        private CreateOrder $createOrderEndPoint;
    3838
    3939        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetRates.php

    r3812630 r3816018  
    3232         * @var ShipmentPayload
    3333         */
    34         private $shipmentPayload;
     34        private ShipmentPayload $shipmentPayload;
    3535
    3636        /**
    3737         * @var RateFilter
    3838         */
    39         private $rateFilter;
     39        private RateFilter $rateFilter;
    4040
    4141        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetShipment.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
    3535         * @var BuyShipment
    3636         */
    37         private $buyShipmentEndPoint;
     37        private BuyShipment $buyShipmentEndPoint;
    3838
    3939        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/GetShipments.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
    3535         * @var BuyShipment
    3636         */
    37         private $buyShipmentEndPoint;
     37        private BuyShipment $buyShipmentEndPoint;
    3838
    3939        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/RateFilter/RateFilter.php

    r3812630 r3816018  
    2626         * @var LoggerInterface
    2727         */
    28         private $logger;
     28        private LoggerInterface $logger;
    2929
    3030        /**
    3131         * @var ServiceIdBuilder
    3232         */
    33         private $serviceIdBuilder;
     33        private ServiceIdBuilder $serviceIdBuilder;
    3434
    3535        /**
    3636         * @var CollectionInterface
    3737         */
    38         private $packageTypes;
     38        private CollectionInterface $packageTypes;
    3939
    4040        /**
    4141         * @var array<string,bool>
    4242         */
    43         private $carrierHasPackageTypeInServiceName;
     43        private array $carrierHasPackageTypeInServiceName;
    4444
    4545        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/EndPoint/RefundShipment.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/ApiKey.php

    r3812630 r3816018  
    2424         * @var Payload
    2525         */
    26         private $payload;
     26        private Payload $payload;
    2727
    2828        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/Builder/AddressBuilder.php

    r3812630 r3816018  
    2525         * @var EmptyToNull
    2626         */
    27         private $emptyToNull;
     27        private EmptyToNull $emptyToNull;
    2828
    2929        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedOrderOptionsBuilder.php

    r3812630 r3816018  
    2525         * @var EmptyToNull
    2626         */
    27         private $emptyToNull;
     27        private EmptyToNull $emptyToNull;
    2828
    2929        /**
    3030         * @var AdvancedShipmentOptionsBuilder
    3131         */
    32         private $advancedShipmentOptionsBuilder;
     32        private AdvancedShipmentOptionsBuilder $advancedShipmentOptionsBuilder;
    3333
    3434        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedShipmentOptionsBuilder.php

    r3812630 r3816018  
    2525         * @var EmptyToNull
    2626         */
    27         private $emptyToNull;
     27        private EmptyToNull $emptyToNull;
    2828
    2929        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/OrderPayload.php

    r3812630 r3816018  
    3131         * @var TypeOrderPayload
    3232         */
    33         private $orderPayload;
     33        private TypeOrderPayload $orderPayload;
    3434
    3535        /**
    3636         * @var AddressBuilder
    3737         */
    38         private $addressBuilder;
     38        private AddressBuilder $addressBuilder;
    3939
    4040        /**
    4141         * @var DimensionsBuilder
    4242         */
    43         private $dimensionsBuilder;
     43        private DimensionsBuilder $dimensionsBuilder;
    4444
    4545        /**
    4646         * @var WeightBuilder
    4747         */
    48         private $weightBuilder;
     48        private WeightBuilder $weightBuilder;
    4949
    5050        /**
    5151         * @var AdvancedOrderOptionsBuilder
    5252         */
    53         private $advancedOptionsBuilder;
     53        private AdvancedOrderOptionsBuilder $advancedOptionsBuilder;
    5454
    5555        /**
    5656         * @var EmptyToNull
    5757         */
    58         private $emptyToNull;
     58        private EmptyToNull $emptyToNull;
    5959
    6060        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStation/Type/ShipmentPayload.php

    r3812630 r3816018  
    3737         * @var Payload
    3838         */
    39         protected $payload;
     39        protected Payload $payload;
    4040
    4141        /**
    4242         * @var AddressBuilder
    4343         */
    44         private $addressBuilder;
     44        private AddressBuilder $addressBuilder;
    4545
    4646        /**
    4747         * @var DimensionsBuilder
    4848         */
    49         private $dimensionsBuilder;
     49        private DimensionsBuilder $dimensionsBuilder;
    5050
    5151        /**
    5252         * @var WeightBuilder
    5353         */
    54         private $weightBuilder;
     54        private WeightBuilder $weightBuilder;
    5555
    5656        /**
    5757         * @var AdvancedShipmentOptionsBuilder
    5858         */
    59         private $advancedOptionsBuilder;
     59        private AdvancedShipmentOptionsBuilder $advancedOptionsBuilder;
    6060
    6161        /**
    6262         * @var EmptyToNull
    6363         */
    64         private $emptyToNull;
     64        private EmptyToNull $emptyToNull;
    6565
    6666        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/BuyShipment.php

    r3812630 r3816018  
    3232         * @var ShipmentPayload
    3333         */
    34         private $shipmentPayload;
     34        private ShipmentPayload $shipmentPayload;
    3535
    3636        /**
    3737         * @var ShipmentDataBuilder
    3838         */
    39         private $shipmentDataBuilder;
     39        private ShipmentDataBuilder $shipmentDataBuilder;
    4040
    4141        /**
    4242         * @var BuyShipmentResponseToShipmentTransformer
    4343         */
    44         private $buyShipmentResponseToShipmentTransformer;
     44        private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer;
    4545
    4646        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/CreateManifest.php

    r3812630 r3816018  
    3131         * @var ManifestResponseToManifestTransformer
    3232         */
    33         private $manifestTransformer;
     33        private ManifestResponseToManifestTransformer $manifestTransformer;
    3434
    3535        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/Executor/GetShipmentsExecutor.php

    r3812630 r3816018  
    2121use OneTeamSoftware\Packages\GuzzleHttp\Promise\Utils;
    2222use OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\Executor\Executor;
     23use Throwable;
    2324
    2425/**
    … …  
    109110                        if ($result['state'] !== PromiseInterface::FULFILLED) {
    110111                                $reason = $result['reason'] ?? null;
    111                                 $message = $reason instanceof \Throwable ? $reason->getMessage() : (string) $reason;
     112                                $message = $reason instanceof Throwable ? $reason->getMessage() : (string) $reason;
    112113                                $this->logger->error(__FILE__, __LINE__, 'Failed to fetch shipment for index %d: %s', $index, $message);
    113114                                continue;
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetManifest.php

    r3812630 r3816018  
    3030         * @var ManifestResponseToManifestTransformer
    3131         */
    32         private $manifestTransformer;
     32        private ManifestResponseToManifestTransformer $manifestTransformer;
    3333
    3434        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetRates.php

    r3812630 r3816018  
    3333         * @var ShipmentPayload
    3434         */
    35         private $shipmentPayload;
     35        private ShipmentPayload $shipmentPayload;
    3636
    3737        /**
    3838         * @var ServiceIdBuilder
    3939         */
    40         private $serviceIdBuilder;
     40        private ServiceIdBuilder $serviceIdBuilder;
    4141
    4242        /**
    4343         * @var ShipmentDataBuilder
    4444         */
    45         private $shipmentDataBuilder;
     45        private ShipmentDataBuilder $shipmentDataBuilder;
    4646
    4747        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipment.php

    r3812630 r3816018  
    3131         * @var ShipmentPayload
    3232         */
    33         private $shipmentPayload;
     33        private ShipmentPayload $shipmentPayload;
    3434
    3535        /**
    3636         * @var BuyShipmentResponseToShipmentTransformer
    3737         */
    38         private $buyShipmentResponseToShipmentTransformer;
     38        private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer;
    3939
    4040        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipmentByShipmentId.php

    r3812630 r3816018  
    3737         * @var string
    3838         */
    39         private $shipmentId;
     39        private string $shipmentId;
    4040
    4141        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipments.php

    r3812630 r3816018  
    3131         * @var ShipmentPayload
    3232         */
    33         private $shipmentPayload;
     33        private ShipmentPayload $shipmentPayload;
    3434
    3535        /**
    3636         * @var BuyShipmentResponseToShipmentTransformer
    3737         */
    38         private $buyShipmentResponseToShipmentTransformer;
     38        private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer;
    3939
    4040        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/GetTracking.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/RefundShipment.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/BuyShipmentResponseToShipmentTransformer.php

    r3812630 r3816018  
    1717         * @var LoggerInterface
    1818         */
    19         private $logger;
     19        private LoggerInterface $logger;
    2020
    2121        /**
    2222         * @var TypesInterface
    2323         */
    24         private $types;
     24        private TypesInterface $types;
    2525
    2626        /**
    2727         * @var ShipmentPayload
    2828         */
    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;
    3535
    3636        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/ManifestResponseToManifestTransformer.php

    r3812630 r3816018  
    1212         * @var LoggerInterface
    1313         */
    14         private $logger;
     14        private LoggerInterface $logger;
    1515
    1616        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/ApiKey.php

    r3812630 r3816018  
    2424         * @var Payload
    2525         */
    26         private $payload;
     26        private Payload $payload;
    2727
    2828        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/Builder/AddressBuilder.php

    r3812630 r3816018  
    2525         * @var EmptyToNull
    2626         */
    27         private $emptyToNull;
     27        private EmptyToNull $emptyToNull;
    2828
    2929        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/Builder/AdvancedShipmentOptionsBuilder.php

    r3812630 r3816018  
    2929         * @var EmptyToNull
    3030         */
    31         private $emptyToNull;
     31        private EmptyToNull $emptyToNull;
    3232
    3333        /**
    3434         * @var WeightBuilder
    3535         */
    36         private $weightBuilder;
     36        private WeightBuilder $weightBuilder;
    3737
    3838        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/Builder/ShipmentDataBuilder.php

    r3812630 r3816018  
    1313         * @var ShipmentPayload
    1414         */
    15         private $shipmentPayload;
     15        private ShipmentPayload $shipmentPayload;
    1616
    1717        /**
    1818         * @var Payload
    1919         */
    20         private $payload;
     20        private Payload $payload;
    2121
    2222        /**
  • wc-shipstation-shipping/tags/1.4.22/includes/ShippingCarrier/ShipStationV2/Type/ShipmentPayload.php

    r3812630 r3816018  
    4949         * @var Payload
    5050         */
    51         protected $payload;
     51        protected Payload $payload;
    5252
    5353        /**
    5454         * @var TypesInterface
    5555         */
    56         protected $types;
     56        protected TypesInterface $types;
    5757
    5858        /**
    5959         * @var AddressBuilder
    6060         */
    61         private $addressBuilder;
     61        private AddressBuilder $addressBuilder;
    6262
    6363        /**
    6464         * @var DimensionsBuilder
    6565         */
    66         private $dimensionsBuilder;
     66        private DimensionsBuilder $dimensionsBuilder;
    6767
    6868        /**
    6969         * @var WeightBuilder
    7070         */
    71         private $weightBuilder;
     71        private WeightBuilder $weightBuilder;
    7272
    7373        /**
    7474         * @var AdvancedShipmentOptionsBuilder
    7575         */
    76         private $advancedOptionsBuilder;
     76        private AdvancedShipmentOptionsBuilder $advancedOptionsBuilder;
    7777
    7878        /**
    7979         * @var EmptyToNull
    8080         */
    81         private $emptyToNull;
     81        private EmptyToNull $emptyToNull;
    8282
    8383        /**
    … …  
    442442                                ]
    443443                        ];
    444                         $packages[] = array_filter($packageData, function($value) { return !is_null($value); });
     444                        $packages[] = array_filter($packageData, function ($value) {
     445                                return !is_null($value);
     446                        });
    445447                }
    446448                return $packages;
    … …  
    495497                        $packageCodes[] = $parcel->getType();
    496498                }
    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                )));
    498504        }
    499505
  • wc-shipstation-shipping/tags/1.4.22/includes/UnitConverter/DimensionConverter.php

    r3812630 r3816018  
    2222         * constructor
    2323         *
    24          * @param string $defaultFromUnit
     24         * @param string|null $defaultFromUnit
    2525         */
    26         public function __construct(string $defaultFromUnit = null)
     26        public function __construct(?string $defaultFromUnit = null)
    2727        {
    2828                parent::__construct(
  • wc-shipstation-shipping/tags/1.4.22/includes/UnitConverter/UnitConverter.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    24         protected $defaultFromUnit;
     24        protected string $defaultFromUnit;
    2525
    2626        /**
    27          * @var array
     27         * @var array<mixed>
    2828         */
    29         protected $fromMultipliers;
     29        protected array $fromMultipliers;
    3030
    3131        /**
    32          * @var array
     32         * @var array<mixed>
    3333         */
    34         protected $toMultipliers;
     34        protected array $toMultipliers;
    3535
    3636        /**
    … …  
    3939         * @param array $fromMultipliers
    4040         * @param array $toMultipliers
    41          * @param string $defaultFromUnit
     41         * @param string|null $defaultFromUnit
    4242         */
    43         public function __construct(array $fromMultipliers, array $toMultipliers, string $defaultFromUnit = null)
     43        public function __construct(array $fromMultipliers, array $toMultipliers, ?string $defaultFromUnit = null)
    4444        {
    4545                $this->fromMultipliers = $fromMultipliers;
    … …  
    5151         * converts a given value to a requested unit from a given unit
    5252         *
     53         * The converted value is truncated (never rounded up) to two decimal places,
     54         * see self::truncate() for the details.
     55         *
    5356         * @param float $value
    5457         * @param string $toUnit
    55          * @param string $fromUnit
     58         * @param string|null $fromUnit
    5659         * @return float
    5760         */
    58         public function convert(float $value, string $toUnit, string $fromUnit = null): float
     61        public function convert(float $value, string $toUnit, ?string $fromUnit = null): float
    5962        {
    6063                $toUnit = strtolower($toUnit);
    … …  
    7376                }
    7477
    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;
    76105        }
    77106}
  • wc-shipstation-shipping/tags/1.4.22/includes/UnitConverter/UnitConverterInterface.php

    r3812630 r3816018  
    2424         * @param float $value
    2525         * @param string $toUnit
    26          * @param string $fromUnit
     26         * @param string|null $fromUnit
    2727         * @return float
    2828         */
    29         public function convert(float $value, string $toUnit, string $fromUnit = null): float;
     29        public function convert(float $value, string $toUnit, ?string $fromUnit = null): float;
    3030}
  • wc-shipstation-shipping/tags/1.4.22/includes/UnitConverter/WeightConverter.php

    r3812630 r3816018  
    2222         * constructor
    2323         *
    24          * @param string $defaultFromUnit
     24         * @param string|null $defaultFromUnit
    2525         */
    26         public function __construct(string $defaultFromUnit = null)
     26        public function __construct(?string $defaultFromUnit = null)
    2727        {
    2828                parent::__construct(
    … …  
    3030                        [
    3131                                'g' => 0.001,
    32                                 'lbs' => 0.453592,
    33                                 'oz' => 0.0283495,
     32                                'lbs' => 0.45359237,
     33                                'oz' => 0.028349523125,
    3434                        ],
    3535                        // from kg
    3636                        [
    3737                                'g' => 1000,
    38                                 'lbs' => 2.20462,
    39                                 'oz' => 35.274,
     38                                'lbs' => 2.2046226218,
     39                                'oz' => 35.27396195,
    4040                        ],
    4141                        $defaultFromUnit
  • wc-shipstation-shipping/tags/1.4.22/includes/WP/Admin/Notices/Notices.php

    r3812630 r3816018  
    1919class Notices
    2020{
     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
    2153        /**
    2254         * @var bool
    … …  
    113145
    114146        /**
    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 busting
    119          * @param string $handlePrefix Optional prefix for asset handles
    120          * @return void
    121          */
    122         public static function enqueueAssets(string $pluginFile, string $version = '1.0.0', string $handlePrefix = 'oneteamsoftware'): void
    123         {
    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                         $version
    137                 );
    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                         $version
    145                 );
    146                 wp_enqueue_script($handlePrefix . '-notice-dismisser');
    147 
    148                 self::$assetsEnqueued = true;
    149         }
    150 
    151         /**
    152147         * returns requested property
    153148         *
    … …  
    185180
    186181        /**
     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        /**
    187220         * dismisses notice
    188221         *
    … …  
    191224        public function dismiss(): void
    192225        {
    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)) {
    194229                        $this->load();
    195230                        $this->dismissed = true;
    … …  
    219254
    220255        /**
     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        /**
    221276         * displays notice
    222277         *
    … …  
    268323
    269324                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
    273333                        if ($this->dismissed) {
    274334                                update_user_meta(get_current_user_id(), $cacheKey . '_dismissed', true);
    … …  
    304364                $properties = get_transient($cacheKey, null);
    305365                if (is_array($properties)) {
     366                        // Transients written before dismissal became per-user still carry
     367                        // a shared flag; ignore it.
     368                        unset($properties['dismissed']);
    306369                        $this->setProperties($properties);
    307370                }
    … …  
    364427
    365428                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:ignore
     429                        echo '<button class="notice-dismiss" data-dismiss-action="' . esc_attr($this->dismissAction) . '" data-nonce="' . esc_attr($nonce) . '">';
    367430                        echo '<span class="screen-reader-text">';
    368                         echo _e('Dismiss', $this->id);
     431                        esc_html_e('Dismiss', $this->id);
    369432                        echo '</span>';
    370433                        echo '</button>';
     434
     435                        $this->addDismissScript();
    371436                }
    372437
    … …  
    385450                echo '</div>';
    386451        }
     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        }
    387480}
  • wc-shipstation-shipping/tags/1.4.22/packages/guzzle/src/Handler/CurlFactory.php

    r3812630 r3816018  
    179179        }
    180180        self::assertFinalProxyOptionTypes($conf, $requiredMultiplex && 'https' !== $request->getUri()->getScheme());
     181        self::assertFinalProxiesSupported($request, $conf);
    181182        self::isolatePreProxyOnAffectedCurl($conf);
    182183        self::normalizeStringableProxyCredentialOptions($conf);
    … …  
    890891        try {
    891892            $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                }
    895899            }
    896900        } catch (\InvalidArgumentException $e) {
    … …  
    950954                }
    951955                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);
    952989            }
    953990        }
  • wc-shipstation-shipping/tags/1.4.22/packages/guzzle/src/Handler/CurlVersion.php

    r3812630 r3816018  
    3838    // plaintext HTTP proxy, and 7.50.2 through 7.51 reject it at connect time.
    3939    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';
    4043    private const HANDLER_SHARING_VERSION = '7.35.0';
    4144    private const SSL_SESSION_SHARING_VERSION = '8.6.0';
    … …  
    122125        return $versionInfo !== null && \version_compare($versionInfo['version'], self::HTTPS_PROXY_VERSION, '>=') && 0 !== ($httpsProxyFeature & $versionInfo['features']);
    123126    }
     127    public static function supportsProxyEmptyUsername(): bool
     128    {
     129        $version = self::getVersion();
     130        return $version !== null && \version_compare($version, self::PROXY_EMPTY_USERNAME_VERSION, '>=');
     131    }
    124132    public static function supportsNtlm(): bool
    125133    {
  • wc-shipstation-shipping/tags/1.4.22/packages/guzzle/src/Utils.php

    r3812630 r3816018  
    732732            if ($uri->getHost() !== $asciiHost) {
    733733                // 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                }
    735740            }
    736741        }
    … …  
    756761    {
    757762        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            }
    759773        }
    760774        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  
    2121            $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
    2222            $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            }
    2432            return $promise;
    2533        }
  • wc-shipstation-shipping/tags/1.4.22/packages/promises/src/FulfilledPromise.php

    r3812630 r3816018  
    3535        $value = $this->value;
    3636        $queue->add(static function () use ($p, $value, $onFulfilled): void {
    37             if (State::isPending($p)) {
    38                 try {
     37            try {
     38                if (State::isPending($p)) {
    3939                    $p->resolve($onFulfilled($value));
    40                 } catch (\Throwable $e) {
     40                }
     41            } catch (\Throwable $e) {
     42                if (State::isPending($p)) {
    4143                    $p->reject($e);
    4244                }
  • wc-shipstation-shipping/tags/1.4.22/packages/promises/src/Promise.php

    r3812630 r3816018  
    1818    private $waitFn;
    1919    private $waitList;
     20    private $handlersBefore = [];
    2021    private $handlers = [];
    2122    /**
    … …  
    114115        $this->result = $value;
    115116        $handlers = $this->handlers;
    116         $this->handlers = null;
     117        $before = $this->handlersBefore;
     118        $this->handlers = $this->handlersBefore = null;
    117119        $this->waitList = $this->waitFn = null;
    118120        $this->cancelFn = null;
    119121        if (!$handlers) {
    120122            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);
    121141        }
    122142        // If the value was not a settled promise or a thenable, then resolve
    … …  
    130150                }
    131151            });
    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);
    135152        } else {
    136153            // 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            }
    146173        }
    147174    }
    … …  
    181208            }
    182209        } 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            }
    184214        }
    185215    }
  • wc-shipstation-shipping/tags/1.4.22/packages/promises/src/RejectedPromise.php

    r3812630 r3816018  
    3535        $p = new Promise([$queue, 'run']);
    3636        $queue->add(static function () use ($p, $reason, $onRejected): void {
    37             if (State::isPending($p)) {
    38                 try {
     37            try {
     38                if (State::isPending($p)) {
    3939                    // Return a resolved promise if onRejected does not throw.
    4040                    $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)) {
    4345                    $p->reject($e);
    4446                }
  • wc-shipstation-shipping/tags/1.4.22/packages/promises/src/Utils.php

    r3812630 r3816018  
    4747                }
    4848            } catch (\Throwable $e) {
    49                 $promise->reject($e);
     49                if (State::isPending($promise)) {
     50                    $promise->reject($e);
     51                }
    5052            }
    5153        });
  • wc-shipstation-shipping/tags/1.4.22/packages/psr7/src/AppendStream.php

    r3812630 r3816018  
    137137        } elseif ($whence !== \SEEK_SET) {
    138138            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');
    139141        }
    140142        $this->pos = $this->current = 0;
  • wc-shipstation-shipping/tags/1.4.22/packages/psr7/src/InflateStream.php

    r3812630 r3816018  
    2121    /** @var StreamInterface */
    2222    private $stream;
     23    /** @var StreamInterface|null */
     24    private $source;
    2325    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
    2455    {
    2556        $resource = StreamWrapper::getResource($stream);
    … …  
    2960        // Default window size is 15.
    3061        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);
    3263    }
    3364}
  • wc-shipstation-shipping/tags/1.4.22/packages/psr7/src/Message.php

    r3812630 r3816018  
    5757        $body->rewind();
    5858        $summary = $body->read($truncateAt);
    59         if ($size > $truncateAt) {
     59        $lookahead = $size === null ? $body->read(3) : '';
     60        if ($size > $truncateAt || $lookahead !== '') {
    6061            if (preg_match('//u', $summary) !== 1) {
    61                 $summary = self::trimTrailingIncompleteUtf8Character($summary, $body->read(3));
     62                $summary = self::trimTrailingIncompleteUtf8Character($summary, $lookahead !== '' ? $lookahead : $body->read(3));
    6263            }
    6364            $summary .= ' (truncated...)';
  • wc-shipstation-shipping/tags/1.4.22/readme.txt

    r3812630 r3816018  
    55Tested up to: 7.0
    66Requires PHP: 7.3
    7 Stable tag: 1.4.21
     7Stable tag: 1.4.22
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    … …  
    284284
    285285== 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
    286289= 1.4.21 =
    287290* Fixed: early translation notice in the error log
  • wc-shipstation-shipping/tags/1.4.22/vendor/composer/installed.json

    r3812630 r3816018  
    197197        {
    198198            "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",
    201201            "source": {
    202202                "type": "git",
    203203                "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",
    210210                "shasum": ""
    211211            },
    212212            "require": {
    213213                "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",
    216216                "php": "^7.2.5 || ^8.0",
    217217                "psr/http-client": "^1.0",
    … …  
    236236                "psr/log": "Required for using the Log middleware"
    237237            },
    238             "time": "2026-11-17T16:23:09+00:00",
     238            "time": "2026-11-20T22:56:33+00:00",
    239239            "type": "library",
    240240            "extra": {
    … …  
    308308            "support": {
    309309                "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"
    311311            },
    312312            "funding": [
    … …  
    328328        {
    329329            "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",
    332332            "source": {
    333333                "type": "git",
    334334                "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",
    341341                "shasum": ""
    342342            },
    … …  
    349349                "phpunit/phpunit": "^8.5.52 || ^9.6.34"
    350350            },
    351             "time": "2026-10-18T12:46:59+00:00",
     351            "time": "2026-11-21T03:45:23+00:00",
    352352            "type": "library",
    353353            "extra": {
    … …  
    395395            "support": {
    396396                "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"
    398398            },
    399399            "funding": [
    … …  
    415415        {
    416416            "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",
    419419            "source": {
    420420                "type": "git",
    421421                "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",
    428428                "shasum": ""
    429429            },
    … …  
    449449                "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
    450450            },
    451             "time": "2026-11-19T20:34:53+00:00",
     451            "time": "2026-11-21T23:48:40+00:00",
    452452            "type": "library",
    453453            "extra": {
    … …  
    517517            "support": {
    518518                "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"
    520520            },
    521521            "funding": [
    … …  
    537537        {
    538538            "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"
    545545            },
    546546            "require-dev": {
    … …  
    626626        {
    627627            "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"
    637637            },
    638638            "require-dev": {
    … …  
    672672        {
    673673            "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": "51bbc8bcd2d1407136ea6a59ef3bb77cc497b514"
    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"
    683683            },
    684684            "require-dev": {
    … …  
    760760        {
    761761            "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"
    771771            },
    772772            "require-dev": {
    … …  
    855855        {
    856856            "name": "oneteamsoftware/php-shippingcarrier-abstractadapter",
    857             "version": "1.0.13",
    858             "version_normalized": "1.0.13.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.13/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"
    863863            },
    864864            "require": {
    … …  
    867867                "dmitryrechkin/php-namingconverter": "^1.0",
    868868                "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"
    875875            },
    876876            "require-dev": {
    877877                "dmitryrechkin/php-phpunit-bootstrap": "^1.0",
    878878                "dmitryrechkin/php-standard": "^1.0",
    879                 "humbug/php-scoper": "0.17.5",
     879                "humbug/php-scoper": "^0.18.18",
    880880                "oneteamsoftware/php-scoper-configs": "~1.0.0"
    881881            },
    … …  
    891891                    "OneTeamSoftware\\": "src/",
    892892                    "OneTeamSoftware\\Tests\\": "tests/",
    893                     "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzlehttp/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",
    896896                    "Psr\\Http\\Client\\": "vendor/psr/http-client/src",
    897897                    "Psr\\Http\\Message\\": [
    … …  
    901901                }
    902902            },
     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            },
    903914            "license": [
    904915                "GPL-2.0-or-later"
    … …  
    916927        {
    917928            "name": "oneteamsoftware/php-shippingcarrier-shipstation",
    918             "version": "2.0.11",
    919             "version_normalized": "2.0.11.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.11/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",
    927938                "php": ">=7.4"
    928939            },
    929940            "require-dev": {
    930941                "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",
    934945                "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"
    938948            },
    939949            "type": "php-shippingcarrier-shipstation",
    … …  
    947957                "psr-4": {
    948958                    "OneTeamSoftware\\": "src/",
    949                     "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzlehttp/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"
    952962                }
    953963            },
    … …  
    958968            },
    959969            "scripts": {
     970                "test": [
     971                    "phpunit"
     972                ],
     973                "stan": [
     974                    "phpstan analyse"
     975                ],
     976                "cs": [
     977                    "phpcs"
     978                ],
    960979                "post-update-cmd": [
    961980                    "mkdir -p tests/Unit",
    962981                    "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)'"
    964993                ]
    965994            },
    … …  
    9751004            ],
    9761005            "description": "ShipStation shipping carrier adapter",
     1006            "keywords": [
     1007                "carrier",
     1008                "logistics",
     1009                "shipping",
     1010                "shipstation"
     1011            ],
    9771012            "install-path": "../oneteamsoftware/php-shippingcarrier-shipstation"
    9781013        },
    9791014        {
    9801015            "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"
    9901025            },
    9911026            "require-dev": {
    … …  
    10071042            "autoload-dev": {
    10081043                "psr-4": {
    1009                     "DmitryRechkin\\Tests\\": "tests/"
     1044                    "OneTeamSoftware\\Tests\\": "tests/"
    10101045                }
    10111046            },
    … …  
    11681203        {
    11691204            "name": "oneteamsoftware/php-wc-shipping",
    1170             "version": "1.0.71",
    1171             "version_normalized": "1.0.71.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.71/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",
    11811216                "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",
    11931228                "php": "^7.4 || ^8.0"
    11941229            },
    … …  
    12841319        {
    12851320            "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"
    12921327            },
    12931328            "require": {
  • wc-shipstation-shipping/tags/1.4.22/vendor/composer/installed.php

    r3812630 r3816018  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'e3f83e1e6f5b2031a5c249a30d3b7479817a0a57',
     6        'reference' => 'c5882ba81266602291b1c0e66d97745055fab65a',
    77        'type' => 'wc-shipstation-shipping',
    88        'install_path' => __DIR__ . '/../../',
    … …  
    5050        ),
    5151        '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',
    5555            'type' => 'library',
    5656            'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
    … …  
    5959        ),
    6060        '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',
    6464            'type' => 'library',
    6565            'install_path' => __DIR__ . '/../guzzlehttp/promises',
    … …  
    6868        ),
    6969        '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',
    7373            'type' => 'library',
    7474            'install_path' => __DIR__ . '/../guzzlehttp/psr7',
    … …  
    7777        ),
    7878        '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',
    8181            'reference' => null,
    8282            'type' => 'php-arraymerger',
    … …  
    9595        ),
    9696        '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',
    9999            'reference' => null,
    100100            'type' => 'php-cache',
    … …  
    104104        ),
    105105        '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',
    108108            'reference' => null,
    109109            'type' => 'php-classnamefinder',
    … …  
    122122        ),
    123123        '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',
    126126            'reference' => null,
    127127            'type' => 'php-logger',
    … …  
    140140        ),
    141141        'oneteamsoftware/php-shippingcarrier-abstractadapter' => array(
    142             'pretty_version' => '1.0.13',
    143             'version' => '1.0.13.0',
     142            'pretty_version' => '1.0.18',
     143            'version' => '1.0.18.0',
    144144            'reference' => null,
    145145            'type' => 'php-shippingcarrier-abstractadapter',
    … …  
    149149        ),
    150150        'oneteamsoftware/php-shippingcarrier-shipstation' => array(
    151             'pretty_version' => '2.0.11',
    152             'version' => '2.0.11.0',
     151            'pretty_version' => '2.0.12',
     152            'version' => '2.0.12.0',
    153153            'reference' => null,
    154154            'type' => 'php-shippingcarrier-shipstation',
    … …  
    158158        ),
    159159        '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',
    162162            'reference' => null,
    163163            'type' => 'php-unitconverter',
    … …  
    194194        ),
    195195        'oneteamsoftware/php-wc-shipping' => array(
    196             'pretty_version' => '1.0.71',
    197             'version' => '1.0.71.0',
     196            'pretty_version' => '1.0.72',
     197            'version' => '1.0.72.0',
    198198            'reference' => null,
    199199            'type' => 'php-wc-shipping',
    … …  
    212212        ),
    213213        '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',
    216216            'reference' => null,
    217217            'type' => 'php-wp-admin-notices',
    … …  
    295295            'pretty_version' => 'dev-main',
    296296            'version' => 'dev-main',
    297             'reference' => 'e3f83e1e6f5b2031a5c249a30d3b7479817a0a57',
     297            'reference' => 'c5882ba81266602291b1c0e66d97745055fab65a',
    298298            'type' => 'wc-shipstation-shipping',
    299299            'install_path' => __DIR__ . '/../../',
  • wc-shipstation-shipping/tags/1.4.22/wc-shipstation-shipping.php

    r3812630 r3816018  
    55 * Plugin URI: https://wordpress.org/plugins/wc-shipstation-shipping/
    66 * Description: Displays live ShipStation shipping rates at cart and checkout pages
    7  * Version: 1.4.21
     7 * Version: 1.4.22
    88 * Tested up to: 7.0
    99 * Requires PHP: 7.4
    … …  
    2626defined('ABSPATH') || exit;
    2727
    28 // Shipping framework: 1.0.71
     28// Shipping framework: 1.0.72
    2929// The exact release of the shared framework this plugin bundles. Another carrier
    3030// plugin reads this line to tell whether the copy WordPress actually loaded is the
    … …  
    8181                        __('Do you like our plugin and can recommend to others?', 'wc-shipstation-shipping')
    8282                ),
    83                 '1.4.21',
     83                '1.4.22',
    8484                static function (): void {
    8585                        // 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  
    2222         * @var Storage\StorageInterface
    2323         */
    24         private $storage;
     24        private Storage\StorageInterface $storage;
    2525
    2626        /**
    2727         * @var bool
    2828         */
    29         private $useCache;
     29        private bool $useCache;
    3030
    3131        /**
    3232         * @var int
    3333         */
    34         private $defaultExpiresAfter;
     34        private int $defaultExpiresAfter;
    3535
    3636        /**
    … …  
    8484         *
    8585         * @param string $key
    86          * @return true
     86         * @return bool
    8787         */
    8888        public function has(string $key): bool
  • wc-shipstation-shipping/trunk/includes/Cache/KeyGenerator.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    24         protected $suffix;
     24        protected string $suffix;
    2525
    2626        /**
  • wc-shipstation-shipping/trunk/includes/Cache/Storage/TmpFile.php

    r3812630 r3816018  
    1919class TmpFile implements StorageInterface
    2020{
    21         /**
    22          * @var string
    23          */
    24         private $basePath;
     21        private string $basePath;
    2522
    2623        /**
  • wc-shipstation-shipping/trunk/includes/ClassNameFinder/ClassNameFinder.php

    r3812630 r3816018  
    2020{
    2121        /**
    22          * @var array
     22         * @var array<mixed>
    2323         */
    24         private $baseClassPaths;
     24        private array $baseClassPaths = [];
    2525
    2626        /**
  • wc-shipstation-shipping/trunk/includes/Logger/EchoLogger.php

    r3812630 r3816018  
    3131        public function log(string $level, string $file, int $line, string $message, ...$args): void
    3232        {
    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);
    3438        }
    3539}
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/AbstractEndPoint.php

    r3812630 r3816018  
    2828         * @var CacheInterface
    2929         */
    30         protected $cache;
     30        protected CacheInterface $cache;
    3131
    3232        /**
    3333         * @var Payload
    3434         */
    35         protected $payload;
     35        protected Payload $payload;
    3636
    3737        /**
    3838         * @var KeyGeneratorInterface
    3939         */
    40         protected $keyGenerator;
     40        protected KeyGeneratorInterface $keyGenerator;
    4141
    4242        /**
    4343         * @var LoggerInterface
    4444         */
    45         protected $logger;
     45        protected LoggerInterface $logger;
    4646
    4747        /**
    4848         * @var string
    4949         */
    50         protected $textDomain;
     50        protected string $textDomain;
    5151
    5252        /**
    5353         * @var TypesInterface
    5454         */
    55         protected $types;
     55        protected TypesInterface $types;
    5656
    5757        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/EndPointFactory.php

    r3812630 r3816018  
    2929         * @var string
    3030         */
    31         private $textDomain;
     31        private string $textDomain;
    3232
    3333        /**
    3434         * @var LoggerInterface
    3535         */
    36         private $logger;
     36        private LoggerInterface $logger;
    3737
    3838        /**
    3939         * @var TypesInterface
    4040         */
    41         private $types;
     41        private TypesInterface $types;
    4242
    4343        /**
    4444         * @var KeyGeneratorInterface
    4545         */
    46         private $keyGenerator;
     46        private KeyGeneratorInterface $keyGenerator;
    4747
    4848        /**
    4949         * @var CacheInterface
    5050         */
    51         private $cache;
     51        private CacheInterface $cache;
    5252
    5353        /**
    5454         * @var ClassNameFinder
    5555         */
    56         private $classNameFinder;
     56        private ClassNameFinder $classNameFinder;
    5757
    5858        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/AbstractExecutor.php

    r3812630 r3816018  
    2929         * @var LoggerInterface
    3030         */
    31         protected $logger;
     31        protected LoggerInterface $logger;
    3232
    3333        /**
    3434         * @var RequestExecutorInterface
    3535         */
    36         protected $requestExecutor;
     36        protected RequestExecutorInterface $requestExecutor;
    3737
    3838        /**
    3939         * @var EndPointFactoryInterface
    4040         */
    41         protected $endPointFactory;
     41        protected EndPointFactoryInterface $endPointFactory;
    4242
    4343        /**
    4444         * @var PayloadFactoryInterface
    4545         */
    46         protected $payloadFactory;
     46        protected PayloadFactoryInterface $payloadFactory;
    4747
    4848        /**
    4949         * @var FeaturesInterface
    5050         */
    51         protected $features;
     51        protected FeaturesInterface $features;
    5252
    5353        /**
    5454         * @var TypesInterface
    5555         */
    56         protected $types;
     56        protected TypesInterface $types;
    5757
    5858        /**
    5959         * @var string
    6060         */
    61         protected $endPointName;
     61        protected string $endPointName;
    6262
    6363        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorFactory.php

    r3812630 r3816018  
    1717namespace OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\Executor;
    1818
     19use OneTeamSoftware\Cache\CacheInterface;
    1920use OneTeamSoftware\ClassNameFinder\ClassNameFinder;
    2021use OneTeamSoftware\Logger\LoggerInterface;
    … …  
    2425use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\PayloadFactoryInterface;
    2526use OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\TypesInterface;
     27use ReflectionException;
     28use ReflectionMethod;
     29use ReflectionNamedType;
    2630
    2731class ExecutorFactory implements ExecutorFactoryInterface
    … …  
    3034         * @var LoggerInterface
    3135         */
    32         protected $logger;
     36        protected LoggerInterface $logger;
    3337
    3438        /**
    3539         * @var RequestExecutorInterface
    3640         */
    37         protected $requestExecutor;
     41        protected RequestExecutorInterface $requestExecutor;
    3842
    3943        /**
    4044         * @var EndPointFactoryInterface
    4145         */
    42         protected $endPointFactory;
     46        protected EndPointFactoryInterface $endPointFactory;
    4347
    4448        /**
    4549         * @var PayloadFactoryInterface
    4650         */
    47         protected $payloadFactory;
     51        protected PayloadFactoryInterface $payloadFactory;
    4852
    4953        /**
    5054         * @var FeaturesInterface
    5155         */
    52         protected $features;
     56        protected FeaturesInterface $features;
    5357
    5458        /**
    5559         * @var TypesInterface
    5660         */
    57         protected $types;
     61        protected TypesInterface $types;
    5862
    5963        /**
    6064         * @var ClassNameFinder
    6165         */
    62         protected $classNameFinder;
     66        protected ClassNameFinder $classNameFinder;
    6367
    6468        /**
    6569         * @var array<string,ExecutorInterface>
    6670         */
    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;
    6880
    6981        /**
    … …  
    7789         * @param PayloadFactoryInterface $payloadFactory
    7890         * @param ClassNameFinder $classNameFinder
     91         * @param CacheInterface|null $cache Optional cache for executors that cache tokens/responses
    7992         */
    8093        public function __construct(
    … …  
    8598                EndPointFactoryInterface $endPointFactory,
    8699                PayloadFactoryInterface $payloadFactory,
    87                 ClassNameFinder $classNameFinder
     100                ClassNameFinder $classNameFinder,
     101                ?CacheInterface $cache = null
    88102        ) {
    89103                $this->features = $features;
    … …  
    94108                $this->payloadFactory = $payloadFactory;
    95109                $this->classNameFinder = $classNameFinder;
     110                $this->cache = $cache;
    96111                $this->instances = [];
    97112        }
    … …  
    115130                }
    116131
    117                 $executor = new $executorClassName(
     132                // Build the base constructor arguments shared by all executors
     133                // (AbstractExecutor signature).
     134                $constructorArguments = [
    118135                        $this->features,
    119136                        $this->types,
    … …  
    122139                        $this->endPointFactory,
    123140                        $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);
    126153
    127154                $this->instances[$endPointName] = $executor;
    … …  
    129156                return $executor;
    130157        }
     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        }
    131193}
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/Executor/ExecutorPerCarrier.php

    r3812630 r3816018  
    5757                if (false === empty($data['carriers']) && is_array($data['carriers'])) {
    5858                        $carriers = $data['carriers'];
    59                 } elseif (false === empty($this->types->getCarriers())) {
     59                } else {
    6060                        $carriers = array_keys($this->types->getCarriers()->toArray());
    6161                }
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/MessagesHandlerFactory.php

    r3812630 r3816018  
    2424         * @var ClassNameFinder
    2525         */
    26         private $classNameFinder;
     26        private ClassNameFinder $classNameFinder;
    2727
    2828        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/EndPoint/TypeValuesLoader.php

    r3812630 r3816018  
    2626         * @var LoggerInterface
    2727         */
    28         protected $logger;
     28        protected LoggerInterface $logger;
    2929
    3030        /**
    3131         * @var ExecutorFactoryInterface
    3232         */
    33         protected $executorFactory;
     33        protected ExecutorFactoryInterface $executorFactory;
    3434
    3535        /**
    36          * @var array
     36         * @var array<mixed>
    3737         */
    38         protected $messages;
     38        protected array $messages;
    3939
    4040        /**
    … …  
    145145
    146146                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
    147152                        if (empty($values[$key])) {
    148153                                $values[$key] = [];
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FileDownloader.php

    r3812630 r3816018  
    2929         * @var LoggerInterface
    3030         */
    31         protected $logger;
     31        protected LoggerInterface $logger;
    3232
    3333        /**
    3434         * @var ClientInterface
    3535         */
    36         protected $client;
     36        protected ClientInterface $client;
    3737
    3838        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/FilesDownloaderPromise.php

    r3812630 r3816018  
    2424         * @var FilesDownloaderInterface
    2525         */
    26         protected $filesDownloader;
     26        protected FilesDownloaderInterface $filesDownloader;
    2727
    2828        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ManifestFilesDownloader.php

    r3812630 r3816018  
    2626         * @var FileDownloaderInterface
    2727         */
    28         protected $fileDownloader;
     28        protected FileDownloaderInterface $fileDownloader;
    2929
    3030        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/FileDownloader/ShipmentFilesDownloader.php

    r3812630 r3816018  
    2626         * @var FileDownloaderInterface
    2727         */
    28         protected $fileDownloader;
     28        protected FileDownloaderInterface $fileDownloader;
    2929
    3030        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Form/AbstractForm.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    24         protected $textDomain;
     24        protected string $textDomain;
    2525
    2626        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/GenericAdapter.php

    r3812630 r3816018  
    6666         * @var string
    6767         */
    68         protected $adapterName;
     68        protected string $adapterName;
    6969
    7070        /**
    7171         * @var string
    7272         */
    73         protected $textDomain;
     73        protected string $textDomain;
    7474
    7575        /**
    7676         * @var string
    7777         */
    78         protected $name;
     78        protected string $name;
    7979
    8080        /**
    8181         * @var ClientInterface
    8282         */
    83         protected $client;
     83        protected ClientInterface $client;
    8484
    8585        /**
    8686         * @var LoggerInterface
    8787         */
    88         protected $logger;
     88        protected LoggerInterface $logger;
    8989
    9090        /**
    9191         * @var KeyGeneratorInterface
    9292         */
    93         protected $keyGenerator;
     93        protected KeyGeneratorInterface $keyGenerator;
    9494
    9595        /**
    9696         * @var CacheInterface
    9797         */
    98         protected $cache;
     98        protected CacheInterface $cache;
    9999
    100100        /**
    101101         * @var TypesInterface
    102102         */
    103         protected $types;
     103        protected TypesInterface $types;
    104104
    105105        /**
    106106         * @var FeaturesInterface
    107107         */
    108         protected $features;
     108        protected FeaturesInterface $features;
    109109
    110110        /**
    111111         * @var FormInterface
    112112         */
    113         protected $form;
     113        protected FormInterface $form;
    114114
    115115        /**
    116116         * @var ClassNameFinder
    117117         */
    118         protected $classNameFinder;
     118        protected ClassNameFinder $classNameFinder;
    119119
    120120        /**
    121121         * @var PayloadFactory
    122122         */
    123         protected $payloadFactory;
     123        protected PayloadFactory $payloadFactory;
    124124
    125125        /**
    126126         * @var ExecutorFactory
    127127         */
    128         protected $executorFactory;
     128        protected ExecutorFactory $executorFactory;
    129129
    130130        /**
    … …  
    667667                        array_merge(
    668668                                $this->form->getFieldValues($data),
    669                                 ['init_types_cache_key' => 'types']
     669                                [
     670                                        'init_types_cache_key' => 'types',
     671                                        'sandbox' => !empty($data['sandbox']),
     672                                ]
    670673                        )
    671674                );
    … …  
    950953                        $endPointFactory,
    951954                        $this->payloadFactory,
    952                         $this->classNameFinder
     955                        $this->classNameFinder,
     956                        $this->cache
    953957                );
    954958        }
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/Client.php

    r3812630 r3816018  
    2727{
    2828        /**
     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        /**
    2965         * @var GuzzleClientInterface
    3066         */
    31         protected $httpClient;
     67        protected GuzzleClientInterface $httpClient;
    3268
    3369        /**
    3470         * @var LoggerInterface
    3571         */
    36         protected $logger;
     72        protected LoggerInterface $logger;
    3773
    3874        /**
    … …  
    6399
    64100                // @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));
    66102
    67103                $httpRequest = new HttpRequest(
    … …  
    98134
    99135                // @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'));
    101137
    102138                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;
    103284        }
    104285
    … …  
    111292        private function getErrorResponse(GuzzleException $httpException): array
    112293        {
    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())));
    114295
    115296                $newResponse = [];
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractRequest.php

    r3812630 r3816018  
    2222{
    2323        /**
    24          * @var array
     24         * @var array<mixed>
    2525         */
    26         protected $extras;
     26        protected array $extras;
    2727
    2828        /**
    2929         * @var EndPointInterface
    3030         */
    31         protected $endPoint;
     31        protected EndPointInterface $endPoint;
    3232
    3333        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/AbstractResponseHandler.php

    r3812630 r3816018  
    2626         * @var LoggerInterface
    2727         */
    28         protected $logger;
     28        protected LoggerInterface $logger;
    2929
    3030        /**
    3131         * @var EndPointInterface
    3232         */
    33         protected $endPoint;
     33        protected EndPointInterface $endPoint;
    3434
    3535        /**
    3636         * @var MessagesHandlerInterface
    3737         */
    38         protected $messagesHandler;
     38        protected MessagesHandlerInterface $messagesHandler;
    3939
    4040        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/JsonResponseHandler.php

    r3812630 r3816018  
    3030                $this->logger->debug(__FILE__, __LINE__, 'Response: %s', (string)$contents);
    3131
    32                 $newResponse = [];
     32                $newResponse = [
     33                        'code' => $statusCode,
     34                ];
    3335
    3436                $response = json_decode($contents, true) ?? [];
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutor.php

    r3812630 r3816018  
    2828         * @var ClientInterface
    2929         */
    30         protected $client;
     30        protected ClientInterface $client;
    3131
    3232        /**
    3333         * @var LoggerInterface
    3434         */
    35         protected $logger;
     35        protected LoggerInterface $logger;
    3636
    3737        /**
    3838         * @var RequestFactoryInterface
    3939         */
    40         protected $requestFactory;
     40        protected RequestFactoryInterface $requestFactory;
    4141
    4242        /**
    4343         * @var ResponseHandlerFactoryInterface
    4444         */
    45         protected $responseHandlerFactory;
     45        protected ResponseHandlerFactoryInterface $responseHandlerFactory;
    4646
    4747        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestExecutorFactory.php

    r3812630 r3816018  
    2626         * @var ClientInterface
    2727         */
    28         protected $client;
     28        protected ClientInterface $client;
    2929
    3030        /**
    3131         * @var LoggerInterface
    3232         */
    33         protected $logger;
     33        protected LoggerInterface $logger;
    3434
    3535        /**
    3636         * @var RequestFactoryInterface
    3737         */
    38         protected $requestFactory;
     38        protected RequestFactoryInterface $requestFactory;
    3939
    4040        /**
    4141         * @var ResponseHandlerFactoryInterface
    4242         */
    43         protected $responseHandlerFactory;
     43        protected ResponseHandlerFactoryInterface $responseHandlerFactory;
    4444
    4545        /**
    4646         * @var ClassNameFinder
    4747         */
    48         protected $classNameFinder;
     48        protected ClassNameFinder $classNameFinder;
    4949
    5050        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/RequestFactory.php

    r3812630 r3816018  
    2525         * @var ClassNameFinder
    2626         */
    27         private $classNameFinder;
     27        private ClassNameFinder $classNameFinder;
    2828
    2929        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponseHandlerFactory.php

    r3812630 r3816018  
    2828         * @var LoggerInterface
    2929         */
    30         private $logger;
     30        private LoggerInterface $logger;
    3131
    3232        /**
    3333         * @var MessagesHandlerInterface
    3434         */
    35         private $messagesHandler;
     35        private MessagesHandlerInterface $messagesHandler;
    3636
    3737        /**
    3838         * @var ClassNameFinder
    3939         */
    40         private $classNameFinder;
     40        private ClassNameFinder $classNameFinder;
    4141
    4242        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/EndPoint/ResponsesMerger.php

    r3812630 r3816018  
    2121use OneTeamSoftware\Packages\GuzzleHttp\Promise\PromiseInterface;
    2222use OneTeamSoftware\Packages\GuzzleHttp\Promise\Utils;
     23use Throwable;
    2324
    2425class ResponsesMerger
    2526{
    26         /**
    27          * @var LoggerInterface
    28          */
    29         protected $logger;
     27        protected LoggerInterface $logger;
    3028
    31         /**
    32          * @var ArrayRecursiveDistinctMerger
    33          */
    34         protected $arrayMerger;
     29        protected ArrayRecursiveDistinctMerger $arrayMerger;
    3530
    3631        /**
    … …  
    4641
    4742        /**
    48          * creates a single promise for the multiple promises
     43         * Merges multiple response promises into a single response promise.
    4944         *
    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
    5153         * @return PromiseInterface
    5254         */
    5355        public function merge(array $promises): PromiseInterface
    5456        {
    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);
    6860                        }
    6961                );
     62        }
    7063
    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;
    72171        }
    73172}
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Http/Request.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    24         protected $method;
     24        protected string $method;
    2525
    2626        /**
    2727         * @var string
    2828         */
    29         protected $uri;
     29        protected string $uri;
    3030
    3131        /**
    32          * @var array
     32         * @var array<mixed>
    3333         */
    34         protected $headers;
     34        protected array $headers;
    3535
    3636        /**
    3737         * @var string
    3838         */
    39         protected $body;
     39        protected string $body;
    4040
    4141        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/Parts.php

    r3812630 r3816018  
    2424         * @var integer
    2525         */
    26         protected $index;
     26        protected int $index;
    2727
    2828        /**
    29          * @var array
     29         * @var array<mixed>
    3030         */
    31         protected $parts;
     31        protected array $parts;
    3232
    3333        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/ShipmentId.php

    r3812630 r3816018  
    2222         * @var StringBuilder
    2323         */
    24         protected $stringBuilder;
     24        protected StringBuilder $stringBuilder;
    2525
    2626        /**
    27          * @var array
     27         * @var array<mixed>
    2828         */
    29         protected $values;
     29        protected array $values;
    3030
    3131        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringBuilder.php

    r3812630 r3816018  
    2222         * @var Parts $parts
    2323         */
    24         protected $parts;
     24        protected Parts $parts;
    2525
    2626        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/ShipmentId/StringParser.php

    r3812630 r3816018  
    2222         * @var Parts $parts
    2323         */
    24         protected $parts;
     24        protected Parts $parts;
    2525
    2626        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Collection.php

    r3812630 r3816018  
    2020{
    2121        /**
    22          * @var array
     22         * @var array<mixed>
    2323         */
    24         protected $values;
     24        protected array $values;
    2525
    2626        /**
    27          * @var array
     27         * @var array<mixed>
    2828         */
    29         protected $lowercaseKeyMap;
     29        protected array $lowercaseKeyMap;
    3030
    3131        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/OrderPayload.php

    r3812630 r3816018  
    2626         * @var Payload
    2727         */
    28         protected $payload;
     28        protected Payload $payload;
    2929
    3030        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload.php

    r3812630 r3816018  
    3333         * @var DictionaryInterface
    3434         */
    35         protected $dictionary;
     35        protected DictionaryInterface $dictionary;
    3636
    3737        /**
    3838         * @var TypesInterface
    3939         */
    40         protected $types;
     40        protected TypesInterface $types;
    4141
    4242        /**
    4343         * @var ParcelsFactory
    4444         */
    45         protected $parcelsFactory;
     45        protected ParcelsFactory $parcelsFactory;
    4646
    4747        /**
    4848         * @var AddressFactory
    4949         */
    50         protected $addressFactory;
     50        protected AddressFactory $addressFactory;
    5151
    5252        /**
    5353         * @var ItemFactory
    5454         */
    55         protected $itemFactory;
     55        protected ItemFactory $itemFactory;
    5656
    5757        /**
    5858         * @var DimensionsFactory
    5959         */
    60         protected $dimensionsFactory;
     60        protected DimensionsFactory $dimensionsFactory;
    6161
    6262        /**
    6363         * @var WeightFactory
    6464         */
    65         protected $weightFactory;
     65        protected WeightFactory $weightFactory;
    6666
    6767        /**
    6868         * @var array<Parcel>
    6969         */
    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;
    7676
    7777        /**
    7878         * @var array<string,Dimensions>
    7979         */
    80         protected $dimensionsPerKey;
     80        protected array $dimensionsPerKey;
    8181
    8282        /**
    8383         * @var array<string,Weight>
    8484         */
    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;
    9191
    9292        /**
    … …  
    291291         *
    292292         * @param string $key
    293          * @return array<Item>
     293         * @return array<\OneTeamSoftware\ShippingCarrier\AbstractAdapter\Type\Payload\Item>
    294294         */
    295295        public function getItems(string $key): array
    … …  
    842842         * returns COD amount
    843843         *
    844          * @return string
     844         * @return float
    845845         */
    846846        public function getCodAmount(): float
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Address.php

    r3812630 r3816018  
    2424         * @var DictionaryInterface
    2525         */
    26         private $dictionary;
     26        private DictionaryInterface $dictionary;
    2727
    2828        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Dimensions.php

    r3812630 r3816018  
    2222{
    2323        /**
    24          * @var Dictionary
     24         * @var DictionaryInterface
    2525         */
    26         private $dictionary;
     26        private DictionaryInterface $dictionary;
    2727
    2828        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsArrayBuilder.php

    r3812630 r3816018  
    2626         * @var CollectionInterface
    2727         */
    28         private $dimensionUnits;
     28        private CollectionInterface $dimensionUnits;
    2929
    3030        /**
    3131         * @var DimensionConverter
    3232         */
    33         private $dimensionConverter;
     33        private DimensionConverter $dimensionConverter;
    3434
    3535        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/DimensionsFactory.php

    r3812630 r3816018  
    2424         * @var DimensionsArrayBuilder
    2525         */
    26         private $dimensionsArrayBuilder;
     26        private DimensionsArrayBuilder $dimensionsArrayBuilder;
    2727
    2828        /**
    … …  
    4040         *
    4141         * @param DictionaryInterface $dictionary
    42          * @return Item
     42         * @return Dimensions
    4343         */
    4444        public function create(DictionaryInterface $dictionary): Dimensions
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Item.php

    r3812630 r3816018  
    2323{
    2424        /**
    25          * @var Dictionary
    26          */
    27         private $dictionary;
     25         * @var DictionaryInterface
     26         */
     27        private DictionaryInterface $dictionary;
    2828
    2929        /**
    3030         * @var Dimensions
    3131         */
    32         private $dimensions;
     32        private ?Dimensions $dimensions = null;
    3333
    3434        /**
    3535         * @var Weight
    3636         */
    37         private $weight;
     37        private ?Weight $weight = null;
    3838
    3939        /**
    … …  
    100100
    101101        /**
     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        /**
    102162         * returns country of origin
    103163         *
    … …  
    150210                }
    151211
    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;
    156217
    157218                return $this->dimensions;
    … …  
    169230                }
    170231
    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;
    175237
    176238                return $this->weight;
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ItemFactory.php

    r3812630 r3816018  
    2424         * @var DimensionsFactory
    2525         */
    26         private $dimensionsFactory;
     26        private DimensionsFactory $dimensionsFactory;
    2727
    2828        /**
    2929         * @var WeightFactory
    3030         */
    31         private $weightFactory;
     31        private WeightFactory $weightFactory;
    3232
    3333        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Parcel.php

    r3812630 r3816018  
    2525         * @var DictionaryInterface
    2626         */
    27         private $dictionary;
     27        private DictionaryInterface $dictionary;
    2828
    2929        /**
    3030         * @var array<Item>
    3131         */
    32         private $items;
     32        private ?array $items = null;
    3333
    3434        /**
    3535         * @var string
    3636         */
    37         private $freightClass;
     37        private ?string $freightClass = null;
    3838
    3939        /**
    4040         * @var Dimensions
    4141         */
    42         private $dimensions;
     42        private ?Dimensions $dimensions = null;
    4343
    4444        /**
    4545         * @var Weight
    4646         */
    47         private $weight;
     47        private ?Weight $weight = null;
    4848
    4949        /**
    … …  
    109109                }
    110110
    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;
    115116
    116117                return $this->dimensions;
    … …  
    128129                }
    129130
    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;
    134136
    135137                return $this->weight;
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelFactory.php

    r3812630 r3816018  
    2525         * @var TypesInterface
    2626         */
    27         private $types;
     27        private TypesInterface $types;
    2828
    2929        /**
    3030         * @var DimensionsFactory
    3131         */
    32         private $dimensionsFactory;
     32        private DimensionsFactory $dimensionsFactory;
    3333
    3434        /**
    3535         * @var WeightFactory
    3636         */
    37         private $weightFactory;
     37        private WeightFactory $weightFactory;
    3838
    3939        /**
    4040         * @var ItemFactory
    4141         */
    42         private $ItemFactory;
     42        private ItemFactory $ItemFactory;
    4343
    4444        /**
    … …  
    104104                foreach ($items as $item) {
    105105                        if ($this->isValidItemArray($item)) {
    106                                 $newItems[] = $this->ItemFactory->create($dictionary->withArray($item), $dictionary);
     106                                $newItems[] = $this->ItemFactory->create($dictionary->withArray($item));
    107107                        }
    108108                }
    … …  
    119119        private function isValidItemArray(array $item): bool
    120120        {
    121                 if (false === is_array($item)) {
    122                         return false;
    123                 }
    124 
    125121                if (empty($item['name'])) {
    126122                        return false;
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/ParcelsFactory.php

    r3812630 r3816018  
    2424         * @var ParcelFactory
    2525         */
    26         private $parcelFactory;
     26        private ParcelFactory $parcelFactory;
    2727
    2828        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/Weight.php

    r3812630 r3816018  
    2222{
    2323        /**
    24          * @var Dictionary
     24         * @var DictionaryInterface
    2525         */
    26         private $dictionary;
     26        private DictionaryInterface $dictionary;
    2727
    2828        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightArrayBuilder.php

    r3812630 r3816018  
    2626         * @var CollectionInterface
    2727         */
    28         private $weightUnits;
     28        private CollectionInterface $weightUnits;
    2929
    3030        /**
    3131         * @var WeightConverter
    3232         */
    33         private $weightConverter;
     33        private WeightConverter $weightConverter;
    3434
    3535        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Payload/WeightFactory.php

    r3812630 r3816018  
    2424         * @var WeightArrayBuilder
    2525         */
    26         private $weightArrayBuilder;
     26        private WeightArrayBuilder $weightArrayBuilder;
    2727
    2828        /**
    … …  
    4040         *
    4141         * @param DictionaryInterface $dictionary
    42          * @return Item
     42         * @return Weight
    4343         */
    4444        public function create(DictionaryInterface $dictionary): Weight
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/PayloadFactory.php

    r3812630 r3816018  
    2626{
    2727        /**
    28          * @var Types
     28         * @var TypesInterface
    2929         */
    30         protected $types;
     30        protected TypesInterface $types;
    3131
    3232        /**
    3333         * @var DictionaryFactory
    3434         */
    35         protected $dictionaryFactory;
     35        protected DictionaryFactory $dictionaryFactory;
    3636
    3737        /**
    3838         * @var ParcelsFactory
    3939         */
    40         protected $parcelsFactory;
     40        protected ParcelsFactory $parcelsFactory;
    4141
    4242        /**
    4343         * @var AddressFactory
    4444         */
    45         protected $addressFactory;
     45        protected AddressFactory $addressFactory;
    4646
    4747        /**
    4848         * @var ItemFactory
    4949         */
    50         protected $itemFactory;
     50        protected ItemFactory $itemFactory;
    5151
    5252        /**
    5353         * @var DimensionsFactory
    5454         */
    55         protected $dimensionsFactory;
     55        protected DimensionsFactory $dimensionsFactory;
    5656
    5757        /**
    5858         * @var WeightFactory
    5959         */
    60         protected $weightFactory;
     60        protected WeightFactory $weightFactory;
    6161
    6262        /**
    6363         * @var string
    6464         */
    65         protected $hash;
     65        protected string $hash;
    6666
    6767        /**
    6868         * @var Payload
    6969         */
    70         protected $instance;
     70        protected Payload $instance;
    7171
    7272        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/AbstractAdapter/Type/Types.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    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;
    100100
    101101        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/BuyShipment.php

    r3812630 r3816018  
    3333         * @var ShipmentPayload
    3434         */
    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;
    4141
    4242        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/CreateOrder.php

    r3812630 r3816018  
    3232         * @var OrderPayload
    3333         */
    34         private $orderPayload;
     34        private OrderPayload $orderPayload;
    3535
    3636        /**
    3737         * @var BuyShipment
    3838         */
    39         private $buyShipmentEndPoint;
     39        private BuyShipment $buyShipmentEndPoint;
    4040
    4141        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetOrder.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
    3535         * @var CreateOrder
    3636         */
    37         private $createOrderEndPoint;
     37        private CreateOrder $createOrderEndPoint;
    3838
    3939        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetRates.php

    r3812630 r3816018  
    3232         * @var ShipmentPayload
    3333         */
    34         private $shipmentPayload;
     34        private ShipmentPayload $shipmentPayload;
    3535
    3636        /**
    3737         * @var RateFilter
    3838         */
    39         private $rateFilter;
     39        private RateFilter $rateFilter;
    4040
    4141        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetShipment.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
    3535         * @var BuyShipment
    3636         */
    37         private $buyShipmentEndPoint;
     37        private BuyShipment $buyShipmentEndPoint;
    3838
    3939        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/GetShipments.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
    3535         * @var BuyShipment
    3636         */
    37         private $buyShipmentEndPoint;
     37        private BuyShipment $buyShipmentEndPoint;
    3838
    3939        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/RateFilter/RateFilter.php

    r3812630 r3816018  
    2626         * @var LoggerInterface
    2727         */
    28         private $logger;
     28        private LoggerInterface $logger;
    2929
    3030        /**
    3131         * @var ServiceIdBuilder
    3232         */
    33         private $serviceIdBuilder;
     33        private ServiceIdBuilder $serviceIdBuilder;
    3434
    3535        /**
    3636         * @var CollectionInterface
    3737         */
    38         private $packageTypes;
     38        private CollectionInterface $packageTypes;
    3939
    4040        /**
    4141         * @var array<string,bool>
    4242         */
    43         private $carrierHasPackageTypeInServiceName;
     43        private array $carrierHasPackageTypeInServiceName;
    4444
    4545        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/EndPoint/RefundShipment.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/ApiKey.php

    r3812630 r3816018  
    2424         * @var Payload
    2525         */
    26         private $payload;
     26        private Payload $payload;
    2727
    2828        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/Builder/AddressBuilder.php

    r3812630 r3816018  
    2525         * @var EmptyToNull
    2626         */
    27         private $emptyToNull;
     27        private EmptyToNull $emptyToNull;
    2828
    2929        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedOrderOptionsBuilder.php

    r3812630 r3816018  
    2525         * @var EmptyToNull
    2626         */
    27         private $emptyToNull;
     27        private EmptyToNull $emptyToNull;
    2828
    2929        /**
    3030         * @var AdvancedShipmentOptionsBuilder
    3131         */
    32         private $advancedShipmentOptionsBuilder;
     32        private AdvancedShipmentOptionsBuilder $advancedShipmentOptionsBuilder;
    3333
    3434        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/Builder/AdvancedShipmentOptionsBuilder.php

    r3812630 r3816018  
    2525         * @var EmptyToNull
    2626         */
    27         private $emptyToNull;
     27        private EmptyToNull $emptyToNull;
    2828
    2929        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/OrderPayload.php

    r3812630 r3816018  
    3131         * @var TypeOrderPayload
    3232         */
    33         private $orderPayload;
     33        private TypeOrderPayload $orderPayload;
    3434
    3535        /**
    3636         * @var AddressBuilder
    3737         */
    38         private $addressBuilder;
     38        private AddressBuilder $addressBuilder;
    3939
    4040        /**
    4141         * @var DimensionsBuilder
    4242         */
    43         private $dimensionsBuilder;
     43        private DimensionsBuilder $dimensionsBuilder;
    4444
    4545        /**
    4646         * @var WeightBuilder
    4747         */
    48         private $weightBuilder;
     48        private WeightBuilder $weightBuilder;
    4949
    5050        /**
    5151         * @var AdvancedOrderOptionsBuilder
    5252         */
    53         private $advancedOptionsBuilder;
     53        private AdvancedOrderOptionsBuilder $advancedOptionsBuilder;
    5454
    5555        /**
    5656         * @var EmptyToNull
    5757         */
    58         private $emptyToNull;
     58        private EmptyToNull $emptyToNull;
    5959
    6060        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStation/Type/ShipmentPayload.php

    r3812630 r3816018  
    3737         * @var Payload
    3838         */
    39         protected $payload;
     39        protected Payload $payload;
    4040
    4141        /**
    4242         * @var AddressBuilder
    4343         */
    44         private $addressBuilder;
     44        private AddressBuilder $addressBuilder;
    4545
    4646        /**
    4747         * @var DimensionsBuilder
    4848         */
    49         private $dimensionsBuilder;
     49        private DimensionsBuilder $dimensionsBuilder;
    5050
    5151        /**
    5252         * @var WeightBuilder
    5353         */
    54         private $weightBuilder;
     54        private WeightBuilder $weightBuilder;
    5555
    5656        /**
    5757         * @var AdvancedShipmentOptionsBuilder
    5858         */
    59         private $advancedOptionsBuilder;
     59        private AdvancedShipmentOptionsBuilder $advancedOptionsBuilder;
    6060
    6161        /**
    6262         * @var EmptyToNull
    6363         */
    64         private $emptyToNull;
     64        private EmptyToNull $emptyToNull;
    6565
    6666        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/BuyShipment.php

    r3812630 r3816018  
    3232         * @var ShipmentPayload
    3333         */
    34         private $shipmentPayload;
     34        private ShipmentPayload $shipmentPayload;
    3535
    3636        /**
    3737         * @var ShipmentDataBuilder
    3838         */
    39         private $shipmentDataBuilder;
     39        private ShipmentDataBuilder $shipmentDataBuilder;
    4040
    4141        /**
    4242         * @var BuyShipmentResponseToShipmentTransformer
    4343         */
    44         private $buyShipmentResponseToShipmentTransformer;
     44        private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer;
    4545
    4646        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/CreateManifest.php

    r3812630 r3816018  
    3131         * @var ManifestResponseToManifestTransformer
    3232         */
    33         private $manifestTransformer;
     33        private ManifestResponseToManifestTransformer $manifestTransformer;
    3434
    3535        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/Executor/GetShipmentsExecutor.php

    r3812630 r3816018  
    2121use OneTeamSoftware\Packages\GuzzleHttp\Promise\Utils;
    2222use OneTeamSoftware\ShippingCarrier\AbstractAdapter\EndPoint\Executor\Executor;
     23use Throwable;
    2324
    2425/**
    … …  
    109110                        if ($result['state'] !== PromiseInterface::FULFILLED) {
    110111                                $reason = $result['reason'] ?? null;
    111                                 $message = $reason instanceof \Throwable ? $reason->getMessage() : (string) $reason;
     112                                $message = $reason instanceof Throwable ? $reason->getMessage() : (string) $reason;
    112113                                $this->logger->error(__FILE__, __LINE__, 'Failed to fetch shipment for index %d: %s', $index, $message);
    113114                                continue;
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetManifest.php

    r3812630 r3816018  
    3030         * @var ManifestResponseToManifestTransformer
    3131         */
    32         private $manifestTransformer;
     32        private ManifestResponseToManifestTransformer $manifestTransformer;
    3333
    3434        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetRates.php

    r3812630 r3816018  
    3333         * @var ShipmentPayload
    3434         */
    35         private $shipmentPayload;
     35        private ShipmentPayload $shipmentPayload;
    3636
    3737        /**
    3838         * @var ServiceIdBuilder
    3939         */
    40         private $serviceIdBuilder;
     40        private ServiceIdBuilder $serviceIdBuilder;
    4141
    4242        /**
    4343         * @var ShipmentDataBuilder
    4444         */
    45         private $shipmentDataBuilder;
     45        private ShipmentDataBuilder $shipmentDataBuilder;
    4646
    4747        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipment.php

    r3812630 r3816018  
    3131         * @var ShipmentPayload
    3232         */
    33         private $shipmentPayload;
     33        private ShipmentPayload $shipmentPayload;
    3434
    3535        /**
    3636         * @var BuyShipmentResponseToShipmentTransformer
    3737         */
    38         private $buyShipmentResponseToShipmentTransformer;
     38        private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer;
    3939
    4040        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipmentByShipmentId.php

    r3812630 r3816018  
    3737         * @var string
    3838         */
    39         private $shipmentId;
     39        private string $shipmentId;
    4040
    4141        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetShipments.php

    r3812630 r3816018  
    3131         * @var ShipmentPayload
    3232         */
    33         private $shipmentPayload;
     33        private ShipmentPayload $shipmentPayload;
    3434
    3535        /**
    3636         * @var BuyShipmentResponseToShipmentTransformer
    3737         */
    38         private $buyShipmentResponseToShipmentTransformer;
     38        private BuyShipmentResponseToShipmentTransformer $buyShipmentResponseToShipmentTransformer;
    3939
    4040        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/GetTracking.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/RefundShipment.php

    r3812630 r3816018  
    3030         * @var ShipmentPayload
    3131         */
    32         private $shipmentPayload;
     32        private ShipmentPayload $shipmentPayload;
    3333
    3434        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/BuyShipmentResponseToShipmentTransformer.php

    r3812630 r3816018  
    1717         * @var LoggerInterface
    1818         */
    19         private $logger;
     19        private LoggerInterface $logger;
    2020
    2121        /**
    2222         * @var TypesInterface
    2323         */
    24         private $types;
     24        private TypesInterface $types;
    2525
    2626        /**
    2727         * @var ShipmentPayload
    2828         */
    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;
    3535
    3636        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/EndPoint/Transformer/ManifestResponseToManifestTransformer.php

    r3812630 r3816018  
    1212         * @var LoggerInterface
    1313         */
    14         private $logger;
     14        private LoggerInterface $logger;
    1515
    1616        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/ApiKey.php

    r3812630 r3816018  
    2424         * @var Payload
    2525         */
    26         private $payload;
     26        private Payload $payload;
    2727
    2828        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/Builder/AddressBuilder.php

    r3812630 r3816018  
    2525         * @var EmptyToNull
    2626         */
    27         private $emptyToNull;
     27        private EmptyToNull $emptyToNull;
    2828
    2929        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/Builder/AdvancedShipmentOptionsBuilder.php

    r3812630 r3816018  
    2929         * @var EmptyToNull
    3030         */
    31         private $emptyToNull;
     31        private EmptyToNull $emptyToNull;
    3232
    3333        /**
    3434         * @var WeightBuilder
    3535         */
    36         private $weightBuilder;
     36        private WeightBuilder $weightBuilder;
    3737
    3838        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/Builder/ShipmentDataBuilder.php

    r3812630 r3816018  
    1313         * @var ShipmentPayload
    1414         */
    15         private $shipmentPayload;
     15        private ShipmentPayload $shipmentPayload;
    1616
    1717        /**
    1818         * @var Payload
    1919         */
    20         private $payload;
     20        private Payload $payload;
    2121
    2222        /**
  • wc-shipstation-shipping/trunk/includes/ShippingCarrier/ShipStationV2/Type/ShipmentPayload.php

    r3812630 r3816018  
    4949         * @var Payload
    5050         */
    51         protected $payload;
     51        protected Payload $payload;
    5252
    5353        /**
    5454         * @var TypesInterface
    5555         */
    56         protected $types;
     56        protected TypesInterface $types;
    5757
    5858        /**
    5959         * @var AddressBuilder
    6060         */
    61         private $addressBuilder;
     61        private AddressBuilder $addressBuilder;
    6262
    6363        /**
    6464         * @var DimensionsBuilder
    6565         */
    66         private $dimensionsBuilder;
     66        private DimensionsBuilder $dimensionsBuilder;
    6767
    6868        /**
    6969         * @var WeightBuilder
    7070         */
    71         private $weightBuilder;
     71        private WeightBuilder $weightBuilder;
    7272
    7373        /**
    7474         * @var AdvancedShipmentOptionsBuilder
    7575         */
    76         private $advancedOptionsBuilder;
     76        private AdvancedShipmentOptionsBuilder $advancedOptionsBuilder;
    7777
    7878        /**
    7979         * @var EmptyToNull
    8080         */
    81         private $emptyToNull;
     81        private EmptyToNull $emptyToNull;
    8282
    8383        /**
    … …  
    442442                                ]
    443443                        ];
    444                         $packages[] = array_filter($packageData, function($value) { return !is_null($value); });
     444                        $packages[] = array_filter($packageData, function ($value) {
     445                                return !is_null($value);
     446                        });
    445447                }
    446448                return $packages;
    … …  
    495497                        $packageCodes[] = $parcel->getType();
    496498                }
    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                )));
    498504        }
    499505
  • wc-shipstation-shipping/trunk/includes/UnitConverter/DimensionConverter.php

    r3812630 r3816018  
    2222         * constructor
    2323         *
    24          * @param string $defaultFromUnit
     24         * @param string|null $defaultFromUnit
    2525         */
    26         public function __construct(string $defaultFromUnit = null)
     26        public function __construct(?string $defaultFromUnit = null)
    2727        {
    2828                parent::__construct(
  • wc-shipstation-shipping/trunk/includes/UnitConverter/UnitConverter.php

    r3812630 r3816018  
    2222         * @var string
    2323         */
    24         protected $defaultFromUnit;
     24        protected string $defaultFromUnit;
    2525
    2626        /**
    27          * @var array
     27         * @var array<mixed>
    2828         */
    29         protected $fromMultipliers;
     29        protected array $fromMultipliers;
    3030
    3131        /**
    32          * @var array
     32         * @var array<mixed>
    3333         */
    34         protected $toMultipliers;
     34        protected array $toMultipliers;
    3535
    3636        /**
    … …  
    3939         * @param array $fromMultipliers
    4040         * @param array $toMultipliers
    41          * @param string $defaultFromUnit
     41         * @param string|null $defaultFromUnit
    4242         */
    43         public function __construct(array $fromMultipliers, array $toMultipliers, string $defaultFromUnit = null)
     43        public function __construct(array $fromMultipliers, array $toMultipliers, ?string $defaultFromUnit = null)
    4444        {
    4545                $this->fromMultipliers = $fromMultipliers;
    … …  
    5151         * converts a given value to a requested unit from a given unit
    5252         *
     53         * The converted value is truncated (never rounded up) to two decimal places,
     54         * see self::truncate() for the details.
     55         *
    5356         * @param float $value
    5457         * @param string $toUnit
    55          * @param string $fromUnit
     58         * @param string|null $fromUnit
    5659         * @return float
    5760         */
    58         public function convert(float $value, string $toUnit, string $fromUnit = null): float
     61        public function convert(float $value, string $toUnit, ?string $fromUnit = null): float
    5962        {
    6063                $toUnit = strtolower($toUnit);
    … …  
    7376                }
    7477
    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;
    76105        }
    77106}
  • wc-shipstation-shipping/trunk/includes/UnitConverter/UnitConverterInterface.php

    r3812630 r3816018  
    2424         * @param float $value
    2525         * @param string $toUnit
    26          * @param string $fromUnit
     26         * @param string|null $fromUnit
    2727         * @return float
    2828         */
    29         public function convert(float $value, string $toUnit, string $fromUnit = null): float;
     29        public function convert(float $value, string $toUnit, ?string $fromUnit = null): float;
    3030}
  • wc-shipstation-shipping/trunk/includes/UnitConverter/WeightConverter.php

    r3812630 r3816018  
    2222         * constructor
    2323         *
    24          * @param string $defaultFromUnit
     24         * @param string|null $defaultFromUnit
    2525         */
    26         public function __construct(string $defaultFromUnit = null)
     26        public function __construct(?string $defaultFromUnit = null)
    2727        {
    2828                parent::__construct(
    … …  
    3030                        [
    3131                                'g' => 0.001,
    32                                 'lbs' => 0.453592,
    33                                 'oz' => 0.0283495,
     32                                'lbs' => 0.45359237,
     33                                'oz' => 0.028349523125,
    3434                        ],
    3535                        // from kg
    3636                        [
    3737                                'g' => 1000,
    38                                 'lbs' => 2.20462,
    39                                 'oz' => 35.274,
     38                                'lbs' => 2.2046226218,
     39                                'oz' => 35.27396195,
    4040                        ],
    4141                        $defaultFromUnit
  • wc-shipstation-shipping/trunk/includes/WP/Admin/Notices/Notices.php

    r3812630 r3816018  
    1919class Notices
    2020{
     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
    2153        /**
    2254         * @var bool
    … …  
    113145
    114146        /**
    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 busting
    119          * @param string $handlePrefix Optional prefix for asset handles
    120          * @return void
    121          */
    122         public static function enqueueAssets(string $pluginFile, string $version = '1.0.0', string $handlePrefix = 'oneteamsoftware'): void
    123         {
    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                         $version
    137                 );
    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                         $version
    145                 );
    146                 wp_enqueue_script($handlePrefix . '-notice-dismisser');
    147 
    148                 self::$assetsEnqueued = true;
    149         }
    150 
    151         /**
    152147         * returns requested property
    153148         *
    … …  
    185180
    186181        /**
     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        /**
    187220         * dismisses notice
    188221         *
    … …  
    191224        public function dismiss(): void
    192225        {
    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)) {
    194229                        $this->load();
    195230                        $this->dismissed = true;
    … …  
    219254
    220255        /**
     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        /**
    221276         * displays notice
    222277         *
    … …  
    268323
    269324                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
    273333                        if ($this->dismissed) {
    274334                                update_user_meta(get_current_user_id(), $cacheKey . '_dismissed', true);
    … …  
    304364                $properties = get_transient($cacheKey, null);
    305365                if (is_array($properties)) {
     366                        // Transients written before dismissal became per-user still carry
     367                        // a shared flag; ignore it.
     368                        unset($properties['dismissed']);
    306369                        $this->setProperties($properties);
    307370                }
    … …  
    364427
    365428                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:ignore
     429                        echo '<button class="notice-dismiss" data-dismiss-action="' . esc_attr($this->dismissAction) . '" data-nonce="' . esc_attr($nonce) . '">';
    367430                        echo '<span class="screen-reader-text">';
    368                         echo _e('Dismiss', $this->id);
     431                        esc_html_e('Dismiss', $this->id);
    369432                        echo '</span>';
    370433                        echo '</button>';
     434
     435                        $this->addDismissScript();
    371436                }
    372437
    … …  
    385450                echo '</div>';
    386451        }
     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        }
    387480}
  • wc-shipstation-shipping/trunk/packages/guzzle/src/Handler/CurlFactory.php

    r3812630 r3816018  
    179179        }
    180180        self::assertFinalProxyOptionTypes($conf, $requiredMultiplex && 'https' !== $request->getUri()->getScheme());
     181        self::assertFinalProxiesSupported($request, $conf);
    181182        self::isolatePreProxyOnAffectedCurl($conf);
    182183        self::normalizeStringableProxyCredentialOptions($conf);
    … …  
    890891        try {
    891892            $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                }
    895899            }
    896900        } catch (\InvalidArgumentException $e) {
    … …  
    950954                }
    951955                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);
    952989            }
    953990        }
  • wc-shipstation-shipping/trunk/packages/guzzle/src/Handler/CurlVersion.php

    r3812630 r3816018  
    3838    // plaintext HTTP proxy, and 7.50.2 through 7.51 reject it at connect time.
    3939    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';
    4043    private const HANDLER_SHARING_VERSION = '7.35.0';
    4144    private const SSL_SESSION_SHARING_VERSION = '8.6.0';
    … …  
    122125        return $versionInfo !== null && \version_compare($versionInfo['version'], self::HTTPS_PROXY_VERSION, '>=') && 0 !== ($httpsProxyFeature & $versionInfo['features']);
    123126    }
     127    public static function supportsProxyEmptyUsername(): bool
     128    {
     129        $version = self::getVersion();
     130        return $version !== null && \version_compare($version, self::PROXY_EMPTY_USERNAME_VERSION, '>=');
     131    }
    124132    public static function supportsNtlm(): bool
    125133    {
  • wc-shipstation-shipping/trunk/packages/guzzle/src/Utils.php

    r3812630 r3816018  
    732732            if ($uri->getHost() !== $asciiHost) {
    733733                // 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                }
    735740            }
    736741        }
    … …  
    756761    {
    757762        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            }
    759773        }
    760774        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  
    2121            $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
    2222            $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            }
    2432            return $promise;
    2533        }
  • wc-shipstation-shipping/trunk/packages/promises/src/FulfilledPromise.php

    r3812630 r3816018  
    3535        $value = $this->value;
    3636        $queue->add(static function () use ($p, $value, $onFulfilled): void {
    37             if (State::isPending($p)) {
    38                 try {
     37            try {
     38                if (State::isPending($p)) {
    3939                    $p->resolve($onFulfilled($value));
    40                 } catch (\Throwable $e) {
     40                }
     41            } catch (\Throwable $e) {
     42                if (State::isPending($p)) {
    4143                    $p->reject($e);
    4244                }
  • wc-shipstation-shipping/trunk/packages/promises/src/Promise.php

    r3812630 r3816018  
    1818    private $waitFn;
    1919    private $waitList;
     20    private $handlersBefore = [];
    2021    private $handlers = [];
    2122    /**
    … …  
    114115        $this->result = $value;
    115116        $handlers = $this->handlers;
    116         $this->handlers = null;
     117        $before = $this->handlersBefore;
     118        $this->handlers = $this->handlersBefore = null;
    117119        $this->waitList = $this->waitFn = null;
    118120        $this->cancelFn = null;
    119121        if (!$handlers) {
    120122            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);
    121141        }
    122142        // If the value was not a settled promise or a thenable, then resolve
    … …  
    130150                }
    131151            });
    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);
    135152        } else {
    136153            // 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            }
    146173        }
    147174    }
    … …  
    181208            }
    182209        } 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            }
    184214        }
    185215    }
  • wc-shipstation-shipping/trunk/packages/promises/src/RejectedPromise.php

    r3812630 r3816018  
    3535        $p = new Promise([$queue, 'run']);
    3636        $queue->add(static function () use ($p, $reason, $onRejected): void {
    37             if (State::isPending($p)) {
    38                 try {
     37            try {
     38                if (State::isPending($p)) {
    3939                    // Return a resolved promise if onRejected does not throw.
    4040                    $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)) {
    4345                    $p->reject($e);
    4446                }
  • wc-shipstation-shipping/trunk/packages/promises/src/Utils.php

    r3812630 r3816018  
    4747                }
    4848            } catch (\Throwable $e) {
    49                 $promise->reject($e);
     49                if (State::isPending($promise)) {
     50                    $promise->reject($e);
     51                }
    5052            }
    5153        });
  • wc-shipstation-shipping/trunk/packages/psr7/src/AppendStream.php

    r3812630 r3816018  
    137137        } elseif ($whence !== \SEEK_SET) {
    138138            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');
    139141        }
    140142        $this->pos = $this->current = 0;
  • wc-shipstation-shipping/trunk/packages/psr7/src/InflateStream.php

    r3812630 r3816018  
    2121    /** @var StreamInterface */
    2222    private $stream;
     23    /** @var StreamInterface|null */
     24    private $source;
    2325    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
    2455    {
    2556        $resource = StreamWrapper::getResource($stream);
    … …  
    2960        // Default window size is 15.
    3061        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);
    3263    }
    3364}
  • wc-shipstation-shipping/trunk/packages/psr7/src/Message.php

    r3812630 r3816018  
    5757        $body->rewind();
    5858        $summary = $body->read($truncateAt);
    59         if ($size > $truncateAt) {
     59        $lookahead = $size === null ? $body->read(3) : '';
     60        if ($size > $truncateAt || $lookahead !== '') {
    6061            if (preg_match('//u', $summary) !== 1) {
    61                 $summary = self::trimTrailingIncompleteUtf8Character($summary, $body->read(3));
     62                $summary = self::trimTrailingIncompleteUtf8Character($summary, $lookahead !== '' ? $lookahead : $body->read(3));
    6263            }
    6364            $summary .= ' (truncated...)';
  • wc-shipstation-shipping/trunk/readme.txt

    r3812630 r3816018  
    55Tested up to: 7.0
    66Requires PHP: 7.3
    7 Stable tag: 1.4.21
     7Stable tag: 1.4.22
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    … …  
    284284
    285285== 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
    286289= 1.4.21 =
    287290* Fixed: early translation notice in the error log
  • wc-shipstation-shipping/trunk/vendor/composer/installed.json

    r3812630 r3816018  
    197197        {
    198198            "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",
    201201            "source": {
    202202                "type": "git",
    203203                "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",
    210210                "shasum": ""
    211211            },
    212212            "require": {
    213213                "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",
    216216                "php": "^7.2.5 || ^8.0",
    217217                "psr/http-client": "^1.0",
    … …  
    236236                "psr/log": "Required for using the Log middleware"
    237237            },
    238             "time": "2026-11-17T16:23:09+00:00",
     238            "time": "2026-11-20T22:56:33+00:00",
    239239            "type": "library",
    240240            "extra": {
    … …  
    308308            "support": {
    309309                "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"
    311311            },
    312312            "funding": [
    … …  
    328328        {
    329329            "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",
    332332            "source": {
    333333                "type": "git",
    334334                "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",
    341341                "shasum": ""
    342342            },
    … …  
    349349                "phpunit/phpunit": "^8.5.52 || ^9.6.34"
    350350            },
    351             "time": "2026-10-18T12:46:59+00:00",
     351            "time": "2026-11-21T03:45:23+00:00",
    352352            "type": "library",
    353353            "extra": {
    … …  
    395395            "support": {
    396396                "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"
    398398            },
    399399            "funding": [
    … …  
    415415        {
    416416            "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",
    419419            "source": {
    420420                "type": "git",
    421421                "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",
    428428                "shasum": ""
    429429            },
    … …  
    449449                "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
    450450            },
    451             "time": "2026-11-19T20:34:53+00:00",
     451            "time": "2026-11-21T23:48:40+00:00",
    452452            "type": "library",
    453453            "extra": {
    … …  
    517517            "support": {
    518518                "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"
    520520            },
    521521            "funding": [
    … …  
    537537        {
    538538            "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"
    545545            },
    546546            "require-dev": {
    … …  
    626626        {
    627627            "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"
    637637            },
    638638            "require-dev": {
    … …  
    672672        {
    673673            "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": "51bbc8bcd2d1407136ea6a59ef3bb77cc497b514"
    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"
    683683            },
    684684            "require-dev": {
    … …  
    760760        {
    761761            "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"
    771771            },
    772772            "require-dev": {
    … …  
    855855        {
    856856            "name": "oneteamsoftware/php-shippingcarrier-abstractadapter",
    857             "version": "1.0.13",
    858             "version_normalized": "1.0.13.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.13/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"
    863863            },
    864864            "require": {
    … …  
    867867                "dmitryrechkin/php-namingconverter": "^1.0",
    868868                "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"
    875875            },
    876876            "require-dev": {
    877877                "dmitryrechkin/php-phpunit-bootstrap": "^1.0",
    878878                "dmitryrechkin/php-standard": "^1.0",
    879                 "humbug/php-scoper": "0.17.5",
     879                "humbug/php-scoper": "^0.18.18",
    880880                "oneteamsoftware/php-scoper-configs": "~1.0.0"
    881881            },
    … …  
    891891                    "OneTeamSoftware\\": "src/",
    892892                    "OneTeamSoftware\\Tests\\": "tests/",
    893                     "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzlehttp/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",
    896896                    "Psr\\Http\\Client\\": "vendor/psr/http-client/src",
    897897                    "Psr\\Http\\Message\\": [
    … …  
    901901                }
    902902            },
     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            },
    903914            "license": [
    904915                "GPL-2.0-or-later"
    … …  
    916927        {
    917928            "name": "oneteamsoftware/php-shippingcarrier-shipstation",
    918             "version": "2.0.11",
    919             "version_normalized": "2.0.11.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.11/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",
    927938                "php": ">=7.4"
    928939            },
    929940            "require-dev": {
    930941                "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",
    934945                "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"
    938948            },
    939949            "type": "php-shippingcarrier-shipstation",
    … …  
    947957                "psr-4": {
    948958                    "OneTeamSoftware\\": "src/",
    949                     "OneTeamSoftware\\Packages\\GuzzleHttp\\": "packages/guzzlehttp/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"
    952962                }
    953963            },
    … …  
    958968            },
    959969            "scripts": {
     970                "test": [
     971                    "phpunit"
     972                ],
     973                "stan": [
     974                    "phpstan analyse"
     975                ],
     976                "cs": [
     977                    "phpcs"
     978                ],
    960979                "post-update-cmd": [
    961980                    "mkdir -p tests/Unit",
    962981                    "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)'"
    964993                ]
    965994            },
    … …  
    9751004            ],
    9761005            "description": "ShipStation shipping carrier adapter",
     1006            "keywords": [
     1007                "carrier",
     1008                "logistics",
     1009                "shipping",
     1010                "shipstation"
     1011            ],
    9771012            "install-path": "../oneteamsoftware/php-shippingcarrier-shipstation"
    9781013        },
    9791014        {
    9801015            "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"
    9901025            },
    9911026            "require-dev": {
    … …  
    10071042            "autoload-dev": {
    10081043                "psr-4": {
    1009                     "DmitryRechkin\\Tests\\": "tests/"
     1044                    "OneTeamSoftware\\Tests\\": "tests/"
    10101045                }
    10111046            },
    … …  
    11681203        {
    11691204            "name": "oneteamsoftware/php-wc-shipping",
    1170             "version": "1.0.71",
    1171             "version_normalized": "1.0.71.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.71/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",
    11811216                "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",
    11931228                "php": "^7.4 || ^8.0"
    11941229            },
    … …  
    12841319        {
    12851320            "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"
    12921327            },
    12931328            "require": {
  • wc-shipstation-shipping/trunk/vendor/composer/installed.php

    r3812630 r3816018  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'e3f83e1e6f5b2031a5c249a30d3b7479817a0a57',
     6        'reference' => 'c5882ba81266602291b1c0e66d97745055fab65a',
    77        'type' => 'wc-shipstation-shipping',
    88        'install_path' => __DIR__ . '/../../',
    … …  
    5050        ),
    5151        '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',
    5555            'type' => 'library',
    5656            'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
    … …  
    5959        ),
    6060        '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',
    6464            'type' => 'library',
    6565            'install_path' => __DIR__ . '/../guzzlehttp/promises',
    … …  
    6868        ),
    6969        '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',
    7373            'type' => 'library',
    7474            'install_path' => __DIR__ . '/../guzzlehttp/psr7',
    … …  
    7777        ),
    7878        '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',
    8181            'reference' => null,
    8282            'type' => 'php-arraymerger',
    … …  
    9595        ),
    9696        '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',
    9999            'reference' => null,
    100100            'type' => 'php-cache',
    … …  
    104104        ),
    105105        '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',
    108108            'reference' => null,
    109109            'type' => 'php-classnamefinder',
    … …  
    122122        ),
    123123        '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',
    126126            'reference' => null,
    127127            'type' => 'php-logger',
    … …  
    140140        ),
    141141        'oneteamsoftware/php-shippingcarrier-abstractadapter' => array(
    142             'pretty_version' => '1.0.13',
    143             'version' => '1.0.13.0',
     142            'pretty_version' => '1.0.18',
     143            'version' => '1.0.18.0',
    144144            'reference' => null,
    145145            'type' => 'php-shippingcarrier-abstractadapter',
    … …  
    149149        ),
    150150        'oneteamsoftware/php-shippingcarrier-shipstation' => array(
    151             'pretty_version' => '2.0.11',
    152             'version' => '2.0.11.0',
     151            'pretty_version' => '2.0.12',
     152            'version' => '2.0.12.0',
    153153            'reference' => null,
    154154            'type' => 'php-shippingcarrier-shipstation',
    … …  
    158158        ),
    159159        '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',
    162162            'reference' => null,
    163163            'type' => 'php-unitconverter',
    … …  
    194194        ),
    195195        'oneteamsoftware/php-wc-shipping' => array(
    196             'pretty_version' => '1.0.71',
    197             'version' => '1.0.71.0',
     196            'pretty_version' => '1.0.72',
     197            'version' => '1.0.72.0',
    198198            'reference' => null,
    199199            'type' => 'php-wc-shipping',
    … …  
    212212        ),
    213213        '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',
    216216            'reference' => null,
    217217            'type' => 'php-wp-admin-notices',
    … …  
    295295            'pretty_version' => 'dev-main',
    296296            'version' => 'dev-main',
    297             'reference' => 'e3f83e1e6f5b2031a5c249a30d3b7479817a0a57',
     297            'reference' => 'c5882ba81266602291b1c0e66d97745055fab65a',
    298298            'type' => 'wc-shipstation-shipping',
    299299            'install_path' => __DIR__ . '/../../',
  • wc-shipstation-shipping/trunk/wc-shipstation-shipping.php

    r3812630 r3816018  
    55 * Plugin URI: https://wordpress.org/plugins/wc-shipstation-shipping/
    66 * Description: Displays live ShipStation shipping rates at cart and checkout pages
    7  * Version: 1.4.21
     7 * Version: 1.4.22
    88 * Tested up to: 7.0
    99 * Requires PHP: 7.4
    … …  
    2626defined('ABSPATH') || exit;
    2727
    28 // Shipping framework: 1.0.71
     28// Shipping framework: 1.0.72
    2929// The exact release of the shared framework this plugin bundles. Another carrier
    3030// plugin reads this line to tell whether the copy WordPress actually loaded is the
    … …  
    8181                        __('Do you like our plugin and can recommend to others?', 'wc-shipstation-shipping')
    8282                ),
    83                 '1.4.21',
     83                '1.4.22',
    8484                static function (): void {
    8585                        // 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.