Skip to content

Commit

Permalink
Add documentation notes for cakephp/cakephp#17956
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 11, 2024
1 parent bb77820 commit d5377b7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
25 changes: 25 additions & 0 deletions en/appendices/5-2-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ Behavior Changes
class is a subclass of ``BadRequestException``, and offers the benefit of
being filterable from logging.

Deprecations
============

Console
-------

- ``Arguments::getMultipleOption()`` is deprecated. Use ``getArrayOption()``
instead.


New Features
============

Expand All @@ -27,6 +37,21 @@ Console
regenerate counters for models that use ``CounterCacheBehavior``.
- ``ConsoleIntegrationTestTrait::debugOutput()`` makes it easier to debug
integration tests for console commands.
- ``ConsoleInputArgument`` now supports a ``separator`` option. This option
allows positional arguments to be delimited with a character sequence like
``,``. CakePHP will split the positional argument into an array when arguments
are parsed.
- ``Arguments::getArrayArgumentAt()``, and ``Arguments::getArrayArgument()``
were added. These methods allow you to read ``separator`` delimitered
positional arguments as arrays.
- ``ConsoleInputOption`` now supports a ``separator`` option. This option
allows option values to be delimited with a character sequence like
``,``. CakePHP will split the option value into an array when arguments
are parsed.
- ``Arguments::getArrayArgumentAt()``, ``Arguments::getArrayArgument()``, and
``Arguments::getArrayOption()``
were added. These methods allow you to read ``separator`` delimitered
positional arguments as arrays.

ORM
---
Expand Down
11 changes: 11 additions & 0 deletions en/console-commands/option-parsers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,16 @@ You can use the following options when creating an argument:
* ``choices`` An array of valid choices for this argument. If left empty all
values are valid. An exception will be raised when parse() encounters an
invalid value.
* ``separator`` A character sequence that separates arguments that should be
parsed into an array.

Arguments that have been marked as required will throw an exception when
parsing the command if they have been omitted. So you don't have to
handle that in your shell.

.. versionadded:: 5.2.0
The ``separator`` option was added.

Adding Multiple Arguments
-------------------------

Expand Down Expand Up @@ -140,10 +145,16 @@ of the option:
Defaults to ``false``.
* ``multiple`` - The option can be provided multiple times. The parsed option
will be an array of values when this option is enabled.
* ``separator`` - A character sequence that the option value is split into an
array with.
* ``choices`` - An array of valid choices for this option. If left empty all
values are valid. An exception will be raised when parse() encounters an
invalid value.


.. versionadded:: 5.2.0
The ``separator`` option was added.

Adding Multiple Options
-----------------------

Expand Down

0 comments on commit d5377b7

Please sign in to comment.