Skip to content

CFONB Parser

Parse French CFONB 120 and 240 bank files into typed PHP objects. Bank statements and transfers, with zero runtime dependencies.
Terminal window
composer require silarhi/cfonb-parser

Zero dependencies

Only PHP 8.2+ is required: nothing else gets pulled into your project.

CFONB 120 statements

Statement objects with their opening and closing balances (01/07), operations (04) and operation details (05).

CFONB 240 transfers

Transfer objects with a header (31), transactions (34) and a total (39).

Signed amounts

CFONB 120 amounts are decoded from their sign character and number of decimals: credits are positive, debits negative.

Typed value objects

Getters return floats, dates (DateTimeImmutable, typed DateTimeInterface for CFONB 240) and nullable strings, not raw arrays.

Tolerant input, strict parsing

\n, \r\n and \r (since 6.5) line endings and files without line breaks are read alike; a malformed line, or since 6.5 a record out of order, throws a ParseException instead of producing silent garbage.