Tinywan\Validate\Validate::extend() 报错

tzbob888

问题描述

这里详细描述问题
webman composer update 的时候报错,修改后才能正常启动,版本php 8.4.3
大佬能否更新一下对php8.1以上的支持呀

程序代码

这里粘代码

public function extend(string $type, ?callable $callback = null, ?string $message = null): Validate
{
$this->type[$type] = $callback;

    if ($message !== null) {
        $this->typeMsg[$type] = $message;
    }

    return $this;
}

/**
 * 设置验证规则的默认提示信息
 * @access public
 * @param string|array $type 验证规则类型名称或者数组
 * @param string|null $msg 验证提示信息
 * @return void
 */
public function setTypeMsg($type, ?string $msg = null): void
{
    if (is_array($type)) {
        $this->typeMsg = array_merge($this->typeMsg, $type);
    } else {
        $this->typeMsg[$type] = $msg;
    }
}

报错信息

#11 {main}
process C:\www1\kw_shop\runtime\windows\start_webman.php terminated and try to restart
process C:\www1\kw_shop\runtime\windows\start_monitor.php terminated and try to restart
process C:\www1\kw_shop\runtime\windows\start_plugin.tinywan.rpc.text.protocol.php terminated and try to restart
webman                                          http://0.0.0.0:8787                 1           [ok]
monitor                                         none                                1           [ok]
plugin.tinywan.rpc.text.protocol                text://0.0.0.0:9512                 1           [ok]
ErrorException: Tinywan\Validate\Validate::extend(): Implicitly marking parameter $callback as nullable is deprecated, the explicit nullable type must be used instead in C:\www1\kw_shop\vendor\tinywan\validate\s
rc\Validate.php:274
Stack trace:
#0 C:\www1\kw_shop\vendor\composer\ClassLoader.php(576): {closure:C:\www1\kw_shop\support\bootstrap.php:31}(8192, 'Tinywan\\Validat...', 'C:\\www1\\kw_shop...', 274)
#1 C:\www1\kw_shop\vendor\composer\ClassLoader.php(576): include()
#2 C:\www1\kw_shop\vendor\composer\ClassLoader.php(427): {closure:Composer\Autoload\ClassLoader::initializeIncludeClosure():575}('C:\\www1\\kw_shop...')
#3 C:\www1\kw_shop\vendor\tinywan\validate\src\Facade\Validate.php(88): Composer\Autoload\ClassLoader->loadClass('Tinywan\\Validat...')
#4 C:\www1\kw_shop\support\bootstrap.php(115): Tinywan\Validate\Facade\Validate::start(Object(Workerman\Worker))
#5 C:\www1\kw_shop\vendor\workerman\webman-framework\src\support\helpers.php(550): require_once('C:\\www1\\kw_shop...')
#6 C:\www1\kw_shop\vendor\workerman\workerman\src\Worker.php(2544): {closure:worker_start():549}(Object(Workerman\Worker))
#7 C:\www1\kw_shop\vendor\workerman\workerman\src\Worker.php(1593): Workerman\Worker->run()
#8 C:\www1\kw_shop\vendor\workerman\workerman\src\Worker.php(1519): Workerman\Worker::forkWorkersForWindows()
#9 C:\www1\kw_shop\vendor\workerman\workerman\src\Worker.php(585): Workerman\Worker::forkWorkers()
#10 C:\www1\kw_shop\runtime\windows\start_webman.php(33): Workerman\Worker::runAll()

#11 {main}
ErrorException: Tinywan\Validate\Validate::setTypeMsg(): Implicitly marking parameter $msg as nullable is deprecated, the explicit nullable type must be used instead in C:\www1\kw_shop\vendor\tinywan\validate\sr
c\Validate.php:292
Stack trace:
#0 C:\www1\kw_shop\vendor\composer\ClassLoader.php(576): {closure:C:\www1\kw_shop\support\bootstrap.php:31}(8192, 'Tinywan\\Validat...', 'C:\\www1\\kw_shop...', 292)
#1 C:\www1\kw_shop\vendor\composer\ClassLoader.php(576): include()
#2 C:\www1\kw_shop\vendor\composer\ClassLoader.php(427): {closure:Composer\Autoload\ClassLoader::initializeIncludeClosure():575}('C:\\www1\\kw_shop...')
#3 C:\www1\kw_shop\vendor\tinywan\validate\src\Facade\Validate.php(88): Composer\Autoload\ClassLoader->loadClass('Tinywan\\Validat...')
#4 C:\www1\kw_shop\support\bootstrap.php(115): Tinywan\Validate\Facade\Validate::start(Object(Workerman\Worker))
#5 C:\www1\kw_shop\vendor\workerman\webman-framework\src\support\helpers.php(550): require_once('C:\\www1\\kw_shop...')
#6 C:\www1\kw_shop\vendor\workerman\workerman\src\Worker.php(2544): {closure:worker_start():549}(Object(Workerman\Worker))
#7 C:\www1\kw_shop\vendor\workerman\workerman\src\Worker.php(1593): Workerman\Worker->run()
#8 C:\www1\kw_shop\vendor\workerman\workerman\src\Worker.php(1519): Workerman\Worker::forkWorkersForWindows()
#9 C:\www1\kw_shop\vendor\workerman\workerman\src\Worker.php(585): Workerman\Worker::forkWorkers()
#10 C:\www1\kw_shop\runtime\windows\start_plugin.tinywan.rpc.text.protocol.php(33): Workerman\Worker::runAll()

