From 0d8ccdebcf6eccfc955201f204e747d9b38ef078 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Mon, 25 Nov 2024 18:20:13 +0500 Subject: [PATCH] chore: bump daves-email-validation-tool from 0.1.5 to 1.2.0 (#1) --- composer.json | 17 ++++++++++++++--- src/TempmailValidator.php | 2 +- tests/{ => Ely/Yii2}/TempmailValidatorTest.php | 14 ++++++++------ 3 files changed, 23 insertions(+), 10 deletions(-) rename tests/{ => Ely/Yii2}/TempmailValidatorTest.php (84%) diff --git a/composer.json b/composer.json index 206a445..94db069 100644 --- a/composer.json +++ b/composer.json @@ -16,13 +16,19 @@ } ], "require": { - "php": ">=7", + "php": ">=7.1", "yiisoft/yii2": "*", - "daveearley/daves-email-validation-tool": "^0.1.5" + "daveearley/daves-email-validation-tool": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "~4.8 || ~5.0" + "phpunit/phpunit": "^9.6" }, + "repositories": [ + { + "type": "composer", + "url": "https://asset-packagist.org" + } + ], "autoload": { "psr-4": { "Ely\\Yii2\\": "src" @@ -30,5 +36,10 @@ }, "scripts": { "test": "phpunit" + }, + "config": { + "allow-plugins": { + "yiisoft/yii2-composer": true + } } } diff --git a/src/TempmailValidator.php b/src/TempmailValidator.php index b04463b..d8015b0 100644 --- a/src/TempmailValidator.php +++ b/src/TempmailValidator.php @@ -19,7 +19,7 @@ class TempmailValidator extends Validator } } - protected function validateValue($value) + protected function validateValue($value): ?array { $validator = $this->buildValidator($value); $results = $validator->getValidationResults()->asArray(); diff --git a/tests/TempmailValidatorTest.php b/tests/Ely/Yii2/TempmailValidatorTest.php similarity index 84% rename from tests/TempmailValidatorTest.php rename to tests/Ely/Yii2/TempmailValidatorTest.php index d10cee5..fb9931d 100644 --- a/tests/TempmailValidatorTest.php +++ b/tests/Ely/Yii2/TempmailValidatorTest.php @@ -1,20 +1,21 @@ 'testapp', 'basePath' => __DIR__, - 'vendorPath' => __DIR__ . '/../vendor', + 'vendorPath' => __DIR__ . '/../../../vendor', ]); } @@ -43,14 +44,15 @@ class TempmailValidatorTest extends \PHPUnit_Framework_TestCase $this->assertSame('Email with custom message.', $model->getFirstError('email')); } - private function createDummyModel(string $customMessage = null) { + private function createDummyModel(string $customMessage = null): Model + { return new class(['customMessage' => $customMessage]) extends Model { public $email; public $customMessage; - public function rules() + public function rules(): array { return [ [['email'], TempmailValidator::class, 'message' => $this->customMessage],