Skip to content

Commit 87186c3

Browse files
authored
Merge branch 'master' into patch-3
2 parents 2bb1b9b + 3f1e22b commit 87186c3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/guides/v2.3/extension-dev-guide/cli-cmds/cli-howto.md

+9
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ Before you begin, make sure you understand the following:
5050
</config>
5151
```
5252

53+
or in the `__construct` method (declaration is similar to `di.xml`):
54+
55+
```php
56+
public function __construct()
57+
{
58+
parent::__construct('my:first:command');
59+
}
60+
```
61+
5362
Otherwise the [Symfony](https://github.com/symfony/console/blob/master/Application.php#L470) framework will return an `The command defined in "<Command class>" cannot have an empty name.` error.
5463

5564
## Add CLI commands using dependency injection {#cli-sample}

0 commit comments

Comments
 (0)