Skip to content

Commit 6205552

Browse files
Initial Commit
0 parents  commit 6205552

File tree

17 files changed

+1119
-0
lines changed

17 files changed

+1119
-0
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check & fix styling
2+
3+
on: [push]
4+
5+
jobs:
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
with:
13+
ref: ${{ github.head_ref }}
14+
15+
- name: Run PHP CS Fixer
16+
uses: docker://oskarstark/php-cs-fixer-ga
17+
with:
18+
args: --config=.php_cs.dist.php --allow-risky=yes
19+
20+
- name: Commit changes
21+
uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: Fix styling

.github/workflows/run-tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: run-tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
os: [ubuntu-latest]
12+
php: [8.1, 8.0, 7.4]
13+
laravel: [9.*, 8.*]
14+
dependency-version: [prefer-lowest, prefer-stable]
15+
include:
16+
- laravel: 9.*
17+
testbench: 7.*
18+
- laravel: 8.*
19+
testbench: ^6.23
20+
exclude:
21+
- laravel: 9.*
22+
php: 7.4
23+
24+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php }}
34+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
35+
coverage: none
36+
37+
- name: Setup problem matchers
38+
run: |
39+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
40+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
41+
42+
- name: Install dependencies
43+
run: |
44+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
45+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
46+
47+
- name: Execute tests
48+
run: vendor/bin/phpunit
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
update:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
with:
15+
ref: main
16+
17+
- name: Update Changelog
18+
uses: stefanzweifel/changelog-updater-action@v1
19+
with:
20+
latest-version: ${{ github.event.release.name }}
21+
release-notes: ${{ github.event.release.body }}
22+
23+
- name: Commit updated CHANGELOG
24+
uses: stefanzweifel/git-auto-commit-action@v4
25+
with:
26+
branch: main
27+
commit_message: Update CHANGELOG
28+
file_pattern: CHANGELOG.md

.php_cs.dist.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
])
8+
->name('*.php')
9+
->notName('*.blade.php')
10+
->ignoreDotFiles(true)
11+
->ignoreVCS(true);
12+
13+
return (new PhpCsFixer\Config())
14+
->setRules([
15+
'@PSR12' => true,
16+
'array_syntax' => ['syntax' => 'short'],
17+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
18+
'no_unused_imports' => true,
19+
'not_operator_with_successor_space' => true,
20+
'trailing_comma_in_multiline' => true,
21+
'phpdoc_scalar' => true,
22+
'unary_operator_spaces' => true,
23+
'binary_operator_spaces' => true,
24+
'blank_line_before_statement' => [
25+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
26+
],
27+
'phpdoc_single_line_var_spacing' => true,
28+
'phpdoc_var_without_name' => true,
29+
'class_attributes_separation' => [
30+
'elements' => [
31+
'method' => 'one',
32+
],
33+
],
34+
'method_argument_space' => [
35+
'on_multiline' => 'ensure_fully_multiline',
36+
'keep_multiple_spaces_after_comma' => true,
37+
],
38+
'single_trait_insert_per_statement' => true,
39+
])
40+
->setFinder($finder);

CHANGELOG.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Changelog
2+
3+
All notable changes to `laravel-validation-rules` will be documented in this file
4+
5+
## 3.2.1 - 2022-08-01
6+
7+
- fix chaining `doNotTrimItems`
8+
9+
## 3.2.0 - 2022-01-12
10+
11+
## What's Changed
12+
13+
- fix psr version by @iamfarhad in https://github.com/spatie/laravel-validation-rules/pull/50
14+
- Allow Laravel 9
15+
16+
## New Contributors
17+
18+
- @iamfarhad made their first contribution in https://github.com/spatie/laravel-validation-rules/pull/50
19+
20+
**Full Changelog**: https://github.com/spatie/laravel-validation-rules/compare/3.1.1...3.2.0
21+
22+
## 3.1.1 - 2021-08-15
23+
24+
- fix custom validation messages on delimited rule
25+
26+
## 3.1.0 - 2021-08-06
27+
28+
- add ISO4217 currency validation rule (#48)
29+
30+
## 3.0.0 - 2020-11-30
31+
32+
- move iso3166 package to `suggest`
33+
34+
## 2.7.1 - 2020-11-30
35+
36+
- add support for PHP 8
37+
38+
## 2.7.0 - 2020-10-28
39+
40+
- support custom error messages (#44)
41+
42+
## 2.6.1 - 2020-09-08
43+
44+
- add support for Laravel 8
45+
46+
## 2.6.0 - 2020-09-01
47+
48+
- adds the ability to specify an auth guard, and uses route name resolution for models (#41)
49+
50+
## 2.5.2 - 2020-07-01
51+
52+
- fix translation (#40)
53+
54+
## 2.5.1 - 2020-04-01
55+
56+
- fix nested attributes validation (#38)
57+
58+
## 2.5.0 - 2020-03-02
59+
60+
- add support for Laravel 7
61+
62+
## 2.4.0 - 2019-09-04
63+
64+
- add support for Laravel 6
65+
66+
## 2.3.4 - 2019-06-14
67+
68+
- fix validation messages
69+
70+
## 2.3.3 - 2019-06-12
71+
72+
- fix for determining the amount of value in the `Delimited` rule
73+
74+
## 2.3.2 - 2019-05-15
75+
76+
- fix for delimiting rule with a minimum of 1
77+
78+
## 2.3.1 - 2019-05-16
79+
80+
- fix for validating arrays
81+
82+
## 2.3.0 - 2019-05-16
83+
84+
- added `Delimited`
85+
86+
## 2.1.1 - 2019-02-27
87+
88+
- use PHPUnit 8 to run tests
89+
90+
## 2.1.0 - 2019-01-02
91+
92+
- add `CountryCode` rule for ISO3266 country codes
93+
94+
## 2.0.0 - 2018-12-19
95+
96+
- move all validation message translations to the `validation.*` group to be more consistent with Laravel
97+
- add relevant data for each rule to validation message translations (see `message` method for each rule)
98+
99+
## 1.0.3 - 2018-10-18
100+
101+
- fix `Enum` rule
102+
103+
## 1.0.2 - 2018-10-14
104+
105+
- fix typo in validation message
106+
107+
## 1.0.1 - 2018-10-12
108+
109+
- fix `Authorized` rule
110+
111+
## 1.0.0 - 2018-10-12
112+
113+
- initial release

0 commit comments

Comments
 (0)