diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4a04bd..a8e9327 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/README.md b/README.md index c3363d8..5a0554f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/composer.json b/composer.json index 4c69df8..aff62fc 100644 --- a/composer.json +++ b/composer.json @@ -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" }, @@ -32,10 +32,10 @@ "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", @@ -43,7 +43,8 @@ }, "config": { "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true + "dealerdirect/phpcodesniffer-composer-installer": true, + "php-http/discovery": true } } } diff --git a/src/Context/Initializer/MailhogAwareInitializer.php b/src/Context/Initializer/MailhogAwareInitializer.php index e5bff79..cafc57b 100644 --- a/src/Context/Initializer/MailhogAwareInitializer.php +++ b/src/Context/Initializer/MailhogAwareInitializer.php @@ -10,10 +10,7 @@ final class MailhogAwareInitializer implements ContextInitializer { - /** - * @var MailhogClient - */ - private $client; + private MailhogClient $client; public function __construct(MailhogClient $client) { diff --git a/src/Context/Initializer/OpenedEmailStorageContextInitializer.php b/src/Context/Initializer/OpenedEmailStorageContextInitializer.php index 73c7af3..ac2487c 100644 --- a/src/Context/Initializer/OpenedEmailStorageContextInitializer.php +++ b/src/Context/Initializer/OpenedEmailStorageContextInitializer.php @@ -10,10 +10,7 @@ final class OpenedEmailStorageContextInitializer implements ContextInitializer { - /** - * @var OpenedEmailStorage - */ - private $openedEmailStorage; + private OpenedEmailStorage $openedEmailStorage; public function __construct(OpenedEmailStorage $openedEmailStorage) { diff --git a/src/Context/MailhogContext.php b/src/Context/MailhogContext.php index 2a1c138..7b98374 100644 --- a/src/Context/MailhogContext.php +++ b/src/Context/MailhogContext.php @@ -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[] diff --git a/src/Listener/EmailPurgeListener.php b/src/Listener/EmailPurgeListener.php index 2756a6c..ddded3d 100644 --- a/src/Listener/EmailPurgeListener.php +++ b/src/Listener/EmailPurgeListener.php @@ -13,10 +13,7 @@ final class EmailPurgeListener implements EventSubscriberInterface { - /** - * @var MailhogClient - */ - private $client; + private MailhogClient $client; /** * The tag name for scenarios/features that trigger diff --git a/src/Service/OpenedEmailStorage.php b/src/Service/OpenedEmailStorage.php index f7ec32f..caa97b6 100644 --- a/src/Service/OpenedEmailStorage.php +++ b/src/Service/OpenedEmailStorage.php @@ -8,10 +8,7 @@ final class OpenedEmailStorage { - /** - * @var ?Message - */ - private $openedEmail; + private ?Message $openedEmail = null; public function setOpenedEmail(Message $message): void { diff --git a/tests/Listener/EmailPurgeListenerTest.php b/tests/Listener/EmailPurgeListenerTest.php index 7789fe2..d81a108 100644 --- a/tests/Listener/EmailPurgeListenerTest.php +++ b/tests/Listener/EmailPurgeListenerTest.php @@ -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 { diff --git a/tests/Service/OpenedEmailStorageTest.php b/tests/Service/OpenedEmailStorageTest.php index 0ca0a88..6186db0 100644 --- a/tests/Service/OpenedEmailStorageTest.php +++ b/tests/Service/OpenedEmailStorageTest.php @@ -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; @@ -68,7 +69,8 @@ public function getMessage(): Message new ContactCollection([]), 'Test e-mail', 'Hello there!', - [] + [], + new Headers([]), ); } } diff --git a/tests/ServiceContainer/MailhogExtensionTest.php b/tests/ServiceContainer/MailhogExtensionTest.php index d0c7f29..719e9ba 100644 --- a/tests/ServiceContainer/MailhogExtensionTest.php +++ b/tests/ServiceContainer/MailhogExtensionTest.php @@ -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 {