diff --git a/composer.json b/composer.json index 7e8ae11..5834444 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ } }, "require": { - "php": ">=7.3", + "php": ">=7.4", "ext-json": "*", "ext-simplexml": "*", "ext-swoole": ">=4.5", @@ -39,7 +39,8 @@ "hyperf/event": "~2.2.0", "hyperf/framework": "~2.2.0", "hyperf/guzzle": "~2.2.0", - "hyperf/logger": "~2.2.0" + "hyperf/logger": "~2.2.0", + "hyperf/validation": "^2.2" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", diff --git a/src/Drivers/TwilioDriver.php b/src/Drivers/TwilioDriver.php index a7f82e7..a64ab15 100644 --- a/src/Drivers/TwilioDriver.php +++ b/src/Drivers/TwilioDriver.php @@ -1,13 +1,7 @@ stack; } diff --git a/src/Listeners/ValidatorFactoryResolvedListener.php b/src/Listeners/ValidatorFactoryResolvedListener.php index 38d866a..1cde0dd 100644 --- a/src/Listeners/ValidatorFactoryResolvedListener.php +++ b/src/Listeners/ValidatorFactoryResolvedListener.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Zyimm\Sms\Listeners; use Hyperf\Event\Contract\ListenerInterface; +use Hyperf\Validation\Contract\ValidatorFactoryInterface; use Hyperf\Validation\Event\ValidatorFactoryResolved; use Zyimm\Sms\MobileNumber; use LogicException; @@ -21,7 +22,7 @@ class ValidatorFactoryResolvedListener implements ListenerInterface public function process(object $event) { - /** @var \Hyperf\Validation\Contract\ValidatorFactoryInterface $validatorFactory */ + /** @var ValidatorFactoryInterface $validatorFactory */ $validatorFactory = $event->validatorFactory; $validatorFactory->extend('mobile_number', function ($attribute, $value, $parameters, $validator) { diff --git a/src/Rules/MobileNumber.php b/src/Rules/MobileNumber.php index 1c98373..abbe5ef 100644 --- a/src/Rules/MobileNumber.php +++ b/src/Rules/MobileNumber.php @@ -9,7 +9,7 @@ class MobileNumber /** * @var string[] */ - protected $regionCodes; + protected array $regionCodes; /** * Create a new in rule instance. diff --git a/src/Sms.php b/src/Sms.php index 6e6a73d..964322f 100644 --- a/src/Sms.php +++ b/src/Sms.php @@ -11,11 +11,11 @@ declare(strict_types=1); namespace Zyimm\Sms; use Hyperf\Utils\ApplicationContext; -use Zyimm\Sms\Contract\HasMailAddress; +use HyperfExt\Contract\HasMailAddress; use Zyimm\Sms\Contracts\SmsManagerInterface; /** - * @method static \Zyimm\Sms\PendingSms to(HasMailAddress|string $number, null|int|string $defaultRegion = null) + * @method static PendingSms to(HasMailAddress|string $number, null|int|string $defaultRegion = null) */ class Sms { @@ -26,7 +26,7 @@ class Sms return $instance->{$method}(...$args); } - public static function sender(string $name) + public static function sender(string $name): PendingSms { return (new PendingSms(static::getManager()))->sender($name); }