Skip to content

Commit 6f15c8c

Browse files
committed
feat: 增强验证器功能,支持自定义错误消息和规则组合
- 在ValidationAspect中添加自定义错误消息的支持,允许用户定义验证失败时的反馈信息 - 更新RuleParser,支持规则组合功能,允许多个规则同时应用于同一字段 - 优化相关测试用例,确保新功能的正确性和稳定性
1 parent 4da25f5 commit 6f15c8c

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: ['8.1', '8.2', '8.3']
17+
18+
name: PHP ${{ matrix.php }}
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
extensions: swoole, json, mbstring, pcntl
29+
coverage: none
30+
tools: composer:v2
31+
32+
- name: Get Composer cache directory
33+
id: composer-cache
34+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
35+
36+
- name: Cache Composer dependencies
37+
uses: actions/cache@v4
38+
with:
39+
path: ${{ steps.composer-cache.outputs.dir }}
40+
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
41+
restore-keys: |
42+
${{ runner.os }}-php-${{ matrix.php }}-composer-
43+
44+
- name: Install dependencies
45+
run: composer install --prefer-dist --no-progress --no-interaction
46+
47+
- name: Run tests
48+
run: vendor/bin/phpunit --colors=always
49+
50+
code-style:
51+
runs-on: ubuntu-latest
52+
name: Code Style
53+
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Setup PHP
59+
uses: shivammathur/setup-php@v2
60+
with:
61+
php-version: '8.2'
62+
tools: composer:v2
63+
64+
- name: Install dependencies
65+
run: composer install --prefer-dist --no-progress --no-interaction
66+
67+
- name: Check syntax
68+
run: find src -name "*.php" -exec php -l {} \; | grep -v "No syntax errors"

0 commit comments

Comments
 (0)