Skip to content

#259 - JsonStreamWriterTask: add a mode option - #261

Merged
njoubert-cleverage merged 2 commits into
mainfrom
259
Oct 12, 2026
Merged

njoubert-cleverage merged 2 commits into
mainfrom
259

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #259.

JsonStreamWriterTask already exists (since #168, with spl_file_object_flags / json_flags since #172) and already matches most of the issue: blocking task, each array input written as one line with JsonStreamFile::writeLine(), proceed() outputs the file path, {date} / {date_time} / {timestamp} / {unique_token} placeholders, non-array input rejected with an \UnexpectedValueException. Documented in docs/reference/tasks/json_stream_writer_task.md.

What was missing, added here:

Tests added in JsonStreamWriterTaskTest: overwrite by default, ab mode appends, mode type validation, placeholders replaced in both the written and output path, non-array input, finalize(). PHPStan, PHPUnit (869 tests), PHP-CS-Fixer and Rector pass. Demonstrated by demo.file.json_stream_writer_append in process-bundle-demo.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: new option whose default is the previous behaviour.

🤖 Generated with Claude Code

…e.g. ab to append to an existing JSON Lines file), and release the file on finalize(). Update documentation, add tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 29db12e into main Oct 12, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a JsonStreamWriterTask to write JSON Lines files

1 participant