yoanbernabeu/daplos-bundle
Symfony bundle for integrating DAPLOS into PHP applications. It handles configuration and service wiring, provides convenient API clients and helpers, and streamlines authentication, requests, and response handling so you can add DAPLOS-powered workflows with less boilerplate.
getTruncations() returns structured ExportTruncation records (FLAG, position, length, line number, original value, written value) after every export. This directly supports a "3 values were shortened to fit the standard — review" banner in the UI, and exporter.fail_on_truncation: true supports regulated or archival exports where a cut value is unacceptable. Default behavior is unchanged, so it ships behind a policy switch.ZHK appears on real market files but is absent from the synchronized referential, so every parcel carrying it is flagged. That is either a false-positive to suppress or an upstream data-quality conversation; the package lets you see it and decide.’) is fixed, with a re-sync path. If your product displays referential labels, this is a visible-quality bug fix, not a housekeeping item.Adopt when:
Look elsewhere or add guardrails when:
LineWriterInterface implementations. Only AbstractLineWriter subclasses report truncations without code changes; a writer implementing the interface directly keeps working but goes dark on truncation detection. Budget a small refactor if export integrity matters.float in the DTOs — numeric value survives, written form does not; (2) the parser reads DT (26-45) and PV (485-494) past the guide width to avoid losing data, so re-exporting such a file truncates. It is now reported, not prevented.daplos:sync; the ZHK case shows gaps produce false positives on legitimate market files. If sync runs against a source you do not control, plan for a suppression list.php bin/console daplos:sync and a generated config/reference.php, i.e. Symfony-shaped conventions, while the package is being evaluated for Laravel/PHP use. Confirm before committing: service-provider binding for DaplosFileExporter, console-command registration, config publishing, and where exporter.fail_on_truncation lives in a Laravel config tree.Migration cost (low, but not zero): re-run daplos:sync --all; decide whether to opt into fail_on_truncation; if you render or act on validator errors, expect new ones — especially codeUniteRendement values of ZHK. No signatures change.
For executives (one paragraph). This release converts a silent-failure risk into a managed one. On the inbound side, every coded field in a DAPLOS v0.95 file is now checked against the official nomenclature, and problems are reported per field rather than surfacing as a failed import — which means we can show users exactly what is wrong with their file and keep the transaction instead of losing it. On the outbound side, values that get shortened to fit the standard are now recorded and can optionally block the export, so we can state credibly that we never hand a regulator or a customer a quietly corrupted file. Both capabilities are additive: no API changes, no rework, and the export bytes are identical to the previous version unless we deliberately opt in. The strategic case is build-vs-buy: the DAPLOS guide is a large fixed-width specification that re-issues periodically, and maintaining that mapping in-house is permanent overhead with no product upside.
For engineering (what to actually do). Three migration steps, no code changes required. (1) Re-run the referential sync (daplos:sync --all) to decode HTML entities that have been persisted in labels — codes are unaffected. (2) Wire getTruncations() — available on DaplosFileExporter and any TruncationAwareInterface implementation — into logging or a user-facing warning after each export; the default non-blocking behavior is preserved. Optionally enable exporter.fail_on_truncation: true for archival or regulated exports, which throws DaplosExportException and does not write the file. (3) If we surface or gate on validator errors, expect new ones on previously valid files, most consistently codeUniteRendement = ZHK from certain market emitters — decide our warn-vs-reject policy and seed a suppression list before enabling the gate. Two things to confirm rather than assume: our Laravel wiring (the release notes are Symfony-shaped: bin/console, generated config/reference.php), and whether any custom writer implements LineWriterInterface directly — those still work but will not report truncations, and should be moved onto AbstractLineWriter.
The one caveat worth stating out loud. Tightening validation in a minor version is a behavior change even though no signature moved. Files that passed yesterday may be flagged today. That is the feature, not a regression — but it belongs in the release note we send to customers, not in the changelog they discover.
How can I help you explore Laravel packages today?