Skip to content

Commit

Permalink
Merge pull request #50 from rpkamp/php-support
Browse files Browse the repository at this point in the history
Drop support for PHP 7.2 and 7.3. Add support for PHP 8.1 and 8.2.
  • Loading branch information
Remon van de Kamp authored May 20, 2023
2 parents a7d0713 + 9e1f27b commit 51e5b93
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
ports:
- 3025:3025
- 10025:10025
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
name: Test
strategy:
fail-fast: false
matrix:
php: ["7.2", "7.3", "7.4", "8.0"]
php: ["7.4", "8.0", "8.1", "8.2"]
composer-flags: ["", "--prefer-lowest"]

steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mailhog Behat Extension ![Packagist Version](https://img.shields.io/packagist/v/rpkamp/mailhog-behat-extension)

A simple PHP (7.2+) [Behat] extension for [Mailhog][mailhog].
A simple PHP (7.4+) [Behat] extension for [Mailhog][mailhog].

## Installation

Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
},
"minimum-stability": "stable",
"require": {
"php": "^7.2 || ^8.0",
"php": "^7.4 || ^8.0",
"behat/behat": "^3.8.0",
"rpkamp/mailhog-client": "^0.5.2",
"rpkamp/mailhog-client": "^1.0",
"php-http/discovery": "^1.3",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0"
},
Expand All @@ -32,18 +32,19 @@
"php-parallel-lint/php-parallel-lint": "^1.2",
"php-http/curl-client": "^2.0",
"swiftmailer/swiftmailer": "^6.2",
"phpunit/phpunit": "^8.3.4",
"phpunit/phpunit": "^9.0",
"mockery/mockery": "^1.3.3",
"phpstan/phpstan": "^0.12.64",
"phpstan/phpstan-mockery": "^0.12.11",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-mockery": "^1.1",
"doctrine/coding-standard": "^8.0",
"egulias/email-validator": "^2.1.23",
"phpmd/phpmd": "^2.9.1",
"nyholm/psr7": "^1.3"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": true
}
}
}
5 changes: 1 addition & 4 deletions src/Context/Initializer/MailhogAwareInitializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

final class MailhogAwareInitializer implements ContextInitializer
{
/**
* @var MailhogClient
*/
private $client;
private MailhogClient $client;

public function __construct(MailhogClient $client)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

final class OpenedEmailStorageContextInitializer implements ContextInitializer
{
/**
* @var OpenedEmailStorage
*/
private $openedEmailStorage;
private OpenedEmailStorage $openedEmailStorage;

public function __construct(OpenedEmailStorage $openedEmailStorage)
{
Expand Down
11 changes: 2 additions & 9 deletions src/Context/MailhogContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,8 @@
*/
final class MailhogContext implements MailhogAwareContext, OpenedEmailStorageAwareContext
{
/**
* @var MailhogClient
*/
private $mailhogClient;

/**
* @var OpenedEmailStorage
*/
private $openedEmailStorage;
private MailhogClient $mailhogClient;
private OpenedEmailStorage $openedEmailStorage;

/**
* @return Specification[]
Expand Down
5 changes: 1 addition & 4 deletions src/Listener/EmailPurgeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@

final class EmailPurgeListener implements EventSubscriberInterface
{
/**
* @var MailhogClient
*/
private $client;
private MailhogClient $client;

/**
* The tag name for scenarios/features that trigger
Expand Down
5 changes: 1 addition & 4 deletions src/Service/OpenedEmailStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

final class OpenedEmailStorage
{
/**
* @var ?Message
*/
private $openedEmail;
private ?Message $openedEmail = null;

public function setOpenedEmail(Message $message): void
{
Expand Down
16 changes: 4 additions & 12 deletions tests/Listener/EmailPurgeListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,11 @@
final class EmailPurgeListenerTest extends MockeryTestCase
{
/**
* @var MockInterface|MailhogClient
* @var MailhogClient|MockInterface
*/
private $client;

/**
* @var EmailPurgeListener
*/
private $listener;

/**
* @var EventDispatcher
*/
private $dispatcher;
private MailhogClient $client;
private EmailPurgeListener $listener;
private EventDispatcher $dispatcher;

public function setUp(): void
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Service/OpenedEmailStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use rpkamp\Behat\MailhogExtension\Service\OpenedEmailStorage;
use rpkamp\Mailhog\Message\Contact;
use rpkamp\Mailhog\Message\ContactCollection;
use rpkamp\Mailhog\Message\Headers;
use rpkamp\Mailhog\Message\Message;
use RuntimeException;

Expand Down Expand Up @@ -68,7 +69,8 @@ public function getMessage(): Message
new ContactCollection([]),
'Test e-mail',
'Hello there!',
[]
[],
new Headers([]),
);
}
}
5 changes: 1 addition & 4 deletions tests/ServiceContainer/MailhogExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ final class MailhogExtensionTest extends TestCase
{
public const BASE_URL = 'http://localhost:10025/';

/**
* @var ContainerBuilder
*/
private $container;
private ContainerBuilder $container;

public function setUp(): void
{
Expand Down

0 comments on commit 51e5b93

Please sign in to comment.