Skip to content

feat: add --silent, --quiet and --verbose to spark - #10643

Merged
paulbalandan merged 1 commit into
codeigniter4:4.8from
paulbalandan:spark-verbosity
Oct 23, 2026
Merged

paulbalandan merged 1 commit into
codeigniter4:4.8from
paulbalandan:spark-verbosity

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Description
Follow-up to #10628. Adds the verbosity levels on top of the Output object.

  • Every command gains --silent, --quiet / -q and --verbose / -v, -vv, -vvv. They have to ship with 4.8.0, so no third-party modern command claims the shortcuts first.
  • SHELL_VERBOSITY sets the level when no flag is given. While the command runs, spark sets it to the level in use, so child processes inherit it, and restores it afterwards.
  • Combined flags resolve to the quietest one (--silent > -q > -v), as in Symfony.
  • The level is a new Verbosity enum held by Output.
    • print(), write() and newLine() take the lowest level that shows the text.
    • isQuiet(), isVerbose(), isVeryVerbose() and isDebug() guard larger blocks.
  • Quiet drops normal writes but keeps errors, and silent drops errors too.
  • Quiet makes a modern command non-interactive.
  • Legacy commands follow the level, and still receive the flags as their own options.
  • An uncaught exception shows its backtrace from -v on, after the app/Views/errors/cli/error_exception.php update (listed in the upgrade guide).
  • lang:find uses the global --verbose in place of its own.

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 the 4.8 PRs that target the `4.8` branch. label Oct 19, 2026
@paulbalandan
paulbalandan requested a balanced review from Copilot October 19, 2026 13:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Numeric shortcuts fail during verbosity processing, and the documented options example conflicts with the new defaults.

2 open issues
What changed in this PR

Adds Spark verbosity controls for 4.8.0, building on the instance-based CLI output API.

Changes:

  • Adds global verbosity flags, environment fallback, and output filtering.
  • Integrates verbosity with command interaction, translation output, and exception backtraces.
  • Updates tests, examples, and release documentation.

Validation used targeted source inspection; runtime tests remain for CI.

File Description
user_guide_src/​source/​installation/​upgrade_480.rst Documents exception-view update.
user_guide_src/​source/​cli/​spark_commands.rst Explains flags and environment fallback.
user_guide_src/​source/​cli/​cli_modern_commands/​019.php Demonstrates verbosity-aware output.
user_guide_src/​source/​cli/​cli_modern_commands.rst Documents defaults and command integration.
user_guide_src/​source/​cli/​cli_library.rst Documents output levels and APIs.
user_guide_src/​source/​changelogs/​v4.8.0.rst Records verbosity support.
tests/​system/​Commands/​Translation/​LocalizationFinderTest.php Tests verbose translation reporting.
tests/​system/​Commands/​HelpCommandTest.php Updates expected help options.
tests/​system/​CLI/​OutputTest.php Tests filtering and level predicates.
tests/​system/​CLI/​ConsoleTest.php Tests flags and environment restoration.
tests/​system/​CLI/​AbstractGeneratorCommandTest.php Updates expected generator defaults.
tests/​system/​CLI/​AbstractCommandTest.php Tests defaults and quiet interaction.
tests/​_support/​Commands/​Modern/​VerbosityProbeCommand.php Adds verbosity test fixture.
system/​Commands/​Translation/​LocalizationFinder.php Uses global verbosity.
system/​CLI/​Verbosity.php Defines output levels.
system/​CLI/​Output.php Filters output by level.
system/​CLI/​Console.php Resolves flags and manages environment state.
system/​CLI/​AbstractCommand.php Registers flags and quiet interaction behavior.
app/​Views/​errors/​cli/​error_exception.php Enables verbose backtraces.

Review effort: Balanced

Comment thread system/CLI/Console.php Outdated
Comment thread user_guide_src/source/cli/cli_modern_commands.rst
@paulbalandan paulbalandan added the new feature PRs for new features label Oct 19, 2026
@paulbalandan
paulbalandan merged commit 7326b53 into codeigniter4:4.8 Oct 23, 2026
60 checks passed
@paulbalandan
paulbalandan deleted the spark-verbosity branch October 23, 2026 06:48
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. new feature PRs for new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants