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

添加setDefault,用来设置默认值,当有些字段不需要可填可不填,或者该字段用于某个控制器的固定值时可使用->setDefault() #1

Merged
merged 105 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
314aa36
Update list of top-level domains
TheRespectPanda Aug 23, 2020
5150428
Drop support for PHP 7.2
henriquemoody Aug 26, 2020
966c510
Update version of PHPUnit package
henriquemoody Aug 26, 2020
72dd881
Update version of "respect/coding-standard"
henriquemoody Aug 27, 2020
80ff37c
Configure continuous integration with GitHub actions
henriquemoody Aug 27, 2020
a65980c
Remove PHP 8.0 from the build matrix
henriquemoody Aug 27, 2020
f53b77a
Add support for PHP 8.0
henriquemoody Aug 27, 2020
2fad28b
Allow optional space for greek postal codes
rawganet Sep 1, 2020
e0c6f33
Only define filter_var options when it is valid
henriquemoody Oct 4, 2020
ed304f3
Check "bcmath" extension before executing tests
henriquemoody Oct 4, 2020
8b2819e
Auto-resolve exception namespaces
henriquemoody Oct 3, 2020
029fa7f
Remove "Key" prefix from KeyException message
Jul 5, 2019
ff253c7
Allow file-related rules to validate PSR-7 interfaces
v0idpwn Jun 6, 2019
444f105
Update list of top-level domains
TheRespectPanda Oct 4, 2020
1809e9f
Make "HexRgbColor" rule case-insensitive
henriquemoody Oct 4, 2020
d532e94
Create mixin with rules names as methods
henriquemoody Oct 4, 2020
6c3aed9
Create "Decimal" rule
henriquemoody Oct 4, 2020
1eb5b9d
Add "Decimal" link to related rules
henriquemoody Oct 5, 2020
5ba7646
Fix wrong changelog in the Decimal's documentation
henriquemoody Oct 5, 2020
44a60f6
Fix PHPStan issues
henriquemoody Feb 6, 2021
5a0b538
Update list of top-level domains
TheRespectPanda Jan 31, 2021
f1be730
Use the last MINOR version in updaters
henriquemoody Feb 6, 2021
9c9c76e
Use "sokil/php-isocodes" on SubdivisionCode
henriquemoody Feb 6, 2021
f9b9dd2
Use "sokil/php-isocodes" on CurrencyCode
henriquemoody Feb 6, 2021
5450ef8
Use "sokil/php-isocodes" on LanguageCode
henriquemoody Feb 6, 2021
2060207
Use "sokil/php-isocodes" on CountryCode
henriquemoody Feb 6, 2021
3dcd859
Upgrade supported version of "egulias/email-validator"
henriquemoody Feb 6, 2021
51ad23e
Call mbstring functions without getting encoding
henriquemoody Feb 6, 2021
143420e
Update list of top-level domains
TheRespectPanda Mar 14, 2021
be7e667
Remove ignored error from PHPStan
henriquemoody Mar 19, 2021
edbbe7f
Revert "Use "sokil/php-isocodes" on CountryCode"
henriquemoody Mar 19, 2021
b78f602
Revert "Use "sokil/php-isocodes" on LanguageCode"
henriquemoody Mar 19, 2021
745a571
Revert "Use "sokil/php-isocodes" on CurrencyCode"
henriquemoody Mar 19, 2021
4c21a7f
Revert "Use "sokil/php-isocodes" on SubdivisionCode"
henriquemoody Mar 19, 2021
6602941
IntVal: Validate negative numbers properly
l-x May 5, 2021
b8ee424
Allow 5- and 6-digit postal code for Cambodia
omega3000 Aug 27, 2021
4847fe4
Fix check whether start and end address have been set in Ip rule (#1375)
fabacino Jan 19, 2022
60566e2
Fix E_DEPRECATED warning in IntVal rule on PHP 8.1 (#1374)
fabacino Jan 19, 2022
bf4082d
fix phpdoc type for KeySet constructor (#1365)
voda Jan 19, 2022
e219da2
Add rule for validating portuguese fiscal numbers
goncalo-andrade Jun 8, 2022
5e264f9
Add documentation for portuguese fiscal number rule
goncalo-andrade Jun 8, 2022
c7a6f2e
Fix Decimal rule for float values > 10
scruwi Jun 29, 2022
c215761
Added RuPay card validation
rakshit087 Oct 22, 2022
0cd309d
PHPUnit tests for RuPay
rakshit087 Oct 22, 2022
1abf32c
Updated docs to include RuPay
rakshit087 Oct 22, 2022
746c755
Use `json_validate` in `Rules\Json` if available (#1394)
Ayesh Feb 13, 2023
15f148d
Dusting off. See CHANGELOG.md for more details on this commit
alganet Feb 13, 2023
8e345b7
Merge branch 'rupay-card-validation' into 2.2
alganet Feb 13, 2023
2951dfd
General fixes for PR#1392 (rupay card validation)
alganet Feb 13, 2023
e5223a0
Merge branch 'scruwi/master' into 2.2
alganet Feb 13, 2023
13f20e7
Merge branch 'rule/portuguese_nif_rule' into 2.2
alganet Feb 13, 2023
2c5793a
Updated CHANGELOG.md, small phpcs fixes
alganet Feb 13, 2023
74d7f03
Merge branch 'omega3000/master' into 2.2
alganet Feb 13, 2023
ecccfb8
Updated CHANGELOG.md
alganet Feb 13, 2023
3eb085a
Updated docs
alganet Feb 13, 2023
9ae39de
Updates for IntVal changes
alganet Feb 13, 2023
1481c8e
Updated docheaders
alganet Feb 13, 2023
d304ace
Final CHANGELOG for release 2.2.4
alganet Feb 15, 2023
1e96fd1
Update docs (and shiny badges)
alganet Feb 15, 2023
1e2f752
Change update_subdivision_codes to work with salsa/iso-codes, updates…
alganet Feb 15, 2023
74dee73
Update updater workflows, remove countries outside ISO-3366-2, cleanup
alganet Feb 15, 2023
8b3c607
Update peter-evans/create-pull-request@v4
alganet Feb 15, 2023
f080f7d
Improve auto-updaters and pull requesters, auto-tld fix
alganet Feb 15, 2023
a96614b
Bump codecov/codecov-action from 1 to 3 (#1398)
dependabot[bot] Feb 15, 2023
7776652
Bump actions/checkout from 2 to 3 (#1399)
dependabot[bot] Feb 15, 2023
c6eaf05
Update symfony/validator requirement from ^3.0||^4.0 to ^3.0||^4.0||^…
dependabot[bot] Feb 15, 2023
a3e016b
Fix docs links
alganet Feb 18, 2023
689026f
Improve FilterVar with FILTER_VALIDATE_* options
alganet Feb 16, 2023
ef4778b
Remove version info from Tld.php
alganet Feb 17, 2023
ab3732f
Use SPDX IDs for licensing
alganet Feb 17, 2023
8cafa3f
Drop PHP 7.4 support
alganet Feb 17, 2023
727e7cc
Increase phpstan level from 7 to 8
alganet Feb 18, 2023
493a665
Add a test/example of how to explore the exception tree
alganet Feb 18, 2023
fc8230a
Make KeySet impossible to wrap in not(), fix structure message
alganet Feb 18, 2023
cc3bf86
Use libphonenumber
alganet Feb 18, 2023
6173757
Use PHP files and setup a runtime cache for CountryInfo
alganet Feb 18, 2023
55290af
Add test cases for issue #665 to PhoneTest
alganet Feb 18, 2023
7e7c3f2
Tests and docs for IP range validation
alganet Feb 18, 2023
e2b6138
Add PublicDomainSuffix Rule
alganet Feb 19, 2023
ce9608d
Auto update postal code list
alganet Feb 19, 2023
154cccf
Add idn2 to gh workflow installs
alganet Feb 19, 2023
7c28d2c
Update sorting order on public suffix data
alganet Feb 19, 2023
5fe4b96
Stricter date format validation
alganet Feb 19, 2023
bae314d
Do not hide messages on EachException
alganet Feb 19, 2023
636906f
Fixed previously introduced bug, add integration test
alganet Feb 20, 2023
8f545c1
Ensure empty strings are never a valid currency code
alganet Feb 20, 2023
2080e0d
Update Regional Information (#1410)
github-actions[bot] Mar 9, 2023
508566e
Update list of rules in the chained validator (#1411)
henriquemoody Mar 10, 2023
afa4cc4
Increase test coverage for some rules (#1412)
dcorrea777 Mar 11, 2023
dd053f2
Update Regional Information (#1414)
github-actions[bot] Mar 19, 2023
830ad97
Fix the typo on the "Exists" rule's exception
henriquemoody Mar 22, 2023
003830b
Standardize exception messages
henriquemoody Mar 22, 2023
8a7bc1a
Improve readability of integration tests
henriquemoody Apr 1, 2023
e8fcdb6
Allow creating paths from fixture files
henriquemoody Apr 2, 2023
07c4095
Create stubs for PSR-7 interfaces
henriquemoody Apr 2, 2023
ee8dd98
Create class to help testing the Attribute rule
henriquemoody Apr 2, 2023
445af45
Create a class to help test the Callable rule
henriquemoody Apr 2, 2023
049b0b2
Do not use the test class to test the Callback rule
henriquemoody Apr 2, 2023
ebcf247
Do not use mocks to simulate a rule
henriquemoody Apr 2, 2023
2ee7509
Make data providers static
henriquemoody Apr 2, 2023
2a74396
Use a concrete class to test AbstractEnvelop
henriquemoody Apr 2, 2023
703f610
Update Regional Information
TheRespectPanda Jun 7, 2023
4aab1b6
添加setDefault,用来设置默认值,当有些字段不需要可填可不填,或者该字段用于某个控制器的固定值时可使用->setDefault()
596868636 Sep 9, 2023
6de3b42
强制设置默认值,有些字段不希望被前端传输的参数覆盖,可以使用->setDefault("默认值",true)
596868636 Sep 9, 2023
ae51b23
Merge branch '2.3'
596868636 Sep 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 2 additions & 6 deletions .docheader
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
*/
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
112 changes: 112 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Continuous Integration

on:
push:
paths-ignore:
- 'bin/**'
- 'docs/**'
pull_request:
paths-ignore:
- 'bin/**'
- 'docs/**'

jobs:
tests:
name: Tests

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
extensions: uopz
tools: pecl

- name: Install Localisation Files
run: |
sudo locale-gen --no-purge --lang nl_NL.UTF-8
sudo locale-gen --no-purge --lang pt_BR.UTF-8
sudo locale-gen --no-purge --lang ru_RU.UTF-8

- name: Install Dependencies
run: composer install --prefer-dist ${{ matrix.composer-extra-arguments }}

- name: Run Unit Tests
run: ./vendor/phpunit/phpunit/phpunit --testsuite=unit

- name: Run Integration Tests
run: ./vendor/phpunit/phpunit/phpunit --testsuite=integration

code-coverage:
name: Code coverage

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: pcov
extensions: uopz
tools: pecl

- name: Install Localisation Files
run: |
sudo locale-gen --no-purge --lang nl_NL.UTF-8
sudo locale-gen --no-purge --lang pt_BR.UTF-8
sudo locale-gen --no-purge --lang ru_RU.UTF-8

- name: Install Dependencies
run: composer install --prefer-dist ${{ matrix.composer-extra-arguments }}

- name: Generating Code Coverage Report
run: ./vendor/phpunit/phpunit/phpunit --coverage-clover=coverage.xml

- name: Send Code Coverage Report to Codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}

static-analysis:
name: Static Analysis

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none

- name: Install dependencies
run: composer install --prefer-dist

- name: Run DocHeader
run: vendor/bin/docheader check library/ tests/

- name: Run PHP_CodeSniffer
run: vendor/bin/phpcs

- name: Run PHPStan
run: vendor/bin/phpstan analyze
33 changes: 0 additions & 33 deletions .github/workflows/update-currency-codes.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/update-language-codes.yaml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/update-regionals.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update Regional Information

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
update-regional-information:
name: Update Regional Information

runs-on: ubuntu-latest

steps:
- name: Install xmlstarlet
run: sudo apt install xmlstarlet idn2

- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ secrets.LAST_MINOR_VERSION }}

- name: Update currency codes
run: bin/update-currency-codes

- name: Update language codes
run: bin/update-language-codes

- name: Update top level domains
run: bin/update-domain-toplevel

- name: Update public domain suffixes
run: bin/update-domain-suffixes

- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
committer: The Respect Panda <therespectpanda@gmail.com>
author: The Respect Panda <therespectpanda@gmail.com>
commit-message: Update Regional Information
title: Update Regional Information
base: ${{ secrets.LAST_MINOR_VERSION }}
branch: "workflows/update-regional-information"
30 changes: 0 additions & 30 deletions .github/workflows/update-tld.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.couscous/
.iso-codes-cache/
.phpcs.cache
.phpunit.result.cache
composer.lock
Makefile
phpcs.xml
Expand Down
42 changes: 0 additions & 42 deletions .php_cs

This file was deleted.

37 changes: 0 additions & 37 deletions .scrutinizer.yml

This file was deleted.