Download the PHP package petroslabs/fr-validator-symfony without Composer
On this page you can find all versions of the php package petroslabs/fr-validator-symfony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download petroslabs/fr-validator-symfony
More information about petroslabs/fr-validator-symfony
Files in petroslabs/fr-validator-symfony
Package fr-validator-symfony
Short Description Symfony Validator constraints for petroslabs/fr-validator (French identifiers: NIR, RIB, SIREN/SIRET, IBAN, BIC, VAT, NAF, phone number)
License MIT
Informations about the package fr-validator-symfony
fr-validator-symfony
Symfony Validator constraints for petroslabs/fr-validator:
NIR, RIB, SIREN, SIRET, IBAN, BIC, VAT number, NAF/APE and phone number, as
#[Constraint] attributes.
Why a separate package
The core library has zero framework dependency on purpose — most consumers just want to check a string. This package exists only to translate that into Symfony's Validator component, with its own release cycle and test matrix across supported Symfony versions. If you don't use Symfony, you don't need this package at all.
Installation
Usage
Each constraint short-circuits on null/'' (combine with NotBlank if
emptiness itself should be rejected), and on failure exposes the core
library's typed failure reason — not just a generic "invalid" message — as
both the {{ reason }} message parameter and the violation code:
Constraints
| Constraint | Wraps |
|---|---|
Nir |
NIR (social security number) |
Rib |
RIB key |
Siren |
SIREN |
Siret |
SIRET |
Iban |
French IBAN |
Bic |
BIC/SWIFT (general format) |
Vat |
French VAT number |
Naf |
NAF/APE activity code (accepts additionalCodes, see the core package) |
Phone |
French phone number |
Scope and known limitations for each one are documented in the core package's README — this bridge doesn't change or repeat them.
Known v1 simplification
Messages ship with an English default and no pre-built translations —
override them like any other Symfony constraint (per-constraint message
option, or your app's own translations/validators.*.yaml since no custom
translation domain is set). A French-first package not shipping French
translations by default is a real gap; it's just not solved yet.
Development
See CONTRIBUTING.md.
Security
See SECURITY.md to report a vulnerability.
License
MIT — see LICENSE.
All versions of fr-validator-symfony with dependencies
petroslabs/fr-validator Version ^0.1
symfony/validator Version ^6.4 || ^7.0