A PHP parser for CAF LA44ZZ payment slips.
Turn the plain-text "bordereau de paiement" sent by the Caisse d'Allocations Familiales into typed PHP objects.
- LA44ZZ payment slips: every payment line of the table (beneficiary, period, gross, deduction and net amounts)
- Slip metadata: processing and payment dates, CAF name and address, recipient name and address, reference, BIC, IBAN and total
- Typed results: dates as
DateTimeInterface, amounts asfloat, French and English formats such as1 298,50or1,298.50 - Strict validation: malformed rows, malformed amounts and invalid or out-of-range dates throw a
ParseException - No dependencies: plain PHP, Windows (
\r\n) and Unix line endings
- PHP 8.2+
composer require silarhi/caf-parseruse Silarhi\Caf\Parser\PaymentSlipParser;
$paymentSlip = (new PaymentSlipParser())->parse(file_get_contents('/path/to/LA44ZZ.txt'));
$paymentSlip->getPaymentDate(); // DateTimeInterface
$paymentSlip->getTotalAmount(); // e.g. 600.0
foreach ($paymentSlip->getLines() as $line) {
$line->getBeneficiaryName(); // e.g. "MME EXEMPLE ALICE"
$line->getNetAmount(); // e.g. 312.0
}parse() throws a ParseException when the content is not a LA44ZZ payment slip, or a row, an amount or a date is invalid.
Everything else is on caf-parser.silarhi.dev:
- Installation and quick start
- LA44ZZ files: what a slip holds and which parts are read
- Parsing: the table, dates, amounts and metadata
- Error handling: when
parse()throws, and its messages - Reference:
PaymentSlipParser, parsed objects (PaymentSlip,PaymentSlipLine), exceptions
See CONTRIBUTING.md. Release notes are in CHANGELOG.md.
Released under the MIT License.
Built with care by SILARHI.
If CAF Parser saves you time, consider giving it a star on GitHub.