截图报错信息里报错文件相关代码

截图

操作系统及workerman/webman等框架组件具体版本

composer update
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 38 installs, 0 updates, 0 removals

  • Downloading sebastian/comparator (6.3.0)
  • Downloading sebastian/code-unit (3.0.2)
  • Downloading nikic/php-parser (v5.4.0)
  • Downloading phpunit/php-code-coverage (11.0.8)
  • Downloading phpunit/phpunit (11.5.3)
  • Downloading workerman/workerman (v5.0.0)
  • Downloading workerman/webman-framework (v1.6.14)
  • Downloading firebase/php-jwt (v6.10.2)
  • Downloading tinywan/jwt (v1.10.1)
  • Downloading tinywan/validate (v1.0.2)
  • Installing psr/log (3.0.2): Extracting archive
  • Installing monolog/monolog (2.10.0): Extracting archive
  • Installing staabm/side-effects-detector (1.0.5): Extracting archive
  • Installing sebastian/version (5.0.2): Extracting archive
  • Installing sebastian/type (5.1.0): Extracting archive
  • Installing sebastian/recursion-context (6.0.2): Extracting archive
  • Installing sebastian/object-reflector (4.0.1): Extracting archive
  • Installing sebastian/object-enumerator (6.0.1): Extracting archive
  • Installing sebastian/global-state (7.0.2): Extracting archive
  • Installing sebastian/exporter (6.3.0): Extracting archive
  • Installing sebastian/environment (7.2.0): Extracting archive
  • Installing sebastian/diff (6.0.2): Extracting archive
  • Installing sebastian/comparator (6.3.0): Extracting archive
  • Installing sebastian/code-unit (3.0.2): Extracting archive
  • Installing sebastian/cli-parser (3.0.2): Extracting archive
  • Installing phpunit/php-timer (7.0.1): Extracting archive
  • Installing phpunit/php-text-template (4.0.1): Extracting archive
  • Installing phpunit/php-invoker (5.0.1): Extracting archive
  • Installing phpunit/php-file-iterator (5.1.0): Extracting archive
  • Installing theseer/tokenizer (1.2.3): Extracting archive
  • Installing nikic/php-parser (v5.4.0): Extracting archive
  • Installing sebastian/lines-of-code (3.0.1): Extracting archive
  • Installing sebastian/complexity (4.0.1): Extracting archive
  • Installing sebastian/code-unit-reverse-lookup (4.0.1): Extracting archive
  • Installing phpunit/php-code-coverage (11.0.8): Extracting archive
  • Installing phar-io/version (3.2.1): Extracting archive
  • Installing phar-io/manifest (2.0.4): Extracting archive
  • Installing myclabs/deep-copy (1.12.1): Extracting archive
  • Installing phpunit/phpunit (11.5.3): Extracting archive
  • Installing workerman/workerman (v5.0.0): Extracting archive
  • Installing psr/container (2.0.2): Extracting archive
  • Installing nikic/fast-route (v1.3.0): Extracting archive
  • Installing workerman/webman-framework (v1.6.14): Extracting archive
  • Installing firebase/php-jwt (v6.10.2): Extracting archive
  • Installing tinywan/jwt (v1.10.1): Extracting archive
  • Installing tinywan/exception-handler (v1.5.4): Extracting archive
  • Installing tinywan/rpc (v1.3.0): Extracting archive
  • Installing tinywan/validate (v1.0.2): Extracting archive
33 1 0
1个回答

Tinywan

你可以提交一个PR.哈

  • 暂无评论
×
🔝