just-joni/test-for-feip

dev-main 2022-09-02 08:16 UTC

This package is not auto-updated.

Last update: 2024-09-27 17:55:59 UTC


README

FEIP 测试

使用示例

1. 检查数据是否符合 integer, string, array (数组内部只能有 integer 类型的元素,以及 id, type 键的 struct (关联数组) 类型

$app = new TestForFeip\Cleaner;

$result = $app->startClean('{"foo": 123, "bar": 123, "baz": [ 5001, 123,5002,456,5003,789], "gaz": { "id": "5004", "type": "Maple" } }', ['TInt','TString','TArray:TInt','TStruct:id,type']);

2. 检查数据是否符合 float 和 tel_number_ru (俄罗斯联邦的手机号码) 类型

$app = new TestForFeip\Cleaner;

$result = $app->startClean('{"foo": 1.3, "bar": 123}', ['TFloat','TTelNumberRU']);