@@ -24,8 +24,8 @@ need to ensure your controller can locate it via a ``use`` statement above your
2424
2525The class is automatically initialized when the file is loaded the first time.
2626
27- Since v4.8.0 the static methods delegate to instance classes, which you can also use directly.
28- See :ref: `cli-library-classes `.
27+ Since v4.8.0 the static methods delegate to instance classes, which you can also use directly. See
28+ :ref: `cli-library-classes `.
2929
3030Getting Input from the User
3131***************************
@@ -95,16 +95,15 @@ select() and multiselect()
9595
9696.. versionadded :: 4.8.0
9797
98- ``select() `` and ``multiselect() `` on :php:class: `Prompt ` let the user pick with the arrow keys
99- (or `` j `` and `` k ``), tick with the space bar, tick everything or nothing with ``a ``, and confirm
100- with enter. ``select () `` returns the chosen key, and `` multiselect() `` returns the ticked options,
101- keyed as in `` $options ``. Both take any keys, and long lists scroll:
98+ ``select() `` and ``multiselect() `` on :php:class: `Prompt ` let the user pick with the arrow keys (or `` j `` and `` k ``),
99+ tick with the space bar, tick everything or nothing with ``a ``, and confirm with enter. `` select() `` returns the chosen
100+ key, and ``multiselect () `` returns the ticked options, keyed as in `` $options ``. Both take any keys, and long lists
101+ scroll:
102102
103103.. literalinclude :: cli_library/026.php
104104
105- Where keys cannot be read one by one, such as on Windows or when the input is piped, both prompts
106- list the options by number and ask for the number, or numbers separated by commas. The filters
107- question above then reads:
105+ Where keys cannot be read one by one, such as on Windows or when the input is piped, both prompts list the options by
106+ number and ask for the number, or numbers separated by commas. The filters question above then reads:
108107
109108.. code-block :: console
110109
@@ -116,9 +115,9 @@ question above then reads:
116115
117116 Under WSL, PHP runs as on Linux and reads the keys.
118117
119- On a quiet output (see :ref: `spark-verbosity `) both prompts return the defaults without asking,
120- and a required ``multiselect() `` without a default throws a ``CLIException ``. They also throw it
121- when piped input ends before a valid answer.
118+ On a quiet output (see :ref: `spark-verbosity `) both prompts return the defaults without asking, and a required
119+ ``multiselect() `` without a default throws a ``CLIException ``. They also throw it when piped input ends before a valid
120+ answer.
122121
123122Pressing Ctrl+C restores the terminal and then interrupts the process as usual.
124123
@@ -309,52 +308,50 @@ The Classes Behind the Facade
309308
310309.. versionadded :: 4.8.0
311310
312- The static output methods delegate to instance classes, each with one job.
313- ``CLI::getOutput() `` and ``CLI::getTerminal() `` return the shared instances, and
314- modern commands reach the output through ``$this->getOutput() ``
311+ The static output methods delegate to instance classes, each with one job. ``CLI::getOutput() `` and
312+ ``CLI::getTerminal() `` return the shared instances, and modern commands reach the output through ``$this->getOutput() ``
315313(see :ref: `modern-commands-writing-output `):
316314
317315.. literalinclude :: cli_library/024.php
318316
319- Mixing the static methods with the instance is safe, because both write to the same
320- `` Output `` and share its line breaks.
317+ Mixing the static methods with the instance is safe, because both write to the same `` Output `` and share its line
318+ breaks.
321319
322- The prompt methods delegate to :php:class: `Prompt `, which reads through an ``Output ``.
323- ``CLI::getPrompt() `` returns one on the shared output, and modern commands reach one on the
324- output of their run through ``$this->getPrompt() ``:
320+ The prompt methods delegate to :php:class: `Prompt `, which reads through an ``Output ``. ``CLI::getPrompt() `` returns one
321+ on the shared output, and modern commands reach one on the output of their run through ``$this->getPrompt() ``:
325322
326323.. literalinclude :: cli_library/025.php
327324
328325.. php :namespace :: CodeIgniter\CLI
329326
330327 .. php :class :: Output
331328
332- The writer. It targets STDOUT, sends ``error() `` to STDERR, and remembers whether the
333- cursor sits mid-line so that ``write() `` starts on a fresh line.
329+ The writer. It targets STDOUT, sends ``error() `` to STDERR, and remembers whether the cursor sits mid-line so that
330+ ``write() `` starts on a fresh line.
334331
335332 .. php :method :: __construct([InputOutput $io = new InputOutput()[, Terminal $terminal = new Terminal()]])
336333
337334 :param InputOutput $io: The transport the text is written through.
338- :param Terminal $terminal: The terminal consulted for colour support.
335+ :param Terminal $terminal: The terminal consulted for color support.
339336
340337 .. php :method :: print(string $text = ''[, string $foreground = ''[, string $background = ''[, Verbosity $verbosity = Verbosity::Normal]]]): void
341338 .. php :method :: write(string $text = ''[, string $foreground = ''[, string $background = ''[, Verbosity $verbosity = Verbosity::Normal]]]): void
342339 .. php :method :: newLine([int $num = 1[, Verbosity $verbosity = Verbosity::Normal]]): void
343340
344- The same as the static methods of the same names, writing nothing when the
345- level of the output is below ``$verbosity ``.
341+ The same as the static methods of the same names, writing nothing when the level of the output is below
342+ ``$verbosity ``.
346343
347344 .. php :method :: deferNewLine(): void
348345
349- Writes a blank line before whatever is written next, and none if nothing follows.
350- The prompts end with it, so a prompt that ends the run leaves no blank line behind.
346+ Writes a blank line before whatever is written next, and none if nothing follows. The prompts end with it, so a
347+ prompt that ends the run leaves no blank line behind.
351348
352349 .. php :method :: error(string $text[, string $foreground = 'light_red'[, string $background = '']]): void
353350 .. php :method :: beep(int $num = 1): void
354351 .. php :method :: clearScreen(): void
355352
356- The same as the static methods of the same names. ``error() `` writes at every
357- level but `` Verbosity::Silent ``, and the other two only from ``Verbosity::Normal `` on.
353+ The same as the static methods of the same names. ``error() `` writes at every level but `` Verbosity::Silent ``,
354+ and the other two only from ``Verbosity::Normal `` on.
358355
359356 .. php :method :: getVerbosity(): Verbosity
360357 .. php :method :: setVerbosity(Verbosity $verbosity): void
@@ -363,27 +360,27 @@ output of their run through ``$this->getPrompt()``:
363360 .. php :method :: isVeryVerbose(): bool
364361 .. php :method :: isDebug(): bool
365362
366- ``isQuiet() `` is true for the quiet and silent levels, and the others for their
367- level or above. See :ref: `modern-commands-verbosity `.
363+ ``isQuiet() `` is true for the quiet and silent levels, and the others for their level or above. See
364+ :ref: `modern-commands-verbosity `.
368365
369366 .. php :method :: color(string $text, string $foreground[, string $background = ''[, string $format = '']]): string
370367
371- Colours the text when the target stream supports colours , and returns it unchanged otherwise.
372- ``print() ``, `` write() ``, and ``error() `` colour through this method, so a subclass overriding
373- it changes the colouring of every write.
368+ Colors the text when the target stream supports colors , and returns it unchanged otherwise. `` print() ``,
369+ ``write() ``, and ``error() `` color through this method, so a subclass overriding it changes the coloring of
370+ every write.
374371
375372 .. php :method :: wrap(string $text[, int $max = 0[, int $padLeft = 0]]): string
376373
377374 The same as ``CLI::wrap() ``, measuring the terminal of this output.
378375
379376 .. php :method :: isDecorated(): bool
380377
381- Whether the target stream supports colours .
378+ Whether the target stream supports colors .
382379
383380 .. php :method :: forStderr(): static
384381
385- Returns a copy whose STDOUT writes target STDERR, which is what the framework swaps in
386- while rendering an exception.
382+ Returns a copy whose STDOUT writes target STDERR, which is what the framework swaps in while rendering an
383+ exception.
387384
388385 .. php :method :: getTerminal(): Terminal
389386
@@ -418,9 +415,8 @@ output of their run through ``$this->getPrompt()``:
418415
419416.. php :class :: Verbosity
420417
421- The level of the output, as an ``int ``-backed enum valued as ``SHELL_VERBOSITY ``:
422- ``Silent `` (-2), ``Quiet `` (-1), ``Normal `` (0), ``Verbose `` (1), ``VeryVerbose `` (2),
423- and ``Debug `` (3).
418+ The level of the output, as an ``int ``-backed enum valued as ``SHELL_VERBOSITY ``: ``Silent `` (-2), ``Quiet `` (-1),
419+ ``Normal `` (0), ``Verbose `` (1), ``VeryVerbose `` (2), and ``Debug `` (3).
424420
425421.. php :class :: Terminal
426422
@@ -442,14 +438,13 @@ output of their run through ``$this->getPrompt()``:
442438
443439 .. php :method :: advanceTo(float|int $step[, int $totalSteps = 10]): void
444440
445- Draws the bar for the step, capped at 100%, over the previous bar unless the step
446- went backwards. A negative step or a total below one throws ``InvalidArgumentException ``,
447- where `` CLI::showProgress() `` keeps tolerating them.
441+ Draws the bar for the step, capped at 100%, over the previous bar unless the step went backwards. A negative
442+ step or a total below one throws ``InvalidArgumentException ``, where `` CLI::showProgress() `` keeps tolerating
443+ them.
448444
449445 .. php :method :: clear(): void
450446
451- Rings the bell and starts a new bar on the next ``advanceTo() ``. This is what
452- ``CLI::showProgress(false) `` does.
447+ Rings the bell and starts a new bar on the next ``advanceTo() ``. This is what ``CLI::showProgress(false) `` does.
453448
454449.. php :class :: Table
455450
@@ -464,12 +459,12 @@ output of their run through ``$this->getPrompt()``:
464459
465460.. php :class :: Color
466461
467- The ANSI colour codes, independent of any stream.
462+ The ANSI color codes, independent of any stream.
468463
469464 .. php :staticmethod :: apply(string $text, string $foreground[, string $background = ''[, string $format = '']]): string
470465
471- Wraps the text in the colour codes, always. Throws ``CLIException `` for an unknown colour .
466+ Wraps the text in the color codes, always. Throws ``CLIException `` for an unknown color .
472467
473468 .. php :staticmethod :: width(string $string): int
474469
475- Returns the display width of the text without its colour codes, as ``CLI::strlen() `` does.
470+ Returns the display width of the text without its color codes, as ``CLI::strlen() `` does.
0 commit comments