Skip to content

Commit 5736de4

Browse files
authored
Merge pull request #356 from EasyPost/breaking_changes
Breaking changes
2 parents 321a44b + 2f0d8d7 commit 5736de4

33 files changed

+67
-118
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: set up PHP
15-
uses: shivammathur/setup-php@v2
14+
- uses: shivammathur/setup-php@v2
1615
with:
1716
php-version: '8.3'
1817
- name: install dependencies
@@ -23,11 +22,11 @@ jobs:
2322
runs-on: ubuntu-latest
2423
strategy:
2524
matrix:
26-
phpversion: ['8.0', '8.1', '8.2', '8.3']
25+
# TODO: Add 8.4 when VCR releases a version compatible with it
26+
phpversion: ['8.1', '8.2', '8.3']
2727
steps:
2828
- uses: actions/checkout@v4
29-
- name: set up PHP
30-
uses: shivammathur/setup-php@v2
29+
- uses: shivammathur/setup-php@v2
3130
with:
3231
php-version: ${{ matrix.phpversion }}
3332
coverage: xdebug
@@ -53,10 +52,8 @@ jobs:
5352
if: github.ref == 'refs/heads/master'
5453
runs-on: ubuntu-latest
5554
steps:
56-
- name: Checkout Repository
57-
uses: actions/checkout@v4
58-
- name: Set up PHP
59-
uses: shivammathur/setup-php@v2
55+
- uses: actions/checkout@v4
56+
- uses: shivammathur/setup-php@v2
6057
with:
6158
php-version: '8.3'
6259
- name: Install Dependencies

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
## Next Release
44

5+
- Drops support for PHP 8.0
56
- Adds `custom_headers` property to webhook model
67
- Corrects wrapping payload for update webhook endpoint
8+
- Corrects various type hints throughout project
79
- Fixes error handling
810
- Corrects the type of `errors` property on an `ApiException` to allow for the alternative format
911
- Fixes a bug where you could not `prettyPrint` an error if it used the alternative format
1012
- Corrects the `param` references to `property` references on all error models
1113
- Adds new `AddressVerificationFieldError` for the `errors` property on a `Verification` model
1214
- Adds missing `suggestion` property to `FieldError`
13-
- Removes the deprecated `create_list` tracker endpoint function as it is no longer available via API
15+
- Removes deprecated `createList` tracker endpoint function as it is no longer available via API
16+
- Removes deprecated `user.allApiKeys` and `user.apiKeys`, use `apiKey.all` and `apiKey.retrieveApiKeysForUser` respectively
17+
- Bump deps
1418

1519
## v7.4.2 (2024-08-16)
1620

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
],
2020
"require": {
2121
"ext-json": "*",
22-
"php": ">=8.0",
23-
"guzzlehttp/guzzle": "^7.5"
22+
"php": ">=8.1",
23+
"guzzlehttp/guzzle": "^7.9"
2424
},
2525
"require-dev": {
26-
"allejo/php-vcr-sanitizer": "^1.0.9",
27-
"php-coveralls/php-coveralls": "^2.5",
28-
"php-vcr/php-vcr": "^1.7",
29-
"phpunit/phpunit": "^9",
30-
"squizlabs/php_codesniffer": "^3.7",
26+
"allejo/php-vcr-sanitizer": "^1.1",
27+
"php-coveralls/php-coveralls": "^2.7",
28+
"php-vcr/php-vcr": "^1.8",
29+
"phpunit/phpunit": "^10",
30+
"squizlabs/php_codesniffer": "^3.11",
3131
"roave/security-advisories": "dev-latest",
3232
"rregeer/phpunit-coverage-check": "^0.3.1",
33-
"phpstan/phpstan": "^1.11"
33+
"phpstan/phpstan": "^2.1"
3434
},
3535
"scripts": {
3636
"coverage": "XDEBUG_MODE=coverage ./bin/phpunit --coverage-html clover.html --coverage-clover build/logs/clover.xml && ./bin/coverage-check build/logs/clover.xml 85 --only-percentage",

lib/EasyPost/Batch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @property string $mode
1111
* @property string $state
1212
* @property int $num_shipments
13-
* @property array $shipments
13+
* @property Shipment[] $shipments
1414
* @property object $status
1515
* @property string $label_url
1616
* @property ScanForm $scan_form

lib/EasyPost/EasyPostObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public function next(): void
241241
public function valid(): bool
242242
{
243243
$key = key($this->_values);
244-
return ($key !== null && $key !== false);
244+
return $key !== null;
245245
}
246246

247247
/**

lib/EasyPost/Event.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
* @property object $previous_attributes
1212
* @property object $result
1313
* @property string $status
14-
* @property array $pending_urls
15-
* @property array $completed_urls
14+
* @property array<string> $pending_urls
15+
* @property array<string> $completed_urls
1616
* @property string $created_at
1717
* @property string $updated_at
1818
*/

lib/EasyPost/Exception/Api/ApiException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* @package EasyPost
1111
* @property string|null $code
12-
* @property array<int, FieldError|array>|null $errors
12+
* @property array<FieldError|array<string>>|null $errors
1313
* @property string $message
1414
* @property string|null $httpBody
1515
* @property int|null $httpStatus

lib/EasyPost/Http/Requestor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public static function interpretResponse(string $httpBody, int $httpStatus): mix
264264
*/
265265
public static function handleApiError(?string $httpBody, int $httpStatus, array $response): void
266266
{
267-
if (!is_array($response) || !isset($response['error'])) {
267+
if (!isset($response['error'])) {
268268
throw new JsonException(
269269
"Invalid response object from API: HTTP Status: ({$httpStatus}) {$httpBody})",
270270
$httpStatus,

lib/EasyPost/Insurance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @property Address $to_address
1919
* @property Address $from_address
2020
* @property Fee $fee
21-
* @property array $messages
21+
* @property array<string> $messages
2222
* @property string $created_at
2323
* @property string $updated_at
2424
*/

lib/EasyPost/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @property Address $return_address
1616
* @property Address $buyer_address
1717
* @property Shipment[] $shipments
18-
* @property Rates[] $rates
18+
* @property Rate[] $rates
1919
* @property Message[] $messages
2020
* @property bool $is_return
2121
* @property string $created_at

0 commit comments

Comments
 (0)