Skip to content

Commit e0293c9

Browse files
Merge pull request #918 from mailgun/DE-1297-mailgun-sdk-php-mailgun-not-work-with-php-version-8-3
Check compatibility with php 8.3
2 parents fc8819b + 05d3a06 commit e0293c9

26 files changed

+299
-151
lines changed

.github/workflows/php.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ jobs:
88
php:
99
strategy:
1010
matrix:
11-
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
11+
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
1212

13-
runs-on: 'Ubuntu-20.04'
13+
runs-on: 'ubuntu-latest'
1414

1515
steps:
1616

1717
- name: Checkout
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919

2020
- name: Setup PHP
2121
uses: shivammathur/setup-php@v2
@@ -31,16 +31,16 @@ jobs:
3131

3232
lowest:
3333
name: Lowest deps
34-
runs-on: ubuntu-20.04
34+
runs-on: 'ubuntu-latest'
3535
steps:
3636
- name: Set up PHP
3737
uses: shivammathur/setup-php@2.9.0
3838
with:
39-
php-version: 7.3
39+
php-version: 7.4
4040
coverage: pcov
4141

4242
- name: Checkout code
43-
uses: actions/checkout@v2
43+
uses: actions/checkout@v4
4444

4545
- name: Download dependencies
4646
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable --prefer-lowest

.github/workflows/static.yml

Lines changed: 83 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -2,88 +2,86 @@ on: [ pull_request ]
22
name: Static analysis
33

