Skip to content

fix: share the deferred blank line between Output and its forStderr() copy - #10673

Merged
paulbalandan merged 1 commit into
codeigniter4:4.8from
paulbalandan:output-stderr-deferred-newline
Oct 30, 2026
Merged

paulbalandan merged 1 commit into
codeigniter4:4.8from
paulbalandan:output-stderr-deferred-newline

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Description
Follow-up to #10669. forStderr() cloned the deferral flag, so a write through the STDERR copy cleared only the copy's flag. The original's next write to STDOUT then wrote a second blank line. This shows after a prompt followed by BaseCommand::showError(), which writes through the copy via CLI::redirectToStderr().

  • The copy now shares the flag with the original, so the blank line is written once by whichever writes first.
  • OutputTest assertions on multi-line plain text now compare the joined output as a nowdoc, with the stream order checked separately, so blank lines are visible at a glance.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@carson-codeigniter4 carson-codeigniter4 Bot added 4.8 PRs that target the `4.8` branch. bug Verified issues on the current code behavior or pull requests that will fix them labels Oct 29, 2026
@paulbalandan
paulbalandan force-pushed the output-stderr-deferred-newline branch from 67f9b88 to ae501c3 Compare October 29, 2026 07:05
@paulbalandan
paulbalandan force-pushed the output-stderr-deferred-newline branch from ae501c3 to 9143c51 Compare October 29, 2026 07:27
@paulbalandan
paulbalandan merged commit b924d2a into codeigniter4:4.8 Oct 30, 2026
58 checks passed
@paulbalandan
paulbalandan deleted the output-stderr-deferred-newline branch October 30, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.8 PRs that target the `4.8` branch. bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants