Skip to content

Commit ae75d7d

Browse files
author
Nilo Soares
committed
Merge branch 'release/1.0.0' into main
2 parents c7466cf + d63b96c commit ae75d7d

File tree

6 files changed

+860
-1
lines changed

6 files changed

+860
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
vendor/

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
1-
# cpf-validator
1+
# CPF Symfony Validator
2+
23
A custom Symfony Validator that validates CPF.
4+
5+
## Requirements
6+
7+
- PHP >= 7.4
8+
9+
## Installation
10+
11+
composer require cancio-labs/cpf-symfony-validator
12+
13+
## How to use it
14+
15+
Add the CpfConstraint in your entity...
16+
17+
use CancioLabs\Validator\Cpf\CpfConstraint;
18+
19+
#[CpfConstraint]
20+
private ?Cpf $cpf = null;
21+
22+
or add it to a constraint list:
23+
24+
use CancioLabs\Validator\Cpf\CpfConstraint;
25+
26+
$formBuilder->add('cpf', TextType::class, [
27+
'constraints' => [
28+
new CpfConstraint(),
29+
],
30+
]);

composer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "cancio-labs/cpf-symfony-validator",
3+
"description": "A custom Symfony Validator that validates CPF.",
4+
"type": "library",
5+
"keywords": ["symfony", "validator", "cpf"],
6+
"homepage": "https://github.com/canciolabs/cpf-symfony-validator",
7+
"license": "GPL-3.0-or-later",
8+
"authors": [
9+
{
10+
"name": "Nilo Soares",
11+
"email": "[email protected]"
12+
},
13+
{
14+
"name": "Cancio Labs",
15+
"email": "[email protected]"
16+
},
17+
{
18+
"name": "NSCPS Solutions",
19+
"email": "[email protected]"
20+
}
21+
],
22+
"autoload": {
23+
"psr-4": {
24+
"CancioLabs\\Validator\\Cpf\\": "src/"
25+
}
26+
},
27+
"autoload-dev": {
28+
"psr-4": {
29+
"CancioLabs\\Validator\\Cpf\\Tests\\": "tests/"
30+
}
31+
},
32+
"require": {
33+
"php": ">=8.0",
34+
"ext-intl": "*",
35+
"symfony/validator": "^5.4",
36+
"cancio-labs/cpf-validation-function": "^1.0"
37+
}
38+
}

0 commit comments

Comments
 (0)