44
jobs:
5-
phpstan:
6-
name: PHPStan
7-
runs-on: ubuntu-20.04
8-
9-
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v2
12-
13-
- name: Setup PHP
14-
uses: shivammathur/setup-php@v2
15-
with:
16-
php-version: 8.1
17-
coverage: none
18-
tools: phpstan:0.12.92, cs2pr
19-
20-
- name: Download dependencies
21-
uses: ramsey/composer-install@v1
22-
23-
- name: PHPStan
24-
run: phpstan analyze --no-progress --error-format=checkstyle | cs2pr
25-
26-
php-cs-fixer:
27-
name: PHP-CS-Fixer
28-
runs-on: ubuntu-20.04
29-
30-
steps:
31-
- name: Checkout code
32-
uses: actions/checkout@v2
33-
34-
- name: Setup PHP
35-
uses: shivammathur/setup-php@v2
36-
with:
37-
php-version: 8.1
38-
coverage: none
39-
tools: php-cs-fixer:3.9.5, cs2pr
40-
41-
- name: PHP-CS-Fixer
42-
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
43-
44-
psalm:
45-
name: Psalm
46-
runs-on: ubuntu-20.04
47-
steps:
48-
- name: Checkout code
49-
uses: actions/checkout@v2
50-
51-
- name: Setup PHP
52-
uses: shivammathur/setup-php@v2
53-
with:
54-
php-version: 8.0
55-
coverage: none
56-
tools: vimeo/psalm:4.8.1
57-
58-
- name: Download dependencies
59-
uses: ramsey/composer-install@v1
60-
61-
- name: Psalm
62-
run: psalm --no-progress --output-format=github
63-
64-
65-
roave-bc-check:
66-
name: Roave BC Check
67-
runs-on: ubuntu-latest
68-
69-
steps:
70-
- name: Checkout code
71-
uses: actions/checkout@v2
72-
73-
composer-normalize:
74-
name: Composer Normalize
75-
runs-on: ubuntu-20.04
76-
77-
steps:
78-
- name: Setup PHP
79-
uses: shivammathur/setup-php@v2
80-
with:
81-
php-version: 8.1
82-
coverage: none
83-
tools: composer-normalize
84-
85-
- name: Checkout code
86-
uses: actions/checkout@v2
87-
88-
- name: Normalize
89-
run: composer-normalize --dry-run
5+
phpstan:
6+
name: PHPStan
7+
runs-on: 'ubuntu-latest'
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.1
17+
coverage: none
18+
tools: phpstan:0.12.92, cs2pr
19+
20+
- name: Download dependencies
21+
uses: ramsey/composer-install@v1
22+
23+
- name: PHPStan
24+
run: phpstan analyze --no-progress --error-format=checkstyle | cs2pr
25+
26+
php-cs-fixer:
27+
name: PHP-CS-Fixer
28+
runs-on: 'ubuntu-latest'
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: 8.1
38+
coverage: none
39+
tools: php-cs-fixer:3.9.5, cs2pr
40+
41+
- name: PHP-CS-Fixer
42+
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
43+
44+
psalm:
45+
name: Psalm
46+
runs-on: 'ubuntu-latest'
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v4
50+
51+
- name: Setup PHP
52+
uses: shivammathur/setup-php@v2
53+
with:
54+
php-version: 8.0
55+
coverage: none
56+
tools: vimeo/psalm:4.8.1
57+
58+
- name: Download dependencies
59+
uses: ramsey/composer-install@v1
60+
61+
- name: Psalm
62+
run: psalm --no-progress --output-format=github
63+
64+
roave-bc-check:
65+
name: Roave BC Check
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout@v2
71+
72+
composer-normalize:
73+
name: Composer Normalize
74+
runs-on: ubuntu-20.04
75+
steps:
76+
- name: Setup PHP
77+
uses: shivammathur/setup-php@v2
78+
with:
79+
php-version: 8.1
80+
coverage: none
81+
tools: composer-normalize
82+
83+
- name: Checkout code
84+
uses: actions/checkout@v4
85+
86+
- name: Normalize
87+
run: composer-normalize --dry-run

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
## 4.3.0
6+
- End of support php 7.3
7+
- Updated properties and added types to the classes properties
8+
- Update code style
9+
- Add missed field into IndexResponse for Webhooks
10+
- Fixed template search filters
11+
- Fixed tags API endpoints
12+
- Added new API endpoints
13+
514
## 4.2.0
615
- Added basic templates functionality
716

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ curl -sS https://getcomposer.org/installer | php
2020
```
2121

2222
## Required minimum php version
23-
- minimum php version 7.3
23+
- minimum php version 7.4
2424

2525
The Mailgun API Client is not hard coupled to Guzzle, Buzz or any other library that sends
2626
HTTP messages. Instead, it uses the [PSR-18](https://www.php-fig.org/psr/psr-18/) client abstraction.

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
}
1010
],
1111
"require": {
12-
"php": "^7.3 || ^8.0",
12+
"php": "^7.4 || ^8.0",
1313
"php-http/client-common": "^2.2.1",
1414
"php-http/discovery": "^1.19",
1515
"php-http/multipart-stream-builder": "^1.1.2",
1616
"psr/http-client": "^1.0",
1717
"webmozart/assert": "^1.9.1"
1818
},
1919
"require-dev": {
20+
"ergebnis/composer-normalize": "^2.43",
2021
"nyholm/nsa": "^1.2.1",
2122
"nyholm/psr7": "^1.3.1",
23+
"phpcompatibility/php-compatibility": "^9.3",
2224
"phpunit/phpunit": "^9.3",
2325
"squizlabs/php_codesniffer": "^3.7",
2426
"symfony/http-client": "^5.4 || ^6.3",
@@ -28,6 +30,7 @@
2830
"nyholm/psr7": "PSR-7 message implementation",
2931
"symfony/http-client": "HTTP client"
3032
},
33+
"prefer-stable": true,
3134
"autoload": {
3235
"psr-4": {
3336
"Mailgun\\": "src/"
@@ -40,6 +43,7 @@
4043
},
4144
"config": {
4245
"allow-plugins": {
46+
"ergebnis/composer-normalize": true,
4347
"php-http/discovery": true
4448
}
4549
},
@@ -49,6 +53,8 @@
4953
}
5054
},
5155
"scripts": {
56+
"post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",
57+
"post-update-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",
5258
"test": "vendor/bin/phpunit"
5359
}
5460
}

src/Api/Suppression/Bounce.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Mailgun\Api\HttpApi;
1515
use Mailgun\Api\Pagination;
1616
use Mailgun\Assert;
17-
use Mailgun\Exception\InvalidArgumentException;
1817
use Mailgun\Model\Suppression\Bounce\CreateResponse;
1918
use Mailgun\Model\Suppression\Bounce\DeleteResponse;
2019
use Mailgun\Model\Suppression\Bounce\IndexResponse;

src/Mailgun.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Mailgun
4545
/**
4646
* @var string|null
4747
*/
48-
private $apiKey;
48+
private ?string $apiKey;
4949

5050
/**
5151
* @var ClientInterface|PluginClient
@@ -55,19 +55,19 @@ class Mailgun
5555
/**
5656
* @var Hydrator
5757
*/
58-
private $hydrator;
58+
private Hydrator $hydrator;
5959

6060
/**
6161
* @var RequestBuilder
6262
*/
63-
private $requestBuilder;
63+
private RequestBuilder $requestBuilder;
6464

6565
/**
6666
* This is a object that holds the last response from the API.
6767
*
6868
* @var History
6969
*/
70-
private $responseHistory;
70+
private History $responseHistory;
7171

7272
/**
7373
* @param HttpClientConfigurator $configurator

src/Message/BatchMessage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@ class BatchMessage extends MessageBuilder
2828
/**
2929
* @var array
3030
*/
31-
private $batchRecipientAttributes = [];
31+
private array $batchRecipientAttributes = [];
3232

3333
/**
3434
* @var bool
3535
*/
36-
private $autoSend;
36+
private bool $autoSend;
3737

3838
/**
3939
* @var array
4040
*/
41-
private $messageIds = [];
41+
private array $messageIds = [];
4242

4343
/**
4444
* @var string
4545
*/
46-
private $domain;
46+
private string $domain;
4747

4848
/**
4949
* @var Message
5050
*/
51-
private $api;
51+
private Message $api;
5252

5353
/**
5454
* @param Message $messageApi

src/Message/MessageBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ class MessageBuilder
3636
/**
3737
* @var array
3838
*/
39-
protected $message = [];
39+
protected array $message = [];
4040

4141
/**
4242
* @var array
4343
*/
44-
protected $variables = [];
44+
protected array $variables = [];
4545

4646
/**
4747
* @var array
4848
*/
49-
protected $counters = [
49+
protected array $counters = [
5050
'recipients' => [
5151
'to' => 0,
5252
'cc' => 0,

0 commit comments

Comments
 (0)