Skip to content

Commit 90ffa3b

Browse files
authored
Merge pull request #8233 from cakephp/class-props-io-and-args
Add note about class properties for IO/Args
2 parents e745a35 + d504667 commit 90ffa3b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/en/console-commands/commands.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class HelloCommand extends Command
3737
```
3838

3939
Command classes must implement an `execute()` method that does the bulk of
40-
their work. This method is called when a command is invoked. Let's call our first
41-
command application directory, run:
40+
their work. This method is called when a command is invoked. Let's call our
41+
first command. From your application directory, run:
4242

4343
```bash
4444
bin/cake hello
@@ -48,6 +48,16 @@ You should see the following output:
4848

4949
Hello world.
5050

51+
::: info
52+
The `Arguments` and `ConsoleIo` instances passed to `execute()` are also
53+
available on the command instance as `$this->args` and `$this->io`.
54+
In 6.x, the `execute()` method signature will drop these arguments
55+
and `$this->args` / `$this->io` will be the only way to access
56+
these objects. See the
57+
[6.x command refactor](https://github.com/cakephp/cakephp/pull/18983) for
58+
details.
59+
:::
60+
5161
Our `execute()` method isn't very interesting let's read some input from the
5262
command line:
5363

0 commit comments

Comments
 (0)