Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

验证器无法验证数组 #517

Open
mengzhuowei opened this issue Nov 29, 2021 · 2 comments
Open

验证器无法验证数组 #517

mengzhuowei opened this issue Nov 29, 2021 · 2 comments

Comments

@mengzhuowei
Copy link

image
image
image

@XueSiLf
Copy link
Collaborator

XueSiLf commented Nov 30, 2021

好的,这边测试下。感谢反馈。

@XueSiLf
Copy link
Collaborator

XueSiLf commented Nov 30, 2021

这边测试是可以验证的啊,请您提供详细的调用代码。
这边测试是ok的。

<?php

require_once __DIR__ . '/vendor/autoload.php';

$validate = new \EasySwoole\Validate\Validate();

$validate->addColumn('inputs')->isArray('not array!');
$bool = $validate->validate([
    'inputs' => [
        [
            'address' => '1',
            'amount' => '2'
        ],
        [
            'address' => '3',
            'amount' => '4'
        ],
    ]
]);
var_dump($bool); // true
var_dump($validate->getError()); // NULL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants