mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-25 14:26:04 +03:00
PHP 8.x support (#727)
* Set dependencies for 7.3 and 8.x * Set GitHub Actions for PHP 7.3, 7.4 and 8.0 * Set Ubuntu version that supports PHP from 7.1 to 7.4 According to warnings raised by GitHub Actions, the alias for the latest Ubuntu version will upgrade soon to the newer 20.04 LTS instead of 18.04. Aiming to ensure the compatibility with previous PHP versions, it's safer to force the Ubuntu 18.04 that has the previous PHP version as built-in versions in the OS https://github.com/marketplace/actions/setup-php-action#github-hosted-runners * Fix dependencies for PHP ^7.3 and ^8.0 support * Run test suite with PHP versions from 7.3 to 8.1 * Broken Prophecy dependency for PHPUnit on PHP 8.1 This broken dependency doesn't allow us to run PHPUnit tests and ensure it works. Keeping the ^8.0 version should allow installations for non-maintainers on newer versions too. https://packagist.org/packages/phpspec/prophecy#1.12.2 requires - php: ^7.2 || ~8.0, <8.1 - ... * Use the latest Ubuntu version instead of a specific version * Prepare Changelog for PHP 8.0
This commit is contained in:
parent
a084abdb86
commit
66fd858a02
7
.github/workflows/php.yml
vendored
7
.github/workflows/php.yml
vendored
@ -11,8 +11,9 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
# https://github.com/marketplace/actions/setup-php-action#github-hosted-runners
|
||||
operating-system: [ 'ubuntu-latest' ]
|
||||
php-versions: [ '7.1', '7.2', '7.3', '7.4' ]
|
||||
php-versions: [ '7.3', '7.4', '8.0' ]
|
||||
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
|
||||
@ -37,13 +38,13 @@ jobs:
|
||||
run: composer test
|
||||
|
||||
- name: PHP Stan
|
||||
if: matrix.php-versions == '7.1'
|
||||
if: matrix.php-versions == '7.3'
|
||||
run: |
|
||||
phpstan --version
|
||||
phpstan analyse
|
||||
|
||||
- name: Scrunitizer CI
|
||||
if: matrix.php-versions == '7.1'
|
||||
if: matrix.php-versions == '7.3'
|
||||
run: |
|
||||
wget https://scrutinizer-ci.com/ocular.phar
|
||||
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ composer.lock
|
||||
phpunit.phar
|
||||
phpunit.xml
|
||||
modd.conf
|
||||
.phpunit.result.cache
|
||||
|
10
CHANGELOG.md
10
CHANGELOG.md
@ -2,6 +2,16 @@
|
||||
|
||||
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Support for PHP 8.x
|
||||
|
||||
### Removed
|
||||
|
||||
- Support for PHP 7.1 and 7.2 as they both have reached their end of life
|
||||
|
||||
## 3.2.0
|
||||
|
||||
### Added
|
||||
|
@ -2,18 +2,18 @@
|
||||
"name": "mailgun/mailgun-php",
|
||||
"description": "The Mailgun SDK provides methods for all API functions.",
|
||||
"require": {
|
||||
"php": "^7.1",
|
||||
"psr/http-client": "^1.0",
|
||||
"php-http/multipart-stream-builder": "^1.0",
|
||||
"php-http/client-common": "^1.9 || ^2.0",
|
||||
"php-http/discovery": "^1.6",
|
||||
"webmozart/assert": "^1.6"
|
||||
"php": "^7.3 || ^8.0",
|
||||
"psr/http-client": "^1.0.1",
|
||||
"php-http/multipart-stream-builder": "^1.1.2",
|
||||
"php-http/client-common": "^2.2.1",
|
||||
"php-http/discovery": "^1.9.1",
|
||||
"webmozart/assert": "^1.9.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7.5",
|
||||
"php-http/guzzle6-adapter": "^1.0 || ^2.0",
|
||||
"nyholm/psr7": "^1.0",
|
||||
"nyholm/nsa": "^1.1"
|
||||
"phpunit/phpunit": "^9.3",
|
||||
"php-http/guzzle7-adapter": "^0.1.1",
|
||||
"nyholm/psr7": "^1.3.1",
|
||||
"nyholm/nsa": "^1.2.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Mailgun\Tests\Api;
|
||||
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Mailgun\Exception\InvalidArgumentException;
|
||||
use Mailgun\Hydrator\ModelHydrator;
|
||||
use Mailgun\Model\Stats\TotalResponse;
|
||||
use Mailgun\Model\Stats\TotalResponseItem;
|
||||
@ -44,11 +45,10 @@ class StatsTest extends TestCase
|
||||
$this->assertContainsOnlyInstancesOf(TotalResponseItem::class, $total->getStats());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Mailgun\Exception\InvalidArgumentException
|
||||
*/
|
||||
public function testTotalInvalidArgument()
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
|
||||
$api = $this->getApiMock();
|
||||
$api->total('');
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
|
||||
|
||||
private $hydrateClass;
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->reset();
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class RequestBuilderTest extends MailgunTestCase
|
||||
/**
|
||||
* Environment preset.
|
||||
*/
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@ -61,7 +61,7 @@ class RequestBuilderTest extends MailgunTestCase
|
||||
/**
|
||||
* Environment reset.
|
||||
*/
|
||||
protected function tearDown()
|
||||
protected function tearDown(): void
|
||||
{
|
||||
parent::tearDown();
|
||||
|
||||
|
@ -25,7 +25,7 @@ class BatchMessageTest extends MailgunTestCase
|
||||
*/
|
||||
private $batchMessage;
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
$messageApi = $this->getMockBuilder(Message::class)
|
||||
->disableOriginalConstructor()
|
||||
|
@ -22,7 +22,7 @@ class MessageBuilderTest extends MailgunTestCase
|
||||
*/
|
||||
private $messageBuilder;
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->messageBuilder = new MessageBuilder();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user