Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# CPF functions
# CPF Validation Function

This tiny package contains some functions to validate a CPF (Brazilian ID)
This tiny package contains a function to validate a CPF (individual taxpayer identification number in Brazil).

## Requirements

PHP 7.4 or greater is required, nothing else.
PHP 8.5 or greater is required.

## Installation

Expand All @@ -17,7 +17,7 @@ PHP 7.4 or greater is required, nothing else.

## How to use it

### is_valid_cpf(string $cpf): bool
### is_valid_cpf(?string $cpf): bool

Returns true if the CPF is valid, false otherwise.

Expand All @@ -33,7 +33,7 @@ is_valid_cpf('17031733090') // returns true
is_valid_cpf('17031733000') // returns false
```

### assert_cpf(string $cpf): void
### assert_cpf(?string $cpf): void

Validates the CPF and throw an InvalidArgumentException if the CPF is not valid.

Expand All @@ -52,4 +52,4 @@ assert_cpf('17031733000')

## Running Tests

- From the project root, run: `vendor/bin/phpunit .`
- From the project root, run: `vendor/bin/phpunit tests`
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "cancio-labs/cpf-validation-function",
"description": "A function to validate a CPF (Brazilian ID)",
"description": "A function to validate a CPF (individual taxpayer identification number in Brazil)",
"type": "library",
"keywords": ["cpf", "brasil", "validation"],
"keywords": ["cpf", "brazil", "validation"],
"homepage": "https://github.com/canciolabs/cpf-validation-function",
"license": "GPL-3.0-or-later",
"authors": [
Expand Down Expand Up @@ -31,9 +31,9 @@
}
},
"require": {
"php": ">=7.4"
"php": ">=8.5"
},
"require-dev": {
"phpunit/phpunit": "^9.6"
"phpunit/phpunit": "^13.3"
}
}
Loading